module documentation

_filter_stmts and helper functions. This method gets used in LocalsDictnodes.NodeNG._scope_lookup. It is not considered public.

Function _filter_stmts Filter the given list of statements to remove ignorable statements.
Function _get_filtered_node_statements Undocumented
Function _get_if_statement_ancestor Return the first parent node that is an If node (or None).
Function _is_from_decorator Return whether the given node is the child of a decorator.
def _filter_stmts(base_node: nodes.NodeNG, stmts, frame, offset): (source)

Filter the given list of statements to remove ignorable statements. If base_node is not a frame itself and the name is found in the inner frame locals, statements will be filtered to remove ignorable statements according to base_node's location. :param stmts: The statements to filter. :type stmts: list(nodes.NodeNG) :param frame: The frame that all of the given statements belong to. :type frame: nodes.NodeNG :param offset: The line offset to filter statements up to. :type offset: int :returns: The filtered statements. :rtype: list(nodes.NodeNG)

def _get_filtered_node_statements(base_node: nodes.NodeNG, stmt_nodes: list[nodes.NodeNG]) -> list[tuple[nodes.NodeNG, nodes.Statement]]: (source)

Undocumented

def _get_if_statement_ancestor(node: nodes.NodeNG) -> nodes.If|None: (source)

Return the first parent node that is an If node (or None).

def _is_from_decorator(node) -> bool: (source)

Return whether the given node is the child of a decorator.