def _generate_file(self):
        prev = None
        if len(self.legal_files) > 0:
            fn = os.path.basename(self.legal_files[0])
            prev = int(LEGAL_STORE_FILE_REGEX.match(fn).group())
        current = str(1-prev if prev is not None else sys.maxint)
        file_path = os.path.join(self.dir_, current)
        if len(self.legal_files) > 1:
            self.map_handles[WRITE_ENTRANCE].close()
            self.file_handles[WRITE_ENTRANCE].close()
        self.legal_files.insert(0, file_path)
        open(file_path, 'w').close()
        write_file_handle = self.file_handles[WRITE_ENTRANCE] = open(file_path, 'r+')
        write_file_handle.write('\x00'*self.store_file_size)
        write_file_handle.flush()
        self.map_handles[WRITE_ENTRANCE] = mmap.mmap(write_file_handle.fileno(),
                                                     self.store_file_size)
        
        if len(self.legal_files) == 1:
            self.map_handles[READ_ENTRANCE] = self.map_handles[WRITE_ENTRANCE]
            self.file_handles[READ_ENTRANCE] = self.file_handles[WRITE_ENTRANCE]
dataset/ETHPy150Open chineking/cola/cola/core/mq/store.py/Store._generate_file/swapped operands of `-`