code: def _get_context():
      """Determine the most specific context that we're in.
      Implementation from TensorBoard: https://git.io/JvObD.
  
      Returns:
      _CONTEXT_COLAB: If in Colab with an IPython notebook context.
      _CONTEXT_IPYTHON: If not in Colab, but we are in an IPython notebook
        context (e.g., from running `jupyter notebook` at the command
        line).
      _CONTEXT_NONE: Otherwise (e.g., by running a Python script at the
        command-line or using the `ipython` interactive shell).
      """
      # In Colab, the `google.colab` module is available, but the shell
      # returned by `IPython.get_ipython` does not have a `get_trait`
      # method.
      try:
          import google.colab  # noqa: F401
          import IPython
      except ImportError:
          pass
      else:
          if IPython.get_ipython() is not None:
              # We'll assume that we're in a Colab notebook context.
              return _CONTEXT_COLAB
  
      # In an IPython command line shell or Jupyter notebook, we can
      # directly query whether we're in a notebook context.
      try:
          import IPython
      except ImportError:
          pass
      else:
          ipython = IPython.get_ipython()
          if ipython is not None and ipython.has_trait("kernel"):
              return _CONTEXT_IPYTHON
  
      # Otherwise, we're not in a known notebook context.
      return _CONTEXT_NONE
  
imports: from collections import namedtuple
  from itertools import cycle
  from typing import Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Tuple, Union
  import torch
  from captum.attr import IntegratedGradients
  from captum.attr._utils.batching import _batched_generator
  from captum.insights.attr_vis.attribution_calculation import AttributionCalculation, OutputScore
  from captum.insights.attr_vis.config import ATTRIBUTION_METHOD_CONFIG, ATTRIBUTION_NAMES_TO_METHODS
  from captum.insights.attr_vis.features import BaseFeature
  from captum.insights.attr_vis.server import namedtuple_to_dict
  from captum.log import log_usage
  from torch import Tensor
  from torch.nn import Module
label_desc: Use image node_id 1 for calling a global function with example usage: _get_context() and returns: _CONTEXT_NONE, _CONTEXT_COLAB, _CONTEXT_IPYTHON