def load(self, filename, known_frames=None, translate=True, v2_version=<NUM_LIT:4>):
if not v2_version in (<NUM_LIT:3>, <NUM_LIT:4>):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>from os.path import getsize<EOL>self.filename = filename<EOL>self.__known_frames = known_frames<EOL>self._fileobj = open(filename, '<STR_LIT:rb>')<EOL>self.__filesize = getsize(filename)<EOL>try:<EOL><INDENT>try:<EOL><INDENT>self._load_header()<EOL><DEDENT>except EOFError:<EOL><INDENT>self.size = <NUM_LIT:0><EOL>raise ID3NoHeaderError("<STR_LIT>" % (<EOL>filename, self.__filesize))<EOL><DEDENT>except (ID3NoHeaderError, ID3UnsupportedVersionError) as err:<EOL><INDENT>self.size = <NUM_LIT:0><EOL>import sys<EOL>stack = sys.exc_info()[<NUM_LIT:2>]<EOL>try:<EOL><INDENT>self._fileobj.seek(-<NUM_LIT>, <NUM_LIT:2>)<EOL><DEDENT>except EnvironmentError:<EOL><INDENT>reraise(err, None, stack)<EOL><DEDENT>else:<EOL><INDENT>frames = ParseID3v1(self._fileobj.read(<NUM_LIT>))<EOL>if frames is not None:<EOL><INDENT>self.version = self._V11<EOL>for v in frames.values():<EOL><INDENT>self.add(v)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>reraise(err, None, stack)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>frames = self.__known_frames<EOL>if frames is None:<EOL><INDENT>if self._V23 <= self.version:<EOL><INDENT>frames = Frames<EOL><DEDENT>elif self._V22 <= self.version:<EOL><INDENT>frames = Frames_2_2<EOL><DEDENT><DEDENT>data = self.__fullread(self.size - <NUM_LIT:10>)<EOL>for frame in self.__read_frames(data, frames=frames):<EOL><INDENT>if isinstance(frame, Frame):<EOL><INDENT>self.add(frame)<EOL><DEDENT>else:<EOL><INDENT>self.unknown_frames.append(frame)<EOL><DEDENT><DEDENT>self.__unknown_version = self.version<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self._fileobj.close()<EOL>del self._fileobj<EOL>del self.__filesize<EOL>if translate:<EOL><INDENT>if v2_version == <NUM_LIT:3>:<EOL><INDENT>self.update_to_v23()<EOL><DEDENT>else:<EOL><INDENT>self.update_to_v24()<EOL><DEDENT><DEDENT><DEDENT>
Load tags from a filename.

        Keyword arguments:

        * filename -- filename to load tag data from
        * known_frames -- dict mapping frame IDs to Frame objects
        * translate -- Update all tags to ID3v2.3/4 internally. If you
                       intend to save, this must be true or you have to
                       call update_to_v23() / update_to_v24() manually.
        * v2_version -- if update_to_v23 or update_to_v24 get called (3 or 4)

        Example of loading a custom frame::

            my_frames = dict(mutagen.id3.Frames)
            class XMYF(Frame): ...
            my_frames["XMYF"] = XMYF
            mutagen.id3.ID3(filename, known_frames=my_frames)