code: def load_config_single(fname, config=None):
      """Loads config from a single file.
  
      The 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:
          fname (str): The config file name.
          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.
      """
      if fname.endswith(".py"):
          new_config = _load_config_python(fname)
      else:
          new_config = _load_config_yaml(fname)
  
      if config is None:
          config = new_config
      else:
          for key, value in new_config.items():
              if key in config:
                  if isinstance(config[key], dict):
                      config[key].update(value)
                  else:
                      config[key] = value
              else:
                  config[key] = value
  
      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 3 for calling a global function with example usage: load_config_single(fname, config) and returns: config