code: def read_config(config_fname=None):
      
  
      if not config_fname:
          config_fname = DEFAULT_CONFIG_FNAME
  
      try:
          with open(config_fname, 'r') as config_file:
              config = yaml.load(config_file)
      except IOError as exc:
          if exc.errno == errno.ENOENT:
              print('payu: warning: Configuration file {0} not found!'
                    .format(config_fname))
              config = {}
          else:
              raise
  
      collate_config = config.pop('collate', {})
  
      # Transform legacy collate config options
      if type(collate_config) is bool:
          collate_config = {'enable': collate_config}
  
      collatestr = 'collate_'
      foundkeys = []
      # Cycle through old collate config and convert to newer dict format
      for key in list(config.keys()):
          if key.startswith(collatestr):
              foundkeys.append(key)
              collate_config[key[len(collatestr):]] = config.pop(key)
      if foundkeys:
          print("Use of these keys is deprecated: {}.".format(
                  ", ".join(foundkeys)))
          print("Instead use collate dictionary and subkey "
                "without 'collate_' prefix")
  
      config['collate'] = collate_config
  
      return config
docs: Parse input configuration file and return a config dict.