code: def is_enabled():
      from dvc.config import Config, to_bool
      from dvc.utils import env2bool
  
      if env2bool("DVC_TEST"):
          return False
  
      enabled = not os.getenv(DVC_NO_ANALYTICS)
      if enabled:
          enabled = to_bool(
              Config.from_cwd(validate=False)
              .get("core", {})
              .get("analytics", "true")
          )
  
      logger.debug("Analytics is %sabled.", "en" if enabled else "dis")
  
      return enabled
  
file_path: dvc/dvc/analytics.py
imports: import json
  import os
  from dvc.log import logger
  from .env import DVC_ANALYTICS_ENDPOINT, DVC_NO_ANALYTICS
label_desc: Use image node_id 2 for calling a global function with example usage: is_enabled() and returns: enabled, False