Method: pylint.checkers.utils.assign_parent
Calls: 6495, Exceptions: 0, Paths: 2Back
Path 1: 4334 calls (0.67)
AssignName (4334)
Arguments (2301) Assign (1278) Comprehension (288) For (262) NamedExpr (73) ExceptHandler (37) AnnAssign (34) With (31) AugAssign (14) MatchAs (6)
1def assign_parent(node: nodes.NodeNG) -> nodes.NodeNG:
2 """Return the higher parent which is not an AssignName, Tuple or List node."""
3 while node and isinstance(node, (nodes.AssignName, nodes.Tuple, nodes.List)):
4 node = node.parent
5 return node
Path 2: 2161 calls (0.33)
ClassDef (670) ImportFrom (585) FunctionDef (373) Import (355) Arguments (162) AsyncFunctionDef (12) DelName (3) Instance (1)
ClassDef (670) ImportFrom (585) FunctionDef (373) Import (355) Arguments (162) AsyncFunctionDef (12) DelName (3) Instance (1)
1def assign_parent(node: nodes.NodeNG) -> nodes.NodeNG:
2 """Return the higher parent which is not an AssignName, Tuple or List node."""
3 while node and isinstance(node, (nodes.AssignName, nodes.Tuple, nodes.List)):
4 node = node.parent
5 return node