code: def _highlight(code, filename):
      try:
          import pygments
      except ImportError:
          return code
  
      from pygments.lexers import Python3Lexer, YamlLexer
      from pygments.formatters import Terminal256Formatter
  
      lexer = (
          Python3Lexer() if filename.endswith(".py") else YamlLexer()
      )
      code = pygments.highlight(
          code, lexer, Terminal256Formatter(style="monokai")
      )
      return code
  
imports: import argparse
  import logging
  import os
  import sys
  import weakref
  from collections import OrderedDict
  from typing import Optional
  import torch
  from fvcore.nn.precise_bn import get_bn_modules
  from omegaconf import OmegaConf
  from torch.nn.parallel import DistributedDataParallel
  import detectron2.data.transforms
  from detectron2.checkpoint import DetectionCheckpointer
  from detectron2.config import CfgNode, LazyConfig
  from detectron2.data import MetadataCatalog, build_detection_test_loader, build_detection_train_loader
  from detectron2.evaluation import DatasetEvaluator, inference_on_dataset, print_csv_format, verify_results
  from detectron2.modeling import build_model
  from detectron2.solver import build_lr_scheduler, build_optimizer
  from detectron2.utils import comm
  from detectron2.utils.collect_env import collect_env_info
  from detectron2.utils.env import seed_all_rng
  from detectron2.utils.events import CommonMetricPrinter, JSONWriter, TensorboardXWriter
  from detectron2.utils.file_io import PathManager
  from detectron2.utils.logger import setup_logger
  from .None import hooks
  from .train_loop import AMPTrainer, SimpleTrainer, TrainerBase
label_desc: Use image node_id 4 for calling a global function with example usage: _highlight(code, filename) and returns: code, code