def make_id_filter(pdb_ids, pdb_chains):
    """
    Generate a dataset filter only allowing specific PDB ID/Chains.

    Parameters
    ----------
    pdb_ids    : list
        List of PDB IDs to accept.
    pdb_chains : list
        List of PDB chains corresponding to the IDs in `pdb_ids`.

    Returns
    -------
    Function
        A function returning True for the given PDB ID/Chain and False otherwise.
    """
    ids = set([f"{pid.upper()}_{chn}" for pid, chn in zip(pdb_ids, pdb_chains)])
    def func(record):
        return f"{record.pdb_id}_{record.pdb_chain}" in ids
    return func