code: def get_execution_context():
      """Determine the most specific context that we're in.
      Returns:
        _COLAB_EXEC_CONTEXT: If in Colab with an IPython notebook context.
        _IPYTHON_EXEC_CONTEXT: If we are in an IPython notebook
          context but not in colab (i.e. `jupyter notebook`)
          line).
        _OTHER_EXEC_CONTEXT: 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.
  
      # imports are dynamic, since some modules are not available for all contexts
      try:
          import IPython
      except ImportError:
          pass
      else:
          ipython = IPython.get_ipython()
          # @TODO find a stable way to get colab context
          if ipython is not None and "google.colab" in str(ipython):
              # We are in Colab notebook context
              # global _CURRENT_CONTEXT
              # _CURRENT_CONTEXT = _COLAB_EXEC_CONTEXT
              return _COLAB_EXEC_CONTEXT
  
          # In an IPython command line shell or Jupyter notebook
          elif ipython is not None and ipython.has_trait("kernel"):
              # global _CURRENT_CONTEXT
              # _CURRENT_CONTEXT = _IPYTHON_EXEC_CONTEXT
              return _IPYTHON_EXEC_CONTEXT
  
      # Otherwise, we're not in a known notebook context.
      return _OTHER_EXEC_CONTEXT
  
file_path: aim/aim/ext/notebook/notebook.py
imports: import shlex
  from aim.cli.configs import VERSION_NAME, UP_NAME
  import aim.cli.manager.manager
label_desc: Use image node_id 1 for calling a global function with example usage: get_execution_context() and returns: _OTHER_EXEC_CONTEXT, _COLAB_EXEC_CONTEXT, _IPYTHON_EXEC_CONTEXT