code: def is_notebook() -> bool:
      """Check if we're in an interactive context (Notebook, GUI support) or terminal-based.
  
      Returns
      -------
      bool
          True if we are in a notebook context, False otherwise
      """
      try:
          shell = get_ipython()
          return hasattr(shell, "config")
      except NameError:
          return False
  
imports: import logging
  import os
  import time
  import typing
  from functools import lru_cache
  import plotly.io
  import tqdm
  from ipykernel.zmqshell import ZMQInteractiveShell
  from IPython import get_ipython
  from IPython.display import display
  from IPython.terminal.interactiveshell import TerminalInteractiveShell
  from tqdm.notebook import tqdm
  from deepchecks.utils.logger import get_verbosity
label_desc: Use image node_id 1 for calling a global function with example usage: is_notebook() and returns: hasattr, False