code: def test_batch_input(set_custom_handler, handler_name):
      """
      Tests pytorch profiler integration with batch inference
      """
  
      CUSTOM_PATH = "/tmp/output/resnet-152-batch"
  
      if os.path.exists(CUSTOM_PATH):
          shutil.rmtree(CUSTOM_PATH)
      assert os.path.exists(data_file_resnet)
  
      def invoke_batch_input():
          data = open(data_file_resnet, "rb")
          response = requests.post(
              "{}/predictions/resnet152".format(TF_INFERENCE_API), data
          )
          assert response.status_code == 200
          assert "tiger_cat" in json.loads(response.content)
  
      with futures.ThreadPoolExecutor(2) as executor:
          for _ in range(2):
              executor.submit(invoke_batch_input)
  
      assert (
          len(glob.glob("{}/*.pt.trace.json".format(CUSTOM_PATH))) == 1
      )
      test_utils.unregister_model("resnet152")
      shutil.rmtree(CUSTOM_PATH)
      test_utils.torchserve_cleanup()
  
file_path: serve/test/pytest/test_pytorch_profiler.py
imports: import glob
  import json
  import os
  import pathlib
  import shutil
  import subprocess
  import pytest
  import requests
  import test_utils
  from concurrent import futures
label_desc: Use image node_id 4 for calling a global function with example usage: test_batch_input(set_custom_handler, handler_name) without return types