code: def supported_tasks_mapping(
      *supported_tasks: Union[str, Tuple[str, Tuple[str, ...]]],
      **exporters: str,
  ) -> Dict[str, TaskNameToExportConfigDict]:
      """
      Generates the mapping between supported tasks and their corresponding `ExportConfig` for a given model, for
      every backend.
  
      Args:
          supported_tasks (`Tuple[Union[str, Tuple[str, Tuple[str, ...]]]`):
              The names of the supported tasks.
              If some task is supported by only a subset of all the backends, it can be specified as follows:
                  ```python
                  >>> ("multiple-choice", ("onnx",))
                  ```
  
              The line above means that the multiple-choice task will be supported only by the ONNX backend.
  
          exporters (`Dict[str, str]`):
              The export backend name -> config class name mapping. For instance:
              ```python
              >>> exporters = {  # doctest: +SKIP
              ...     "onnx": "BertOnnxConfig",
              ...     "tflite": "BertTFLiteConfig",
              ...     ...
              ... }
              ```
  
      Returns:
          `Dict[str, TaskNameToExportConfigDict]`: The dictionary mapping a task to an `ExportConfig` constructor.
      """
      mapping = {}
      for backend, config_cls_name in exporters.items():
          if is_backend_available(backend):
              config_cls = getattr(
                  importlib.import_module(
                      f"optimum.exporters.{backend}.model_configs"
                  ),
                  config_cls_name,
              )
              mapping[backend] = {}
              for task in supported_tasks:
                  if isinstance(task, tuple):
                      task, supported_backends_for_task = task
                      if backend not in supported_backends_for_task:
                          continue
                  config_constructor = (
                      make_backend_config_constructor_for_task(
                          config_cls, task
                      )
                  )
                  mapping[backend][task] = config_constructor
      return mapping
  
imports: import importlib
  import inspect
  import itertools
  import json
  import os
  from functools import partial
  from pathlib import Path
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union
  import huggingface_hub
  from packaging import version
  from requests.exceptions import ConnectionError
  from transformers import AutoConfig, PretrainedConfig, is_tf_available, is_torch_available
  from transformers.utils import SAFE_WEIGHTS_NAME, TF2_WEIGHTS_NAME, WEIGHTS_NAME, logging
  from ..utils import CONFIG_NAME
  from ..utils.import_utils import is_onnx_available
label_desc: Use image node_id 3 for calling a global function with example usage: supported_tasks_mapping() and returns: mapping