code: def is_running_in_notebook():
      try:
          cfg = get_ipython().config
          if "IPKernelApp" in cfg:
              return True
          else:
              return False
      except NameError:
          return False
  
label_desc: Use image node_id 1 for calling a global function with example usage: is_running_in_notebook() and returns: True, False, False