def find_ast_node(module: ast.Module, lineno: Optional[int]) -> Optional[ast.AST]:
if lineno is not None: # pragma: no branch
for i in getattr(module, "body", ()):
if i.lineno == lineno:
return cast(ast.AST, i)
r = find_ast_node(i, lineno)
if r is not None:
return r
return None