Path 1: 32 calls (1.0)

Global (32)

'CONSTANT' (5) 'CONST' (3) 'missing' (2) 'SOMETHING' (2) 'HOP' (1) 'SOMEVAR' (1) 'sys' (1) 'namedtuple' (1) 'FUNC' (1) 'CLASS' (1)

False (21) True (11)

GeneratorExit (11)

1def is_reassigned_after_current(node: nodes.NodeNG, varname: str) -> bool:
2    """Check if the given variable name is reassigned in the same scope after the
3    current node.
4    """
5    return any(
6        a.name == varname and a.lineno > node.lineno
7        for a in node.scope().nodes_of_class(
8            (nodes.AssignName, nodes.ClassDef, nodes.FunctionDef)
9        )
10    )