<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _ed25519_key_from_file(fn, path):
 """Create an ed25519 key from the contents of ``path``. ``path`` is a filepath containing a base64-encoded ed25519 key seed. Args: fn (callable):
 the function to call with the contents from ``path`` path (str):
 the file path to the base64-encoded key seed. Returns: obj: the appropriate key type from ``path`` Raises: ScriptWorkerEd25519Error """

    try:
        return fn(read_from_file(path, exception=ScriptWorkerEd25519Error))
    except ScriptWorkerException as exc:
        raise ScriptWorkerEd25519Error("Failed calling {} for {}: {}!".format(fn, path, str(exc)))