code: def _get_python_type() -> PythonType:
      if "IPython" not in sys.modules:
          return "python"
  
      try:
          from IPython import get_ipython  # type: ignore
  
          # Calling get_ipython can cause an ImportError
          if get_ipython() is None:
              return "python"
      except ImportError:
          return "python"
  
      # jupyter-based environments (e.g. jupyter itself, colab, kaggle, etc) have a connection file
      ip_kernel_app_connection_file = (
          (get_ipython().config.get("IPKernelApp", {}) or {})
          .get("connection_file", "")
          .lower()
      ) or (
          (get_ipython().config.get("ColabKernelApp", {}) or {})
          .get("connection_file", "")
          .lower()
      )
  
      if (
          ("terminal" in get_ipython().__module__)
          or ("jupyter" not in ip_kernel_app_connection_file)
          or ("spyder" in sys.modules)
      ):
          return "ipython"
      else:
          return "jupyter"
  
file_path: wandb/wandb/sdk/lib/ipython.py
imports: import logging
  import sys
  import warnings
  from typing import Optional
  import wandb
label_desc: Use image node_id 2 for calling a global function with example usage: _get_python_type() and returns: str, str, str, str, str