code: def is_notebook() -> bool:
      """Returns True if running in a notebook (Colab, Jupyter) environment."""
      # Inspired from the tqdm autonotebook code
      try:
          # Use sys.module as we do not want to trigger import
          IPython = sys.modules[
              "IPython"
          ]  # pylint: disable=invalid-name
          if "IPKernelApp" not in IPython.get_ipython().config:
              return False  # Run in a IPython terminal
      except:  # pylint: disable=bare-except
          return False
      else:
          return True
  
imports: import base64
  import contextlib
  import functools
  import io
  import itertools
  import logging
  import os
  import random
  import re
  import shutil
  import string
  import sys
  import textwrap
  import threading
  import typing
  from typing import Any, Callable, Dict, Iterator, List, NoReturn, Optional, Tuple, Type, TypeVar, Union
  import uuid
  from absl import logging
  from etils import epath
  from six.moves import urllib
  from tensorflow_datasets.core import constants
  from tensorflow_datasets.core.utils import type_utils
label_desc: Use image node_id 1 for calling a global function with example usage: is_notebook() and returns: True, False, False