def find_pair_in_hits(
        hits,
        pair,
        max_separation = None,
        separation = None
):
    """Finds the locations where a pair of TFs bind in a sequence of hits

    hits: The hits
    pair: A tuple ( binder1, binder2, orientation1, orientation2 )
    max_separation: If specified determines maximum separation
    separation: If specified determines exact separation (overrides max_separation)

    returns a sequence of pairs of hits that satisfy the criteria
    """
    ( binder1, binder2, orientation1, orientation2 ) = pair
    result = [ ]
    for h1 in hits:
        if binder1 != h1.binder: continue
        for h2 in hits:
            if binder2 != h2.binder: continue
            if h1.location.overlap( h2.location ): continue
            distance = h1.location.separation( h2.location )
            if None != separation and separation != distance: continue
            if None != max_separation and max_separation < distance: continue
            if h1.location.position < h2.location.position:
                if (
                        h1.location.positive_strand != orientation1
                        or
                        h2.location.positive_strand != orientation2
                ): continue
            else:
                if (
                        h1.location.positive_strand == orientation1
                        or
                        h2.location.positive_strand == orientation2
                ): continue
            result.append( ( h1, h2 ) )
    return result