code: def merge_config_files(fnames):
      
      def _load_yaml(fname):
          with open(fname) as in_handle:
              config = yaml.safe_load(in_handle)
          return config
      out = _load_yaml(fnames[0])
      for fname in fnames[1:]:
          cur = _load_yaml(fname)
          for k, v in cur.items():
              if k in out and isinstance(out[k], dict):
                  out[k].update(v)
              else:
                  out[k] = v
      return out
docs: Merge configuration files, preferring definitions in latter files.