code: def get_apimode():
      """Returns the API mode label for the current session.
  
      The API mode label indicates whether DataLad is running in "normal"
      mode in a Python session, or whether it is used via the command line
      interface.
  
      This function is a utility for optimizing behavior and messaging to the
      particular API (Python vs command line) in use in a given process.
  
      Returns
      {'python', 'cmdline'}
        The API mode is 'python' by default, unless the main command line
        entrypoint set it to 'cmdline'.
      """
      return __api
  
file_path: datalad/datalad/__init__.py
imports: import atexit
  import os
  from .config import ConfigManager, warn_on_undefined_git_identity
  from datalad.utils import get_encoding_info, get_envvars_info, getpwd
  from .log import lgr
  from .support.sshconnector import SSHManager
  from ._version import get_versions
label_desc: Use image node_id 1 for calling a global function with example usage: get_apimode() and returns: __api