code: def test_single_worker_affinity():
      num_workers = 1
      worker_idx = 0
      setup_torchserve()
      requests.post(
          "http://localhost:8081/models?initial_workers={}&synchronous=true&url=resnet-18.mar".format(
              num_workers
          )
      )
  
      response = run_inference_with_core_pinning()
      assert (
          response.status_code == 200
      ), "single-worker inference with core pinning failed"
  
      affinity = get_worker_affinity(num_workers, worker_idx)
      assert (
          affinity in open(TS_LOG).read()
      ), "workers are not correctly pinned to cores"
  
file_path: serve/test/pytest/test_example_intel_extension_for_pytorch.py
imports: import json
  import os
  import subprocess
  import pytest
  import requests
  import test_utils
  import torch
  from test_handler import run_inference_using_url_with_data
label_desc: Use image node_id 6 for calling a global function with example usage: test_single_worker_affinity() without return types