def get_pairs_from( all_pairs, pssms_1, pssms_2 ):
    """Returns pairs from all_pairs that have one pssm from pssms_1 and one pssm
    from pssms_2
    """
    return [
            p
            for p
            in all_pairs
            if (
                    (p.binder_pair[0] in pssms_1) and (p.binder_pair[1] in pssms_2)
            ) or (
                    (p.binder_pair[1] in pssms_1) and (p.binder_pair[0] in pssms_2)
            )
    ]