<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sagemaker_auth(overrides={}, path="."):
 """ Write a secrets.env file with the W&B ApiKey and any additional secrets passed. Args: overrides (dict, optional):
 Additional environment variables to write to secrets.env path (str, optional):
 The path to write the secrets file. """


    api_key = overrides.get(env.API_KEY, Api().api_key)
    if api_key is None:
        raise ValueError(
            "Can't find W&B ApiKey, set the WANDB_API_KEY env variable or run `wandb login`")
    overrides[env.API_KEY] = api_key
    with open(os.path.join(path, "secrets.env"), "w") as file:
        for k, v in six.iteritems(overrides):
            file.write("{}={}\n".format(k, v))