class_docstr: The custom IPython displayhook to replace sys.displayhook.
  
  This class does many things, but the basic idea is that it is a callable
  that gets called anytime user code returns a value.
class_docstr_tok: ["The","custom","IPython","displayhook","to","replace","sys.displayhook",".","This","class","does","many","things",",","but","the","basic","idea","is","that","it","is","a","callable","that","gets","called","anytime","user","code","returns","a","value","."]
code: def __init__(self, shell=None, cache_size=1000, **kwargs):
      super(DisplayHook, self).__init__(shell=shell, **kwargs)
      cache_size_min = 3
      if cache_size <= 0:
          self.do_full_cache = 0
          cache_size = 0
      elif cache_size < cache_size_min:
          self.do_full_cache = 0
          cache_size = 0
          warn(
              "caching was disabled (min value for cache size is %s)."
              % cache_size_min,
              stacklevel=3,
          )
      else:
          self.do_full_cache = 1
  
      self.cache_size = cache_size
  
      # we need a reference to the user-level namespace
      self.shell = shell
  
      self._, self.__, self.___ = "", "", ""
  
      # these are deliberately global:
      to_user_ns = {"_": self._, "__": self.__, "___": self.___}
      self.shell.user_ns.update(to_user_ns)
  
imports: import builtins
  import sys
  import io
  import tokenize
  from traitlets.config.configurable import Configurable
  from traitlets import Instance, Float
  from warnings import warn
label_desc: Use image node_id 1 to create a new DisplayHook object from inherited base classes: Configurable with example: obj = DisplayHook(shell, cache_size)