code: def run_benchmark(
      world, sensors, n_vehicles, n_walkers, client, debug=False
  ):
      global sensors_callback
  
      spawn_points = world.get_map().get_spawn_points()
      n = min(n_vehicles, len(spawn_points))
      list_fps = []
      sensor_list = None
  
      tick = world.tick if args.sync else world.wait_for_tick
      set_world_settings(world, args)
  
      (
          vehicles_list,
          walkers_list,
          all_id,
          all_actors,
          sensors_ret,
      ) = create_environment(
          world, sensors, n, n_walkers, spawn_points, client, tick
      )
  
      if sensors_ret:
          sensor_list = sensors_ret
  
      # Allow some time for the server to finish the initialization
      for _i in range(0, 50):
          tick()
  
      ticks = 0
      while ticks < int(args.ticks):
          _ = tick()
          if debug:
              print("== Samples {} / {}".format(ticks + 1, args.ticks))
  
          min_fps = float("inf")
          for sc in sensors_callback:
              fps = sc.get_fps()
              if fps < min_fps:
                  min_fps = fps
          if math.isinf(min_fps):
              min_fps = 0
          list_fps.append(min_fps)
  
          ticks += 1
  
      for sensor in sensor_list:
          sensor.stop()
          sensor.destroy()
      sensors_callback.clear()
  
      print("Destroying %d vehicles.\n" % len(vehicles_list))
      client.apply_batch(
          [carla.command.DestroyActor(x) for x in vehicles_list]
      )
  
      # stop walker controllers (list is [controller, actor, controller, actor ...])
      for i in range(0, len(all_id), 2):
          all_actors[i].stop()
  
      print("\ndestroying %d walkers" % len(walkers_list))
      client.apply_batch(
          [carla.command.DestroyActor(x) for x in all_id]
      )
  
      set_world_settings(world)
  
      return list_fps
  
imports: import sys
  from tr import tr
  import argparse
  import cpuinfo
  import glob
  import math
  import numpy
  import os
  import psutil
  import pygame
  import shutil
  import GPUtil
  import threading
  import time
  import logging
  import carla
label_desc: Use image node_id 7 for calling a global function with example usage: run_benchmark(world, sensors, n_vehicles, n_walkers, client, debug) and returns: list_fps