<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _secret_yaml(loader, node):
 """Load secrets and embed it into the configuration YAML."""

    fname = os.path.join(os.path.dirname(loader.name), "secrets.yaml")

    try:
        with open(fname, encoding="utf-8") as secret_file:
            secrets = YAML(typ="safe").load(secret_file)
    except FileNotFoundError:
        raise ValueError("Secrets file {} not found".format(fname)) from None

    try:
        return secrets[node.value]
    except KeyError:
        raise ValueError("Secret {} not found".format(node.value)) from None