code: def cfg_factory(filename):
      
      try:
          # try to load config as yaml file.
          with open(filename, 'rb') as stream:
              return yaml.load(stream)
      except StandardError as error:
          # In case of error we use the **__argpi__** builtin to exit from
          # script
          __argpi__.exit(1, str(error))
docs: Config Factory