code: def in_ipython() -> bool:
      """Check if the code is run in IPython, Jupyter, or Colab"""
  
      try:
          __IPYTHON__
          return True
      except NameError:
          return False
  
imports: import logging
  import os
  import sys
  import threading
  from enum import Enum
  from typing import Any, Optional, Union
label_desc: Use image node_id 1 for calling a global function with example usage: in_ipython() and returns: True, False