

def walk(self, callback, collect=None):
    '\n        Executes callback on all the subtree starting at self.\n        returns a list of all return values that are not ``None``.\n\n        Arguments:\n            callback (a function):\n                Callable that takes a :class:`CocosNode` as an argument.\n            collect (list):\n                List of non-`None` returned values from visited nodes.\n\n        Returns:\n            list: The list of non-`None` return values.\n\n        '
    if (collect is None):
        collect = []
    r = callback(self)
    if (r is not None):
        collect.append(r)
    for node in self.get_children():
        node.walk(callback, collect)
    return collect

dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py CocosNode.walk/original