code: def _sentry_context_dict(context):
      
      d = {
          "function_name": context.function_name,
          "function_version": context.function_version,
          "invoked_function_arn": context.invoked_function_arn,
          "memory_limit_in_mb": context.memory_limit_in_mb,
          "aws_request_id": context.aws_request_id,
          "log_group_name": context.log_group_name,
          "cognito_identity_id": context.identity.cognito_identity_id,
          "cognito_identity_pool_id": context.identity.cognito_identity_pool_id}
      for k, v in os.environ.items():
          if k not in {"AWS_SECURITY_TOKEN", "AWS_SESSION_TOKEN",
                       "AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"}:
              # Do not log credentials
              d[k] = v
  
      return d
docs: Create a dict with context information for Sentry.