def load(f):
if isinstance(f, (os.PathLike, str)):<EOL><INDENT>fileobj = open(f, '<STR_LIT:rb>')<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>f.read(<NUM_LIT:0>)<EOL><DEDENT>except AttributeError:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>except Exception:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>fileobj = f<EOL><DEDENT>parser_cls = determine_format(fileobj, os.path.splitext(fileobj.name)[<NUM_LIT:1>])<EOL>if parser_cls is None:<EOL><INDENT>raise UnsupportedFormat("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>fileobj.seek(<NUM_LIT:0>, os.SEEK_SET)<EOL><DEDENT>return parser_cls.load(fileobj)<EOL>
Load audio metadata from filepath or file-like object.

    Parameters:
            f (str, os.PathLike, or file-like object):
                    A filepath, path-like object or file-like object of an audio file.

    Returns:
            Format: An audio format object.

    Raises:
            UnsupportedFormat: If file is not of a supported format.
            ValueError: If filepath/file-like object is not valid or readable.