Path 1: 21 calls (1.0)

Global (21)

'CONST' (3) 'CONSTANT' (2) 'missing' (2) 'SOMETHING' (2) 'HOP' (1) 'sys' (1) 'namedtuple' (1) 'RAN_DB_SET' (1) 'RAN_DB_DICT' (1) 'GLOBAL_VAR' (1)

False (20) True (1)

GeneratorExit (1)

1def is_deleted_after_current(node: nodes.NodeNG, varname: str) -> bool:
2    """Check if the given variable name is deleted in the same scope after the current
3    node.
4    """
5    return any(
6        getattr(target, "name", None) == varname and target.lineno > node.lineno
7        for del_node in node.scope().nodes_of_class(nodes.Delete)
8        for target in del_node.targets
9    )