def _write_file(self, filename, data):
if self.__compression:<EOL><INDENT>f = gzip.GzipFile(filename, "<STR_LIT:wb>")<EOL><DEDENT>else:<EOL><INDENT>f = open(filename, "<STR_LIT:wb>")<EOL><DEDENT>pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)<EOL>f.close()<EOL>
Write a data item into a file.

        The data object is written to a file using the pickle mechanism.

        :param filename: Output file name
        :type filename: str
        :param data: A Python object that will be pickled