code: def remove_task(cls, task):
          
          with cls._lock:
              if not isinstance(task, Task):
                  task = cls.resolved_task(task)
  
              if task:
                  cls.tasks.remove(task)
  
              cls.tasks.sort()
docs: :param Task|callable task: Remove 'task' from the list of tasks to run periodically