src/transformers/models/layoutlmv2/tokenization_layoutlmv2.py/subfinder
def subfinder(mylist, pattern):
    matches = []
    indices = []
    for idx, i in enumerate(range(len(mylist))):
        if mylist[i] == pattern[0] and mylist[i : i + len(pattern)] == pattern:
            matches.append(pattern)
            indices.append(idx)
    if matches:
        return matches[0], indices[0]
    else:
        return None, 0