code: def load_config(config_path, config=None):
      """Loads configs from (possibly multiple) file(s).
  
      A config file can be either a Python file (with suffix '.py')
      or a YAML file. If the filename is not suffixed with '.py', the file is
      parsed as YAML.
  
      Args:
          config_path: Paths to configuration files. This can be a `list` of
              config file names, or a path to a directory in which all files
              are loaded, or a string of multiple file names separated by commas.
          config (dict, optional): A config dict to which new configurations are
              added. If `None`, a new config dict is created.
  
      Returns:
          A `dict` of configurations.
      """
      fnames = []
      if isinstance(config_path, (list, tuple)):
          fnames = list(config_path)
      elif tf.gfile.IsDirectory(config_path):
          for fname in tf.gfile.ListDirectory(config_path):
              fname = os.path.join(config_path, fname)
              if not tf.gfile.IsDirectory(fname):
                  fnames.append(fname)
      else:
          for fname in config_path.split(","):
              fname = fname.strip()
              if not fname:
                  continue
              fnames.append(fname)
  
      if config is None:
          config = {}
  
      for fname in fnames:
          config = load_config_single(fname, config)
  
      return config
  
file_path: texar/texar/tf/utils/utils_io.py
imports: from io import open
  import os
  import importlib
  import yaml
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: load_config(config_path, config) and returns: config