code: def extract_tasks(
      mod: IRModule,
      target: Union[Target, str],
      params: Optional[Dict[str, NDArray]],
      *,
      opt_level: int = 3,
      pass_config: Mapping[str, Any] = MappingProxyType(
          {
              "relay.backend.use_meta_schedule": True,
              "relay.backend.tir_converter": "default",
          }
      ),
      executor: Optional["relay.backend.Executor"] = None,
      runtime: Optional["relay.backend.Runtime"] = None,
      module_equality: str = "structural",
      disabled_pass: Optional[
          Union[List[str], Set[str], Tuple[str]]
      ] = None,
      instruments: Optional[Sequence[PassInstrument]] = None,
  ) -> List[ExtractedTask]:
      """Extract tuning tasks from a relay program.
  
      Parameters
      ----------
      mod : IRModule
          The module or function to tune
      target : tvm.target.Target
          The compilation target
      params : Optional[Dict[str, tvm.runtime.NDArray]]
          The associated parameters of the program
      opt_level : int
          The optimization level of the compilation
      pass_config : Mapping[str, Any]
          The pass configuration
      executor : Optional[relay.backend.Executor]
          The executor to use
      runtime : Optional[relay.backend.Runtime]
          The runtime to use
      module_equality : Optional[str]
          A string to specify the module equality testing and hashing method.
          It must be one of the followings:
            - "structural": Use StructuralEqual/Hash
            - "ignore-ndarray": Same as "structural", but ignore ndarray raw data during
                                equality testing and hashing.
            - "anchor-block": Apply equality testing and hashing on the anchor block extracted from a
                              given module. The "ignore-ndarray" varint is used for the extracted
                              blocks or in case no anchor block is found.
                              For the definition of the anchor block, see tir/analysis/analysis.py.
      disabled_pass : Optional[Union[List[str], Set[str], Tuple[str]]]
          The list of disabled passes
      instruments : Optional[Sequence[PassInstrument]]
          The list of pass instrument implementations.
  
      Returns
      -------
      tasks: List[ExtractedTask]
          The tasks extracted from this network
      """
      # pylint: disable=import-outside-toplevel
      from tvm import autotvm
  
      # pylint: enable=import-outside-toplevel
      mod, target, params, pass_config, _ex, _rt = _normalize_params(
          mod,
          target,
          params,
          pass_config,
          executor,
          runtime,
      )
      if target.kind.name != "cuda" and isinstance(
          autotvm.DispatchContext.current, autotvm.FallbackContext
      ):
          tophub_context = autotvm.tophub.context(target)
      else:
          tophub_context = autotvm.utils.EmptyContext()
      with Profiler.timeit("TaskExtraction"):
          with target, _autotvm_silencer(), tophub_context:
              with transform.PassContext(
                  opt_level=opt_level,
                  config=pass_config,
                  disabled_pass=disabled_pass,
                  instruments=instruments,
              ):
                  return list(
                      _extract_task(
                          mod, target, params, module_equality
                      )
                  )
  
imports: from contextlib import contextmanager
  from types import MappingProxyType
  from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, Sequence, Set, Tuple, Union
  from typing_extensions import Literal
  import numpy
  from tvm import nd
  from tvm._ffi import get_global_func
  from tvm.ir import IRModule, transform
  from tvm.ir.instrument import PassInstrument
  from tvm.runtime import NDArray
  from tvm.target import Target
  from .builder import Builder
  from .cost_model import CostModel
  from .database import Database
  from .extracted_task import ExtractedTask
  from .logging import get_loggers_from_work_dir
  from .measure_callback import MeasureCallback
  from .profiler import Profiler
  from .runner import Runner
  from .search_strategy import SearchStrategy
  from .space_generator import SpaceGenerator
  from .task_scheduler import TaskScheduler
  from .tune import tune_tasks
  from .tune_context import TuneContext
  from .utils import fork_seed
label_desc: Use image node_id 3 for calling a global function with example usage: extract_tasks(mod, target, params) and returns: list