code: def load_config(config_file):
      
      with open(config_file) as in_handle:
          config = yaml.safe_load(in_handle)
      config = _expand_paths(config)
      if 'resources' not in config:
          config['resources'] = {}
      # lowercase resource names, the preferred way to specify, for back-compatibility
      newr = {}
      for k, v in config["resources"].items():
          if k.lower() != k:
              newr[k.lower()] = v
      config["resources"].update(newr)
      return config
docs: Load YAML config file, replacing environmental variables.