code: def _sentry_client(
      disabled: bool = False,
  ) -> sentry_sdk.Client:
      """
      Initialize sentry. You can override the default values with the following env vars:
      1. CORTEX_TELEMETRY_SENTRY_DSN
      2. CORTEX_TELEMETRY_SENTRY_ENVIRONMENT
      3. CORTEX_TELEMETRY_DISABLE
      """
  
      dsn = CORTEX_TELEMETRY_SENTRY_DSN
      environment = CORTEX_TELEMETRY_SENTRY_ENVIRONMENT
  
      if (
          disabled
          or os.getenv("CORTEX_TELEMETRY_DISABLE", "").lower() == "true"
      ):
          return
  
      if os.getenv("CORTEX_TELEMETRY_SENTRY_DSN", "") != "":
          dsn = os.environ["CORTEX_TELEMETRY_SENTRY_DSN"]
  
      if os.getenv("CORTEX_TELEMETRY_SENTRY_ENVIRONMENT", "") != "":
          environment = os.environ[
              "CORTEX_TELEMETRY_SENTRY_ENVIRONMENT"
          ]
  
      client = sentry_sdk.Client(
          dsn=dsn,
          environment=environment,
          release=CORTEX_VERSION,
          ignore_errors=[
              CortexBinaryException
          ],  # exclude CortexBinaryException exceptions
          in_app_include=[
              "cortex"
          ],  # for better grouping of events in sentry
          attach_stacktrace=True,
          default_integrations=False,  # disable all default integrations
          auto_enabling_integrations=False,
          integrations=[
              DedupeIntegration(),  # prevent duplication of events
              StdlibIntegration(),  # adds breadcrumbs (aka more info)
              ModulesIntegration(),  # adds info about installed modules
          ],
          # debug=True,
      )
  
      return client
  
file_path: cortex/python/client/cortex/telemetry.py
imports: import os
  from typing import Dict
  from uuid import uuid4
  import sentry_sdk
  from cortex import util
  from cortex.consts import CORTEX_VERSION, CORTEX_TELEMETRY_SENTRY_DSN, CORTEX_TELEMETRY_SENTRY_ENVIRONMENT
  from cortex.exceptions import CortexBinaryException
  from sentry_sdk.integrations.dedupe import DedupeIntegration
  from sentry_sdk.integrations.modules import ModulesIntegration
  from sentry_sdk.integrations.stdlib import StdlibIntegration
label_desc: Use image node_id 1 for calling a global function with example usage: _sentry_client(disabled) and returns: client