Find the line of a TOML key such as id = "C-1" in a file.
tomllib keeps no positions, so this is a line-oriented text search. It looks for a line that holds the key, an equals sign and the quoted value, for example module = "core". The key may be bare or quoted. Without value any line with the key matches. A key that appears on several lines is ambiguous, so the search then returns None rather than a possibly wrong line. With top_level only the lines before the first table header ([x] or [[x]]) are searched, so a unit-level key such as evaluations is not confused with the same key of an [[intent]] item.