code: def get_ipython_cache_dir():
      """Get the cache directory it is created if it does not exist."""
      xdgdir = get_xdg_cache_dir()
      if xdgdir is None:
          return get_ipython_dir()
      ipdir = os.path.join(xdgdir, "ipython")
      if not os.path.exists(ipdir) and _writable_dir(xdgdir):
          ensure_dir_exists(ipdir)
      elif not _writable_dir(xdgdir):
          return get_ipython_dir()
  
      return py3compat.cast_unicode(ipdir, fs_encoding)
  
file_path: catboost/contrib/python/ipython/py2/IPython/paths.py
imports: import os.path
  import shutil
  import tempfile
  from warnings import warn
  import IPython
  from IPython.utils.importstring import import_item
  from IPython.utils.path import get_home_dir, get_xdg_dir, get_xdg_cache_dir, compress_user, _writable_dir, ensure_dir_exists, fs_encoding, filefind
  from IPython.utils import py3compat
label_desc: Use image node_id 2 for calling a global function with example usage: get_ipython_cache_dir() and returns: py3compat, get_ipython_dir, get_ipython_dir