def unschedule(self, callback):
        """
        Remove a function from the schedule.

        If the function appears in the schedule more than once, all occurances
        are removed. If the function was not scheduled, no error is raised.

        This function is a wrapper to pyglet.clock.unschedule.
        It has the additional benefit that all calllbacks are paused and
        resumed when the node leaves or enters a scene.

        You should not unschedule things using pyglet that where scheduled
        by :meth:`schedule`/:meth:`schedule_interval`.
        
        Arguments:
            callback (a function):
                The function to remove from the schedule.
        """

        self.scheduled_calls = [
            c for c in self.scheduled_calls if c[0] != callback
            ]
        self.scheduled_interval_calls = [
            c for c in self.scheduled_interval_calls if c[0] != callback
            ]

        if self.is_running:
            pyglet.clock.unschedule(callback)
dataset/ETHPy150Open los-cocos/cocos/cocos/cocosnode.py/CocosNode.unschedule/original