code: def test_invoke_endpoint_with_on_demand_explanations(
      sagemaker_session, endpoint_name
  ):
      response = (
          sagemaker_session.sagemaker_runtime_client.invoke_endpoint(
              EndpointName=endpoint_name,
              EnableExplanations="`false`",
              Body=TEST_CSV_DATA,
              ContentType="text/csv",
              Accept="text/csv",
          )
      )
      assert response
      response_body_stream = response["Body"]
      try:
          response_body_json = json.load(
              codecs.getreader("utf-8")(response_body_stream)
          )
          assert response_body_json
          # no records are explained when EnableExplanations="`false`"
          assert response_body_json.get("explanations") == {}
          assert response_body_json.get("predictions")
      finally:
          response_body_stream.close()
  
file_path: sagemaker-python-sdk/tests/integ/test_explainer.py
imports: from __future__ import absolute_import
  import codecs
  import json
  import os
  import pytest
  import tests.integ
  import tests.integ.timeout
  from sagemaker import image_uris
  from sagemaker.model import Model
  from sagemaker.utils import unique_name_from_base
  from sagemaker.explainer.explainer_config import ExplainerConfig
  from sagemaker.explainer.clarify_explainer_config import ClarifyExplainerConfig, ClarifyShapConfig, ClarifyShapBaselineConfig
  from tests.integ import DATA_DIR
label_desc: Use image node_id 4 for calling a global function with example usage: test_invoke_endpoint_with_on_demand_explanations(sagemaker_session, endpoint_name) without return types