code: def sub_backend(
      file_client_args: Dict[str, Any],
      cfg: Union[
          mmcv.utils.config.Config, mmcv.utils.config.ConfigDict, List
      ],
  ) -> None:
      """
      Recurses through the mmcv.Config to replace the ``file_client_args`` field of calls to
      ``LoadImageFromFile`` with the provided argument.  ``file_client_args`` should be a dictionary
      with a ``backend`` specified along with keyword arguments to instantiate the backend.
  
      .. code-block:: python
  
          # Using gcs backend
          file_client_args = {'backend': 'gcs', 'bucket_name': 'mydatabucket'}
          # Using s3 backend
          file_client_args = {'backend': 's3', 'bucket_name': 'mydatabucket'}
          # Using fake backend
          file_client_args = {'backend': 'fake', 'fake_img_path': None}
  
      In addition to the backends registered in this file, mmcv supports
      disk, ceph, memcache, lmdb, petrel, and http backends. The default backend is disk.
  
      It is better to override the backend using this function than to use other mechanisms
      in `MMDetTrial.build_mmdet_config` because recursively going through the config will
      cover all occurrences of `LoadImageFromFile`.
  
      Arguments:
          file_client_args: dictionary with a backend field and keyword arguments for that backend.
          cfg: base config for which to replace backends.
      """
      if type(cfg) in [
          mmcv.utils.config.Config,
          mmcv.utils.config.ConfigDict,
      ]:
          cfg = cast(
              Union[
                  mmcv.utils.config.Config, mmcv.utils.config.ConfigDict
              ],
              cfg,
          )
          if "type" in cfg and cfg["type"] in [
              "LoadImageFromFile",
              "LoadPanopticAnnotations",
          ]:
              cfg["file_client_args"] = file_client_args
          else:
              for k in cfg:
                  sub_backend(file_client_args, cfg[k])
      else:
          if isinstance(cfg, list):
              for i in cfg:
                  sub_backend(file_client_args, i)
  
imports: import contextlib
  import logging
  import os
  import tempfile
  import time
  from typing import Any, Dict, Iterator, List, Optional, Union, cast
  import boto3
  import mmcv
  from google.cloud import storage
  import determined
  import model_hub.utils
label_desc: Use image node_id 1 for calling a global function with example usage: sub_backend(file_client_args, cfg) without return types