code: def is_notebook() -> bool:
      global IS_NOTEBOOK
      if IS_NOTEBOOK is None:
          try:
              from IPython.core.getipython import (
                  get_ipython,
              )  # pylint: disable=import-outside-toplevel
  
              IS_NOTEBOOK = (
                  get_ipython().__class__.__name__
                  == "ZMQInteractiveShell"
              )
          except (NameError, ModuleNotFoundError):
              IS_NOTEBOOK = False
      return IS_NOTEBOOK
  
label_desc: Use image node_id 3 for calling a global function with example usage: is_notebook() and returns: IS_NOTEBOOK