code: def in_notebook() -> bool:
      try:
          from IPython import get_ipython
  
          if (
              "IPKernelApp" not in get_ipython().config
          ):  # pragma: no cover
              return False
      except ImportError:
          return False
      except AttributeError:
          return False
      return True
  
imports: from __future__ import annotations
  import os
  import re
  import typing
  import uuid
  from abc import ABC
  from datetime import datetime
  from datetime import timezone
  from functools import lru_cache
  from platform import platform
  from platform import python_version
  import attr
  import attr.converters
  import psutil
  import yaml
  from simple_di import Provide
  from simple_di import inject
  from ...cloud.config import CloudClientConfig
  from ...configuration import BENTOML_VERSION
  from ...configuration.containers import BentoMLContainer
  from ...utils import bentoml_cattr
label_desc: Use image node_id 6 for calling a global function with example usage: in_notebook() and returns: True, False, False, False