def METHOD_NAME(lines: Iterator[str], pat: re.Pattern) -> re.Match:
    for line in lines:
        match = pat.match(line)
        if match:
            return match
    raise AssertionError("failed to parse file")