code: def main(
      metrics_actor,
      test_name: str,
      num_runs: int,
      num_tasks_or_actors_per_run: int,
      num_cpus_in_cluster: int,
      num_gpus_in_cluster: int,
      library_to_import: str,
      use_actors: bool,
      with_gpu: bool,
      with_runtime_env: bool,
  ):
      num_gpus = (
          (num_gpus_in_cluster / num_tasks_or_actors_per_run)
          if with_gpu
          else 0
      )
      num_cpus = num_cpus_in_cluster / num_tasks_or_actors_per_run
  
      print(
          f"Assigning each task/actor {num_cpus} num_cpus and {num_gpus} num_gpus"
      )
      actor_with_resources = Actor.options(
          num_gpus=num_gpus, num_cpus=num_cpus
      )
      task_with_resources = task.options(
          num_gpus=num_gpus, num_cpus=num_cpus
      )
  
      should_import_torch = library_to_import == "torch"
      print(f"should_import_torch: {should_import_torch}")
  
      fail_if_incorrect_runtime_env(expect_runtime_env=with_runtime_env)
  
      def with_actors():
          actors = [
              actor_with_resources.remote()
              for _ in range(num_tasks_or_actors_per_run)
          ]
          ray.get(
              [
                  actor.run_code.remote(should_import_torch)
                  for actor in actors
              ]
          )
  
      def with_tasks():
          ray.get(
              [
                  task_with_resources.remote(should_import_torch)
                  for _ in range(num_tasks_or_actors_per_run)
              ]
          )
  
      func_to_measure = with_actors if use_actors else with_tasks
  
      for run in range(num_runs):
          print(f"Starting measurement for run {run}")
          start = time.time()
          func_to_measure()
          dur_s = time.time() - start
          ray.get(metrics_actor.submit.remote(test_name, dur_s))
  
file_path: ray/release/benchmark-worker-startup/test_single_configuration.py
imports: import argparse
  import ray
  import sys
  import time
label_desc: Use image node_id 2 for calling a global function with example usage: main(metrics_actor, test_name, num_runs, num_tasks_or_actors_per_run, num_cpus_in_cluster, num_gpus_in_cluster, library_to_import, use_actors, with_gpu, with_runtime_env) without return types