def _match(qs, ks):
    """Return True if regexes in qs match any window of strings in tuple ks."""
    # compile regexes and force complete match
    qts = tuple((re.compile(x + "$") for x in qs))
    for i in range(len(ks) - len(qs) + 1):
        matches = [x.match(y) for x, y in zip(qts, ks[i:])]
        if matches and all(matches):
            return True
    return False
Return True if regexes in qs match any window of strings in tuple ks.
dpkd/transformers/examples/research_projects/jax-projects/model_parallel/partitions.py