code: def _is_in_jupyter_notebook() -> bool:
      try:
          ipython = get_ipython()
          assert ipython
          class_name = str(ipython.__class__)
          return True if "Terminal" not in class_name else False
      except Exception:
          return False
  
imports: from abc import ABC, abstractmethod
  from pprint import pprint
  from typing import Any, Dict, Optional, Union
  import pandas
  from IPython.display import HTML, DisplayHandle, clear_output
  from IPython.display import display
  from pandas.io.formats.style import Styler
label_desc: Use image node_id 3 for calling a global function with example usage: _is_in_jupyter_notebook() and returns: unknown, False