def dedup(records):
    """Remove any identical records from the list.

    Args:
        records (list(dict)): the list of dicts to be filtered.

    Returns:
        list(dict): the list of records with any duplicates removed.

    The list returned contains records in the same order as the original list.
    """
    seen = set()
    filtered = []
    for record in records:
        key = tuple(sorted(record.items()))
        if key not in seen:
            seen.add(key)
            filtered.append(record)
    return filtered