code: def _create_default_scope(
      optional_tags: Dict = {},
  ) -> sentry_sdk.Scope:
      """
      Creates default scope. Adds user ID as tag to the reported event.
      Can add optional tags.
      """
  
      scope = sentry_sdk.Scope()
  
      user_id = None
      client_id_file_path = util.cli_config_dir() / "client-id.txt"
      if not client_id_file_path.is_file():
          client_id_file_path.parent.mkdir(parents=True, exist_ok=True)
          client_id_file_path.write_text(str(uuid4()))
      user_id = client_id_file_path.read_text()
  
      if user_id:
          scope.set_user({"id": user_id})
  
      for k, v in optional_tags.items():
          scope.set_tag(k, v)
  
      return scope
  
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 2 for calling a global function with example usage: _create_default_scope(optional_tags) and returns: scope