code: def create_config(config_path="scriptworker.yaml"):
      
      if not os.path.exists(config_path):
          print("{} doesn't exist! Exiting...".format(config_path), file=sys.stderr)
          sys.exit(1)
      with open(config_path, "r", encoding="utf-8") as fh:
          secrets = safe_load(fh)
      config = dict(deepcopy(DEFAULT_CONFIG))
      if not secrets.get("credentials"):
          secrets['credentials'] = read_worker_creds()
      config.update(secrets)
      apply_product_config(config)
      messages = check_config(config, config_path)
      if messages:
          print('\n'.join(messages), file=sys.stderr)
          print("Exiting...", file=sys.stderr)
          sys.exit(1)
      credentials = get_frozen_copy(secrets['credentials'])
      del(config['credentials'])
      config = get_frozen_copy(config)
      return config, credentials
docs: Create a config from DEFAULT_CONFIG, arguments, and config file.
  
      Then validate it and freeze it.
  
      Args:
          config_path (str, optional): the path to the config file.  Defaults to
              "scriptworker.yaml"
  
      Returns:
          tuple: (config frozendict, credentials dict)
  
      Raises:
          SystemExit: on failure