code: def build_test_reporter(
      datamodules: List[pl.LightningDataModule],
      config: DictConfig = None,
      dataset_type: str = "train",
  ):
      test_reporter_key = "default"
      if config:
          test_reporter_key = config.get("type", "default")
      test_reporter_class = registry.get_test_rerporter_class(
          test_reporter_key
      )
      assert (
          test_reporter_class
      ), f"Key {test_reporter_key} doesn't have a registered test_reporter class"
  
      if not config:
          warnings.warn(
              f"Config not provided for {test_reporter_key}, test_reporter"
              + "continuing with empty config"
          )
          params_config = OmegaConf.create()
      else:
          params_config = config.params
  
      return test_reporter_class(
          datamodules, params_config, dataset_type
      )
  
imports: import logging
  import os
  import warnings
  from enum import Enum
  from typing import Any, Dict, List, Optional, Tuple, Union
  import mmf
  import pytorch_lightning
  import torch
  from mmf.common.meter import Meter
  from mmf.common.registry import registry
  from mmf.datasets.iteration_strategies import ConstantIterationStrategy, IterationStrategy, SizeProportionalIterationStrategy
  from mmf.datasets.processors.processors import Processor
  from mmf.utils.configuration import Configuration, get_global_config
  from mmf.utils.distributed import is_dist_initialized, is_main, is_xla, synchronize
  from mmf.utils.general import get_optimizer_parameters
  from omegaconf import DictConfig, OmegaConf
  from packaging import version
label_desc: Use image node_id 10 for calling a global function with example usage: build_test_reporter(datamodules, config, dataset_type) and returns: test_reporter_class