code: def _run_parallel(
      deployment_name,
      warmup,
      barrier,
      query_queue,
      result_queue,
      client_num,
      stream,
      vllm,
  ):
      pid = os.getpid()
      session_id = f"test_session_p{pid}_t{threading.get_ident()}"
  
      event_loop = asyncio.new_event_loop()
      asyncio.set_event_loop(event_loop)
      if not vllm:
          import mii
  
          client = mii.client(deployment_name)
  
      barrier.wait()
  
      for _ in range(warmup):
          print(
              f"warmup queue size: {query_queue.qsize()} ({pid})",
              flush=True,
          )
          input_tokens, req_max_new_tokens = query_queue.get(
              timeout=1.0
          )
  
          if vllm:
              call_vllm(input_tokens, req_max_new_tokens, stream)
          else:
              call_mii(client, input_tokens, req_max_new_tokens, stream)
  
      barrier.wait()
  
      time.sleep(random.uniform(0, client_num) * 0.01)
      try:
          while not query_queue.empty():
              print(
                  f"queue size: {query_queue.qsize()} ({pid})",
                  flush=True,
              )
              input_tokens, req_max_new_tokens = query_queue.get(
                  timeout=1.0
              )
  
              # Set max_new_tokens following normal distribution
              if vllm:
                  r = call_vllm(input_tokens, req_max_new_tokens)
              else:
                  r = call_mii(
                      client, input_tokens, req_max_new_tokens, stream
                  )
  
              result_queue.put(r)
      except queue.Empty:
          print(f"queue is empty ({pid})")
  
      print(f"Worker ({pid}) finished. session_id: {session_id}")
  
imports: import os
  import time
  import random
  import argparse
  import queue
  import multiprocessing
  import threading
  from statistics import mean
  from dataclasses import dataclass, asdict
  from typing import List, Iterable
  from pathlib import Path
  from datetime import datetime
  import numpy
  from transformers import AutoTokenizer
  from random_query_generator import RandomQueryGenerator
  from sample_input import all_text
  import time
  import json
  import asyncio
  import requests
  from postprocess_results import get_summary, ResponseDetails
label_desc: Use image node_id 4 for calling a global function with example usage: _run_parallel(deployment_name, warmup, barrier, query_queue, result_queue, client_num, stream, vllm) without return types