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: Store source and raw input in history and create input cache
  variables ``_i*``.
  
  Parameters
  ----------
  line_num : int
    The prompt number of this input.
  
  source : str
    Python input.
  
  source_raw : str, optional
    If given, this is the raw input without any IPython transformations
    applied to it.  If not given, ``source`` is used.
docstr_tok: ["Store","source","and","raw","input","in","history","and","create","input","cache","variables","``","_i","*","``",".","Parameters","--","--","--","--","--","line_num",":","int","The","prompt","number","of","this","input",".","source",":","str","Python","input",".","source_raw",":","str",",","optional","If","given",",","this","is","the","raw","input","without","any","IPython","transformations","applied","to","it",".","If","not","given",",","``","source","``","is","used","."]
code: def store_inputs(self, line_num, source, source_raw=None):
      """Store source and raw input in history and create input cache
      variables ``_i*``.
  
      Parameters
      ----------
      line_num : int
        The prompt number of this input.
  
      source : str
        Python input.
  
      source_raw : str, optional
        If given, this is the raw input without any IPython transformations
        applied to it.  If not given, ``source`` is used.
      """
      if source_raw is None:
          source_raw = source
      source = source.rstrip("\n")
      source_raw = source_raw.rstrip("\n")
  
      # do not store exit/quit commands
      if self._exit_re.match(source_raw.strip()):
          return
  
      self.input_hist_parsed.append(source)
      self.input_hist_raw.append(source_raw)
  
      with self.db_input_cache_lock:
          self.db_input_cache.append((line_num, source, source_raw))
          # Trigger to flush cache and write to DB.
          if len(self.db_input_cache) >= self.db_cache_size:
              self.save_flag.set()
  
      # update the auto _i variables
      self._iii = self._ii
      self._ii = self._i
      self._i = self._i00
      self._i00 = source_raw
  
      # hackish access to user namespace to create _i1,_i2... dynamically
      new_i = "_i%s" % line_num
      to_main = {
          "_i": self._i,
          "_ii": self._ii,
          "_iii": self._iii,
          new_i: self._i00,
      }
  
      if self.shell is not None:
          self.shell.push(to_main, interactive=False)
  
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 11 for calling the HistoryManager obj's underlying member method code with example usage: obj.store_inputs(line_num, source, source_raw) without return types