def _find_statement_by_line(node, line):
if isinstance(node, (nodes.ClassDef, nodes.FunctionDef)):<EOL><INDENT>node_line = node.fromlineno<EOL><DEDENT>else:<EOL><INDENT>node_line = node.lineno<EOL><DEDENT>if node_line == line:<EOL><INDENT>return node<EOL><DEDENT>for child in node.get_children():<EOL><INDENT>result = _find_statement_by_line(child, line)<EOL>if result:<EOL><INDENT>return result<EOL><DEDENT><DEDENT>return None<EOL>
Extracts the statement on a specific line from an AST.

    If the line number of node matches line, it will be returned;
    otherwise its children are iterated and the function is called
    recursively.

    :param node: An astroid node.
    :type node: astroid.bases.NodeNG
    :param line: The line number of the statement to extract.
    :type line: int
    :returns: The statement on the line, or None if no statement for the line
      can be found.
    :rtype:  astroid.bases.NodeNG or None