code: def test_profiler_default_and_custom_handler(
      set_custom_handler, handler_name
  ):
      """
      Tests pytorch profiler integration with default and custom handler
      """
      assert os.path.exists(data_file_resnet)
      data = open(data_file_resnet, "rb")
      response = requests.post(
          "{}/predictions/resnet152".format(TF_INFERENCE_API), data
      )
      assert "tiger_cat" in json.loads(response.content)
      assert (
          len(
              glob.glob("{}/*.pt.trace.json".format(DEFAULT_OUTPUT_DIR))
          )
          == 1
      )
      test_utils.unregister_model("resnet152")
      shutil.rmtree(DEFAULT_OUTPUT_DIR)
      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 2 for calling a global function with example usage: test_profiler_default_and_custom_handler(set_custom_handler, handler_name) without return types