def extract(self, destdir, decompress='<STR_LIT>'):
for e in self.mardata.index.entries:<EOL><INDENT>name = e.name<EOL>entry_path = safejoin(destdir, name)<EOL>entry_dir = os.path.dirname(entry_path)<EOL>mkdir(entry_dir)<EOL>with open(entry_path, '<STR_LIT:wb>') as f:<EOL><INDENT>write_to_file(self.extract_entry(e, decompress), f)<EOL>os.chmod(entry_path, e.flags)<EOL><DEDENT><DEDENT>
Extract the entire MAR file into a directory.

        Args:
            destdir (str): A local directory on disk into which the contents of
                this MAR file will be extracted. Required parent directories
                will be created as necessary.
            decompress (obj, optional): Controls whether files are decompressed
                when extracted. Must be one of 'auto' or None. Defaults to
                'auto'.