def add(self, child, z=0, name=None):
        """Adds a child and if it becomes part of the active scene, it calls
        its :meth:`on_enter` method.

        Arguments:
            child (CocosNode):
                object to be added
            z (Optional[float]):
                the child z index. Defaults to 0.
            name (Optional[str]):
                Name of the child. Defaults to ``None``

        Returns:
            CocosNode: self

        """
        # child must be a subclass of supported_classes
        # if not isinstance( child, self.supported_classes ):
        #    raise TypeError("%s is not instance of: %s" % (type(child), self.supported_classes) )

        if name:
            if name in self.children_names:
                raise Exception("Name already exists: %s" % name)
            self.children_names[name] = child

        child.parent = self

        elem = z, child

        # inlined and customized bisect.insort_right, the stock one fails in py3
        lo = 0
        hi = len(self.children)
        a = self.children
        while lo != hi:
            mid = (lo+hi) // 2
            if z < a[mid][0]:
                hi = mid
            else:
                lo = mid + 1
        self.children.insert(lo, elem)

        if self.is_running:
            child.on_enter()
        return self
dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py/CocosNode.add/operator `<` -> `!=`