code: def setup(args):
      if args.config_file.endswith(".yaml"):
          cfg = get_cfg()
          cfg.merge_from_file(args.config_file)
          cfg.DATALOADER.NUM_WORKERS = 0
          cfg.merge_from_list(args.opts)
          cfg.freeze()
      else:
          cfg = LazyConfig.load(args.config_file)
          cfg = LazyConfig.apply_overrides(cfg, args.opts)
      setup_logger(name="fvcore")
      setup_logger()
      return cfg
  
file_path: detectron2/tools/analyze_model.py
imports: import logging
  import numpy
  from collections import Counter
  import tqdm
  from fvcore.nn import flop_count_table
  from detectron2.checkpoint import DetectionCheckpointer
  from detectron2.config import CfgNode, LazyConfig, get_cfg, instantiate
  from detectron2.data import build_detection_test_loader
  from detectron2.engine import default_argument_parser
  from detectron2.modeling import build_model
  from detectron2.utils.analysis import FlopCountAnalysis, activation_count_operators, parameter_count_table
  from detectron2.utils.logger import setup_logger
label_desc: Use image node_id 1 for calling a global function with example usage: setup(args) and returns: cfg