def filter_records(record):
    """
    Filter VCF records to those informative for BAF genotyping.

    Returns only records which match all of the following criteria:
    1) Biallelic
    2) SNP
    3) FILTER == PASS

    Parameters
    ----------
    records : iterator of pysam.VariantRecords

    Returns
    ------
    record : pysam.VariantRecord
    """

    # for record in records:
    # Restrict to biallelic sites
    if len(record.alleles) > 2:
        return

    # Restrict to variants which PASS
    if record.filter.keys() != ['PASS']:
        return

    # Restrict to SNPs
    ref, alt = record.alleles
    if len(ref) > 1 or len(alt) > 1:
        return

    return record