code: def is_terminal() -> bool:
      """
      Detect if Python is running in a terminal.
  
      Returns True if Python is running in a terminal or False if not.
      """
      try:
          # error: Name 'get_ipython' is not defined
          ip = get_ipython()  # type: ignore[name-defined]
      except (
          NameError
      ):  # assume standard Python interpreter in a terminal
          return True
      else:
          if hasattr(ip, "kernel"):  # IPython as a Jupyter kernel
              return False
          else:  # IPython in a terminal
              return True
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/config_init.py
imports: from __future__ import annotations
  import os
  from typing import Callable
  import pandas._config.config
  from pandas._config.config import is_bool, is_callable, is_instance_factory, is_int, is_nonnegative_int, is_one_of_factory, is_str, is_text
label_desc: Use image node_id 5 for calling a global function with example usage: is_terminal() and returns: True, False, True