def visit(self):
        """
        This function *visits* its children in a recursive
        way.

        It will first *visit* the children that
        that have a z-order value less than 0.

        Then it will call the :meth:`draw` method to
        draw itself.

        And finally it will *visit* the rest of the
        children (the ones with a z-value bigger
        or equal than 0)

        Before *visiting* any children it will call
        the :meth:`transform` method to apply any possible
        transformations.
        """
        if not self.visible:
            return

        position = 0

        if self.grid or self.grid.active:
            self.grid.before_draw()

        # we visit all nodes that should be drawn before ourselves

        if self.children and self.children[0][0] < 0:
            gl.glPushMatrix()
            self.transform()
            for z, c in self.children:
                if z >= 0:
                    break
                position += 1
                c.visit()

            gl.glPopMatrix()

        # we draw ourselves
        self.draw()

        # we visit all the remaining nodes, that are over ourselves
        if position < len(self.children):
            gl.glPushMatrix()
            self.transform()
            for z, c in self.children[position:]:
                c.visit()
            gl.glPopMatrix()

        if self.grid and self.grid.active:
            self.grid.after_draw(self.camera)
dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py/CocosNode.visit/operator `and` -> `or`