code: def _in_jupyter() -> bool:
      try:
          get_ipython = sys.modules["IPython"].get_ipython  # type: ignore
          if "IPKernelApp" not in get_ipython().config:
              raise ImportError("console")
          if "VSCODE_PID" in os.environ:
              raise ImportError("vscode")
      except Exception:
          return False
      else:
          return True
  
file_path: pykeen/src/pykeen/version.py
imports: import os
  import sys
  from functools import lru_cache
  from subprocess import CalledProcessError, check_output
  from typing import Optional, Tuple
label_desc: Use image node_id 8 for calling a global function with example usage: _in_jupyter() and returns: True, False