code: def json_sagemaker_session():
      ims = Mock(
          name="sagemaker_session",
          default_bucket_prefix=None,
      )
      ims.default_bucket = Mock(
          name="default_bucket", return_value=BUCKET_NAME
      )
      ims.sagemaker_runtime_client = Mock(name="sagemaker_runtime")
      ims.sagemaker_client.describe_endpoint = Mock(
          return_value=ENDPOINT_DESC
      )
      ims.sagemaker_client.describe_endpoint_config = Mock(
          return_value=ENDPOINT_CONFIG_DESC
      )
  
      ims.sagemaker_client.describe_endpoint = Mock(
          return_value=ENDPOINT_DESC
      )
      ims.sagemaker_client.describe_endpoint_config = Mock(
          return_value=ENDPOINT_CONFIG_DESC
      )
  
      response_body = Mock("body")
      response_body.read = Mock(
          "read", return_value=json.dumps([RETURN_VALUE])
      )
      response_body.close = Mock("close", return_value=None)
      ims.sagemaker_runtime_client.invoke_endpoint = Mock(
          name="invoke_endpoint",
          return_value={
              "Body": response_body,
              "ContentType": "application/json",
          },
      )
      return ims
  
imports: from __future__ import absolute_import
  import io
  import json
  import pytest
  from mock import Mock, call, patch
  from sagemaker.deserializers import CSVDeserializer, PandasDeserializer
  from sagemaker.enums import EndpointType
  from sagemaker.model_monitor.model_monitoring import DEFAULT_REPOSITORY_NAME
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import JSONSerializer, CSVSerializer
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
label_desc: Use image node_id 6 for calling a global function with example usage: json_sagemaker_session() and returns: ims