code: def test_worker_scale_down_affinity():
      initial_num_workers = 2
      setup_torchserve()
      requests.post(
          "http://localhost:8081/models?initial_workers={}&synchronous=true&url=resnet-18.mar".format(
              initial_num_workers
          )
      )
  
      scaled_down_num_workers = 1
      response = scale_workers_with_core_pinning(
          scaled_down_num_workers
      )
      resnet18_list = json.loads(response.content)
      assert (
          len(resnet18_list[0]["workers"]) == scaled_down_num_workers
      ), "workers failed to scale down with core pinning"
  
      response = run_inference_with_core_pinning()
      assert (
          response.status_code == 200
      ), "scaled down workers inference with core pinning failed"
  
      for worker_idx in range(scaled_down_num_workers):
          curr_worker_affinity = get_worker_affinity(
              scaled_down_num_workers, worker_idx
          )
          assert (
              curr_worker_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 9 for calling a global function with example usage: test_worker_scale_down_affinity() without return types