code: def _write_history(self):
          
          if self.data['history_file'] is None:
              return
          contents = '\n'.join(self.data['history_lines'])
          history = self.data['history_file']
          open(history, 'w').write(contents)
          logger.info("History file %s updated.", history)
docs: Write previously-calculated history lines back to the file