code: def get_random_ball(color):
      velocity_range = (-1, -1, 0), (1, 1, 0)
      ball_material = kb.FlatMaterial(
          color=color, indirect_visibility=False
      )
      shape = FLAGS.shape
      if shape == "mixed":
          shape = rng.choice(["cube", "sphere"])
      if shape == "cube":
          ball = kb.Cube(
              scale=[FLAGS.ball_radius] * 3,
              material=ball_material,
              friction=FLAGS.friction,
              restitution=FLAGS.restitution,
              quaternion=kb.random_rotation([0, 0, 1], rng),
              velocity=rng.uniform(*velocity_range),
          )
      elif shape == "sphere":
          ball = kb.Sphere(
              scale=[FLAGS.ball_radius] * 3,
              material=ball_material,
              friction=FLAGS.friction,
              restitution=FLAGS.restitution,
              velocity=rng.uniform(*velocity_range),
          )
      else:
          raise ValueError(f"Unknown shape type '{shape}'")
  
      ball.metadata["color"] = color
      return ball
  
imports: import logging
  import kubric
  from kubric.simulator import PyBullet
  from kubric.renderer import Blender
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: get_random_ball(color) and returns: ball