code: def resolve_test_dataloaders(model: "ModelPT"):
      """
      Helper method that operates on the ModelPT class to automatically support
      multiple dataloaders for the test set.
  
      It does so by first resolving the path to one/more data files via `resolve_dataset_name_from_cfg()`.
      If this resolution fails, it assumes the data loader is prepared to manually support / not support
      multiple data loaders and simply calls the appropriate setup method.
  
      If resolution succeeds:
          Checks if provided path is to a single file or a list of files.
          If a single file is provided, simply tags that file as such and loads it via the setup method.
          If multiple files are provided:
              Inject a new manifest path at index "i" into the resolved key.
              Calls the appropriate setup method to set the data loader.
              Collects the initialized data loader in a list and preserves it.
              Once all data loaders are processed, assigns the list of loaded loaders to the ModelPT.
              Finally assigns a list of unique names resolved from the file paths to the ModelPT.
  
      Args:
          model: ModelPT subclass, which requires >=1 Test Dataloaders to be setup.
      """
      if not _HAS_HYDRA:
          logging.error(
              "This function requires Hydra/Omegaconf and it was not installed."
          )
          exit(1)
      cfg = copy.deepcopy(model._cfg)
      dataloaders = []
  
      # process test_loss_idx
      if "test_dl_idx" in cfg.test_ds:
          cfg = OmegaConf.to_container(cfg)
          test_dl_idx = cfg["test_ds"].pop("test_dl_idx")
          cfg = OmegaConf.create(cfg)
      else:
          test_dl_idx = 0
  
      # Set val_loss_idx
      model._test_dl_idx = test_dl_idx
  
      ds_key = resolve_dataset_name_from_cfg(cfg.test_ds)
  
      if ds_key is None:
          logging.debug(
              "Could not resolve file path from provided config - {}. "
              "Disabling support for multi-dataloaders.".format(
                  cfg.test_ds
              )
          )
  
          model.setup_test_data(cfg.test_ds)
          return
  
      ds_values = cfg.test_ds[ds_key]
  
      if isinstance(ds_values, (list, tuple, ListConfig)):
          for ds_value in ds_values:
              if isinstance(ds_value, (dict, DictConfig)):
                  # this is a nested dataset
                  cfg.test_ds = ds_value
              else:
                  cfg.test_ds[ds_key] = ds_value
  
              model.setup_test_data(cfg.test_ds)
              dataloaders.append(model._test_dl)
  
          model._test_dl = dataloaders
          if len(ds_values) > 0 and isinstance(
              ds_values[0], (dict, DictConfig)
          ):
              # using the name of each of the nested dataset
              model._test_names = [ds.name for ds in ds_values]
          else:
              model._test_names = [
                  parse_dataset_as_name(ds) for ds in ds_values
              ]
  
          unique_names_check(name_list=model._test_names)
          return
  
      else:
          model.setup_test_data(cfg.test_ds)
          model._test_names = [parse_dataset_as_name(ds_values)]
  
          unique_names_check(name_list=model._test_names)
  
imports: import copy
  import importlib
  import os
  from dataclasses import dataclass, is_dataclass
  from enum import Enum
  from functools import lru_cache
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import wrapt
  from nemo.utils import AppState, logging
  from nemo.utils.data_utils import resolve_cache_dir
  from nemo.utils.data_utils import is_datastore_path
label_desc: Use image node_id 5 for calling a global function with example usage: resolve_test_dataloaders(model) without return types