class_docstr: Access the history database without adding to it.
  
  This is intended for use by standalone history tools. IPython shells use
  HistoryManager, below, which is a subclass of this.
class_docstr_tok: ["Access","the","history","database","without","adding","to","it",".","This","is","intended","for","use","by","standalone","history","tools",".","IPython","shells","use","HistoryManager",",","below",",","which","is","a","subclass","of","this","."]
docstr: Get the last n lines from the history database.
  
  Parameters
  ----------
  n : int
    The number of lines to get
  raw, output : bool
    See :meth:`get_range`
  include_latest : bool
    If False (default), n+1 lines are fetched, and the latest one
    is discarded. This is intended to be used where the function
    is called by a user command, which it should not return.
  
  Returns
  -------
  Tuples as :meth:`get_range`
docstr_tok: ["Get","the","last","n","lines","from","the","history","database",".","Parameters","--","--","--","--","--","n",":","int","The","number","of","lines","to","get","raw",",","output",":","bool","See",":","meth",":","`","get_range","`","include_latest",":","bool","If","False","(","default",")",",","n+1","lines","are","fetched",",","and","the","latest","one","is","discarded",".","This","is","intended","to","be","used","where","the","function","is","called","by","a","user","command",",","which","it","should","not","return",".","Returns","--","--","--","-","Tuples","as",":","meth",":","`","get_range","`"]
code: def get_tail(
      self, n=10, raw=True, output=False, include_latest=False
  ):
      """Get the last n lines from the history database.
  
      Parameters
      ----------
      n : int
        The number of lines to get
      raw, output : bool
        See :meth:`get_range`
      include_latest : bool
        If False (default), n+1 lines are fetched, and the latest one
        is discarded. This is intended to be used where the function
        is called by a user command, which it should not return.
  
      Returns
      -------
      Tuples as :meth:`get_range`
      """
      self.writeout_cache()
      if not include_latest:
          n += 1
      cur = self._run_sql(
          "ORDER BY session DESC, line DESC LIMIT ?",
          (n,),
          raw=raw,
          output=output,
      )
      if not include_latest:
          return reversed(list(cur)[1:])
      return reversed(list(cur))
  
imports: from __future__ import print_function
  import atexit
  import datetime
  import os
  import re
  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 IPython.utils import py3compat
  from traitlets import Any, Bool, Dict, Instance, Integer, List, Unicode, TraitError, default, observe
  from warnings import warn
label_desc: Use image node_id 9 for calling the HistoryAccessor obj's underlying member method code with example usage: obj.get_tail(n, raw, output, include_latest) and returns: reversed, reversed