code: def _cancel_task(task_id):
      # type: (str) -> ()
      if not task_id:
          return
      t = Task.get_task(task_id=task_id)
      status = t.status
      if status in ("in_progress",):
          t.stopped(force=True)
      elif status in ("queued",):
          Task.dequeue(t)
  
imports: import json
  import logging
  from datetime import datetime
  from threading import Thread, enumerate
  from time import sleep, time
  from typing import List, Union, Optional, Callable, Sequence, Dict
  from attr import attrs, attrib
  from dateutil.relativedelta import relativedelta
  from .job import ClearmlJob
  from .controller import PipelineController
  from ..backend_interface.util import datetime_from_isoformat, datetime_to_isoformat, mutually_exclusive
  from ..task import Task
label_desc: Use image node_id 14 for calling the BaseScheduler obj's underlying member method code with example usage: obj._cancel_task(task_id) without return types