code: def test_serve_endpoint_with_incorrect_accelerator(request, *args):
      mock_session = Mock(name="sagemaker_session")
      mock_session.return_value.sagemaker_client = Mock(
          name="sagemaker_client"
      )
      mock_session.config = None
  
      request.return_value = OK_RESPONSE
      mock_session.sagemaker_client.describe_endpoint_config.return_value = {
          "ProductionVariants": [
              {
                  "ModelName": "my-model",
                  "InitialInstanceCount": 1,
                  "InstanceType": "local",
                  "AcceleratorType": "local",
              }
          ]
      }
  
      mock_session.sagemaker_client.describe_model.return_value = {
          "PrimaryContainer": {
              "Environment": {},
              "Image": "123.dkr.ecr-us-west-2.amazonaws.com/sagemaker-container:1.0",
              "ModelDataUrl": "s3://sagemaker-us-west-2/some/model.tar.gz",
          }
      }
  
      endpoint = sagemaker.local.local_session._LocalEndpoint(
          "my-endpoint",
          "some-endpoint-config",
          local_session=mock_session,
      )
      endpoint.serve()
  
      with pytest.raises(KeyError):
          assert (
              endpoint.primary_container["Environment"][
                  "SAGEMAKER_INFERENCE_ACCELERATOR_PRESENT"
              ]
              == "true"
          )
  
imports: from __future__ import absolute_import
  import jsonschema
  import pytest
  import urllib3
  import os
  from botocore.exceptions import ClientError
  from mock import Mock, patch
  from tests.unit import DATA_DIR, SAGEMAKER_CONFIG_SESSION
  import sagemaker
  from sagemaker.workflow.parameters import ParameterString
  from sagemaker.workflow.pipeline import Pipeline
  from tests.unit.sagemaker.workflow.helpers import CustomStep
  from sagemaker.local.local_session import LocalSession
  from sagemaker.local.entities import _LocalPipelineExecution
label_desc: Use image node_id 25 for calling a global function with example usage: test_serve_endpoint_with_incorrect_accelerator(request) without return types