code: def is_in_jupyter_notebook():
      # pylint: disable=import-outside-toplevel
      try:
          from IPython import get_ipython
  
          shell = get_ipython().__class__.__name__
          jupyter = shell in ["ZMQInteractiveShell", "Shell"]
      except ImportError:
          jupyter = False
  
      return jupyter
  
imports: import contextlib
  import numbers
  import os
  import random
  import warnings
  from typing import IO, Any, BinaryIO, Optional, Union
  import numpy
  import torch
  from torch.nn.utils.rnn import PackedSequence
  from torch.utils.data import Dataset
  from poutyne.warning_manager import warning_settings
label_desc: Use image node_id 12 for calling a global function with example usage: is_in_jupyter_notebook() and returns: jupyter