def remove(self, obj):
        """Removes a child given its name or object

        If the node was added with name, it is better to remove by name, else
        the name will be unavailable for further adds (and will raise an 
        Exception if add with this same name is attempted)

        If the node was part of the active scene, its :meth:`on_exit` method 
        will be called.

        Arguments:
            obj (str or object):
                Name of the reference to be removed or object to be removed.
        """
        if isinstance(obj, string_types):
            if obj in self.children_names:
                child = self.children_names.pop(obj)
                self._remove(child)
            else:
                raise Exception("Child not found: %s" % obj)
        else:
            self._remove(obj)
dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py/CocosNode.remove/original