code: def assert_invoked_with_body_dict(sagemaker_session, **kwargs):
      call = (
          sagemaker_session.sagemaker_runtime_client.invoke_endpoint.call_args
      )
      cargs, ckwargs = call
      assert not cargs
      assert len(kwargs) == len(ckwargs)
      for k in ckwargs:
          if k != "Body":
              assert kwargs[k] == ckwargs[k]
          else:
              actual_body = json.loads(ckwargs[k])
              expected_body = json.loads(kwargs[k])
              assert len(actual_body) == len(expected_body)
              for k2 in actual_body:
                  assert actual_body[k2] == expected_body[k2]
  
imports: from __future__ import absolute_import
  import io
  import json
  import logging
  import mock
  import pytest
  from mock import Mock, patch, ANY
  from sagemaker.serializers import CSVSerializer, IdentitySerializer
  from sagemaker.tensorflow import TensorFlow, TensorFlowModel, TensorFlowPredictor
label_desc: Use image node_id 22 for calling a global function with example usage: assert_invoked_with_body_dict(sagemaker_session) without return types