code: def load_config(config):
      """Load configuration"""
      if isinstance(config, str):
          with open(config) as f:
              if hasattr(yaml, "FullLoader"):
                  config = yaml.load(f, Loader=yaml.FullLoader)
              else:
                  config = yaml.load(f)
          config = AttrDict(config)
      elif isinstance(config, dict):
          config = AttrDict(config)
      else:
          raise TypeError(
              "config should be a dict or "
              "a path of configuration file. "
              "But got %s" % (type(config))
          )
      return config
  
imports: import sys
  import datetime
  import os
  import yaml
  import random
  import shutil
  import six
  import warnings
  import glob
  from collections import defaultdict
  from pgl.utils.logger import log
label_desc: Use image node_id 2 for calling a global function with example usage: load_config(config) and returns: config