def get_ancestor(self, klass):
        if isinstance(self, klass):
            return self
        parent = self.parent
        if parent:
            return parent.get_ancestor(klass)

    #
    # Transform properties
    #
Walks the nodes tree upwards until it finds a node of the class
dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py/CocosNode.get_ancestor