code: def get_kitti_pp(task):
      """Data preprocess function for kitti dataset."""
  
      def _closest_vehicle_distance_pp(data):
          """Predict the distance to the closest vehicle."""
          # Location feature contains (x, y, z) in meters w.r.t. the camera.
          vehicles = tf.where(
              data["objects"]["type"] < 3
          )  # Car, Van, Truck.
          vehicle_z = tf.gather(
              params=data["objects"]["location"][:, 2], indices=vehicles
          )
          vehicle_z = tf.concat(
              [vehicle_z, tf.constant([[1000.0]])], axis=0
          )
          dist = tf.reduce_min(vehicle_z)
          # Results in a uniform distribution over three distances, plus one class for
          # "no vehicle".
          thrs = np.array([-100.0, 8.0, 20.0, 999.0])
          label = tf.reduce_max(tf.where((thrs - dist) < 0))
          return {"image": data["image"], "label": label}
  
      task_to_preprocess = {
          "closest_vehicle_distance": _closest_vehicle_distance_pp,
      }
  
      return task_to_preprocess[task]
  
imports: import numpy
  from scenic.dataset_lib.big_transfer.registry import Registry
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling a global function with example usage: get_kitti_pp(task) and returns: task_to_preprocess, dict