class_docstr: Object to manage sys.displayhook.
  
  This came from IPython.core.kernel.display_hook, but is simplified
  (no callbacks or formatters) until more of the core is refactored.
code: def __init__(self, hook=None):
      super(DisplayTrap, self).__init__(hook=hook, config=None)
      self.old_hook = None
      # We define this to track if a single BuiltinTrap is nested.
      # Only turn off the trap when the outermost call to __exit__ is made.
      self._nested_level = 0
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/display_trap.py
imports: import sys
  from traitlets.config.configurable import Configurable
  from traitlets import Any
label_desc: Use image node_id 1 to create a new DisplayTrap object from inherited base classes: Configurable with example: obj = DisplayTrap(hook)