class_docstr: A class to organize all history-related functionality in one place.
      
class_docstr_tok: ["A","class","to","organize","all","history-related","functionality","in","one","place","."]
docstr: Close the database session, filling in the end time and line count.
docstr_tok: ["Close","the","database","session",",","filling","in","the","end","time","and","line","count","."]
code: def end_session(self):
      """Close the database session, filling in the end time and line count."""
      self.writeout_cache()
      with self.db:
          self.db.execute(
              """UPDATE sessions SET end=?, num_cmds=? WHERE
                              session==?""",
              (
                  datetime.datetime.now().isoformat(" "),
                  len(self.input_hist_parsed) - 1,
                  self.session_number,
              ),
          )
      self.session_number = 0
  
imports: import atexit
  import datetime
  from pathlib import Path
  import re
  import sqlite3
  import threading
  from traitlets.config.configurable import LoggingConfigurable
  from decorator import decorator
  from IPython.utils.decorators import undoc
  from IPython.paths import locate_profile
  from traitlets import Any, Bool, Dict, Instance, Integer, List, Unicode, Union, TraitError, default, observe
label_desc: Use image node_id 5 for calling the HistoryManager obj's underlying member method code with example usage: obj.end_session() without return types