Path 1: 2802 calls (0.65)

ClassDef (2802)

Name (2798) AssignName (4)

False (2115) True (687)

GeneratorExit (687)

1def is_ancestor_name(frame: nodes.ClassDef, node: nodes.NodeNG) -> bool:
2    """Return whether `frame` is an astroid.Class node with `node` in the
3    subtree of its bases attribute.
4    """
5    if not isinstance(frame, nodes.ClassDef):
6        return False
7    return any(node in base.nodes_of_class(nodes.Name) for base in frame.bases)
            

Path 2: 1537 calls (0.35)

FunctionDef (1521) AsyncFunctionDef (16)

Name (1535) AssignName (2)

False (1537)

1def is_ancestor_name(frame: nodes.ClassDef, node: nodes.NodeNG) -> bool:
2    """Return whether `frame` is an astroid.Class node with `node` in the
3    subtree of its bases attribute.
4    """
5    if not isinstance(frame, nodes.ClassDef):
6        return False
7    return any(node in base.nodes_of_class(nodes.Name) for base in frame.bases)