code: def test_determ(self):
      print("TestDeterminism.test_determ")
      number_of_vehicles = 100
      tm_seed = 1
  
      self.client.load_world("Town03")
      # workaround: give time to UE4 to clean memory after loading (old assets)
      time.sleep(5)
  
      # set setting for round 1
      world = self.client.get_world()
      old_settings = world.get_settings()
      new_settings = world.get_settings()
      new_settings.synchronous_mode = True
      new_settings.fixed_delta_seconds = 0.05
      world.apply_settings(new_settings)
  
      blueprints = world.get_blueprint_library().filter("vehicle.*")
      spawn_points = world.get_map().get_spawn_points()
  
      # --------------
      # Spawn vehicles
      # --------------
      blueprint_transform_list = []
      hero = True
      for n, transform in enumerate(spawn_points):
          if n >= number_of_vehicles:
              break
          blueprint = random.choice(blueprints)
          if blueprint.has_attribute("color"):
              color = random.choice(
                  blueprint.get_attribute("color").recommended_values
              )
              blueprint.set_attribute("color", color)
          if blueprint.has_attribute("driver_id"):
              driver_id = random.choice(
                  blueprint.get_attribute(
                      "driver_id"
                  ).recommended_values
              )
              blueprint.set_attribute("driver_id", driver_id)
          if hero:
              blueprint.set_attribute("role_name", "hero")
              hero = False
          else:
              blueprint.set_attribute("role_name", "autopilot")
          blueprint_transform_list.append((blueprint, transform))
  
      # reset for simulation 1
      self.client.reload_world(False)
      # workaround: give time to UE4 to clean memory after loading (old assets)
      time.sleep(5)
      world = self.client.get_world()
      traffic_manager = self.client.get_trafficmanager(TM_PORT)
      traffic_manager.set_synchronous_mode(True)
      traffic_manager.set_random_device_seed(tm_seed)
      traffic_manager.set_hybrid_physics_mode(True)
  
      # run simulation 1
      vehicle_actor_list = self.spawn_vehicles(
          world, blueprint_transform_list
      )
      record_run1 = self.run_simulation(world, vehicle_actor_list)
      traffic_manager.shut_down()
  
      # reset for simulation 2
      self.client.reload_world(False)
      # workaround: give time to UE4 to clean memory after loading (old assets)
      time.sleep(5)
      world = self.client.get_world()
      traffic_manager = self.client.get_trafficmanager(TM_PORT)
      traffic_manager.set_synchronous_mode(True)
      traffic_manager.set_random_device_seed(tm_seed)
      traffic_manager.set_hybrid_physics_mode(True)
  
      # run simulation 2
      vehicle_actor_list = self.spawn_vehicles(
          world, blueprint_transform_list
      )
      record_run2 = self.run_simulation(world, vehicle_actor_list)
      traffic_manager.shut_down()
  
      self.client.reload_world()
      world.apply_settings(old_settings)
      # workaround: give time to UE4 to clean memory after loading (old assets)
      time.sleep(5)
  
      self.compare_records(record_run1, record_run2)
  
file_path: carla/PythonAPI/test/smoke/test_determinism.py
imports: from numpy import random
  from .None import SmokeTest
  import time
  import carla
label_desc: Use image node_id 4 for calling the TestDeterminism obj's underlying member method code with example usage: obj.test_determ() without return types