code: def create_data_benchmark(cfg, args):
      if args.config_file.endswith(".py"):
          dl_cfg = cfg.dataloader.train
          dl_cfg._target_ = DataLoaderBenchmark
          return instantiate(dl_cfg)
      else:
          kwargs = build_detection_train_loader.from_config(cfg)
          kwargs.pop("aspect_ratio_grouping", None)
          kwargs["_target_"] = DataLoaderBenchmark
          return instantiate(kwargs)
  
imports: import itertools
  import logging
  import psutil
  import torch
  import tqdm
  from fvcore.common.timer import Timer
  from torch.nn.parallel import DistributedDataParallel
  from detectron2.checkpoint import DetectionCheckpointer
  from detectron2.config import LazyConfig, get_cfg, instantiate
  from detectron2.data import DatasetFromList, build_detection_test_loader, build_detection_train_loader
  from detectron2.data.benchmark import DataLoaderBenchmark
  from detectron2.engine import AMPTrainer, SimpleTrainer, default_argument_parser, hooks, launch
  from detectron2.modeling import build_model
  from detectron2.solver import build_optimizer
  from detectron2.utils import comm
  from detectron2.utils.collect_env import collect_env_info
  from detectron2.utils.events import CommonMetricPrinter
  from detectron2.utils.logger import setup_logger
label_desc: Use image node_id 2 for calling a global function with example usage: create_data_benchmark(cfg, args) and returns: instantiate, instantiate