code: def random_blueprint(
      world: carla.World, actor_filter="vehicle.*", role_name="agent"
  ) -> carla.ActorBlueprint:
      """Retrieves a random blueprint.
      :param world: a carla.World instance.
      :param actor_filter: a string used to filter (select) blueprints. Default: 'vehicle.*'
      :param role_name: blueprint's role_name, Default: 'agent'.
      :return: a carla.ActorBlueprint instance.
      """
      blueprints = world.get_blueprint_library().filter(actor_filter)
      blueprint: carla.ActorBlueprint = random.choice(blueprints)
      blueprint.set_attribute("role_name", role_name)
  
      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 blueprint.has_attribute("is_invincible"):
          blueprint.set_attribute("is_invincible", "true")
  
      # set the max speed
      if blueprint.has_attribute("speed"):
          float(blueprint.get_attribute("speed").recommended_values[1])
          float(blueprint.get_attribute("speed").recommended_values[2])
      else:
          print("No recommended values for 'speed' attribute")
  
      return blueprint
  
imports: import os
  import cv2
  import math
  import random
  import numpy
  import carla
  import pygame
  import threading
  import datetime
  from typing import Union
  from tensorforce.agents import Agent
label_desc: Use image node_id 8 for calling a global function with example usage: random_blueprint(world, actor_filter, role_name) and returns: blueprint