def search(sequence, expected, finder):
    for element in sequence:
        if finder(element) == expected:
            return element
    return RuntimeError(f"Could not find an element with '{expected}'")

12a314916eac91dee855cdaa38746fd1fc09577f
<mask token>

def search(sequence, expected, finder):
    for element in sequence:
        if finder(element) == expected:
            return element
    return RuntimeError(f"Could not find an element with '{expected}'")
