<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def default_key_to_path(key, dfmt="{}", ffmt="{}.npy"):
 """Turn an arbitrary python object into a filename This uses string formatting, so make sure your keys map to unique strings. If the key is a tuple, it will join each element of the tuple with '/', resulting in a filesystem hierarchy of files. """

    if isinstance(key, tuple):
        paths = [dfmt.format(k) for k in key[:-1]]
        paths += [ffmt.format(key[-1])]
        return os.path.join(*paths)
    else:
        return ffmt.format(key)