code: def test_json_double_batch(handle_fn, base_model_context):
      """
      More complex test case. Makes sure the model can
      mux several batches and return the demuxed results
      """
      test_data = [
          {"body": {"instances": [[1.0, 2.0]]}},
          {"body": {"instances": [[4.0, 3.0], [5.0, 6.0]]}},
      ]
      expected_result = [
          '{"predictions": [1]}',
          '{"predictions": [0, 1]}',
      ]
  
      envelope = JSONEnvelope(handle_fn)
      results = envelope.handle(test_data, base_model_context)
      print(results)
      assert results == expected_result
  
file_path: serve/ts/torch_handler/unit_tests/test_envelopes.py
imports: import pytest
  from ts.torch_handler.base_handler import BaseHandler
  from ts.torch_handler.request_envelope.body import BodyEnvelope
  from ts.torch_handler.request_envelope.json import JSONEnvelope
label_desc: Use image node_id 4 for calling a global function with example usage: test_json_double_batch(handle_fn, base_model_context) without return types