code: def celery_clear(
      self: "LocalCeleryQueue",
      queued: bool = False,
      failed: bool = False,
      success: bool = False,
  ) -> List[str]:
      """Remove entries from the queue.
  
      Arguments:
          queued: Remove all queued tasks.
          failed: Remove all failed tasks.
          success: Remove all success tasks.
  
      Returns:
          Revisions which were removed.
      """
  
      removed: List[str] = []
      entry_list: List["QueueEntry"] = []
      if queued:
          queue_entries: List["QueueEntry"] = list(self.iter_queued())
          entry_list.extend(queue_entries)
          removed.extend(_get_names(queue_entries))
      if failed:
          failed_tasks: List["QueueDoneResult"] = list(
              self.iter_failed()
          )
          entry_list.extend([result.entry for result in failed_tasks])
          removed.extend(_get_names(failed_tasks))
      if success:
          success_tasks: List["QueueDoneResult"] = list(
              self.iter_success()
          )
          entry_list.extend([result.entry for result in success_tasks])
          removed.extend(_get_names(success_tasks))
  
      remove_tasks(self, entry_list)
  
      return removed
  
imports: from typing import TYPE_CHECKING, Collection, Dict, Iterable, List, Set, Union
  from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
  from dvc.repo.experiments.queue.base import QueueDoneResult
label_desc: Use image node_id 3 for calling a global function with example usage: celery_clear(queued, failed, success) and returns: removed