class_docstr: A compiler that caches code compiled from interactive statements.
      
class_docstr_tok: ["A","compiler","that","caches","code","compiled","from","interactive","statements","."]
code: def __init__(self):
      codeop.Compile.__init__(self)
  
      # This is ugly, but it must be done this way to allow multiple
      # simultaneous ipython instances to coexist.  Since Python itself
      # directly accesses the data structures in the linecache module, and
      # the cache therein is global, we must work with that data structure.
      # We must hold a reference to the original checkcache routine and call
      # that in our own check_cache() below, but the special IPython cache
      # must also be shared by all IPython instances.  If we were to hold
      # separate caches (one in each CachingCompiler instance), any call made
      # by Python itself to linecache.checkcache() would obliterate the
      # cached data from the other IPython instances.
      if not hasattr(linecache, "_ipython_cache"):
          linecache._ipython_cache = {}
      if not hasattr(linecache, "_checkcache_ori"):
          linecache._checkcache_ori = linecache.checkcache
      # Now, we must monkeypatch the linecache directly so that parts of the
      # stdlib that call it outside our control go through our codepath
      # (otherwise we'd lose our tracebacks).
      linecache.checkcache = check_linecache_ipython
  
file_path: catboost/contrib/python/ipython/py2/IPython/core/compilerop.py
imports: from __future__ import print_function
  import __future__
  from ast import PyCF_ONLY_AST
  import codeop
  import functools
  import hashlib
  import linecache
  import operator
  import time
label_desc: Use image node_id 1 to create a new CachingCompiler object from inherited base classes: codeop with example: obj = CachingCompiler()