code: def _detect_ipython():
      """Detect if called in an IPython environment.
  
      Mostly derived from StackOverflow below:
      https://stackoverflow.com/questions/15411967/how-can-i-check-if-code-is-executed-in-the-ipython-notebook
  
      Returns
      -------
          True if in IPython environment.
  
      """
      try:
          from IPython import get_ipython
  
          return get_ipython() is not None
      except NameError:  # pragma: no cover
          return False
  
file_path: responsible-ai-toolbox/rai_core_flask/rai_core_flask/environment_detector.py
imports: import os
  from .environments import AzureNBEnvironment, CredentialedVMEnvironment, DatabricksEnvironment, LocalIPythonEnvironment, PublicVMEnvironment
label_desc: Use image node_id 1 for calling a global function with example usage: _detect_ipython() and returns: unknown, False