code: def parse_record(raw_record, is_training, dtype):
    
    image_buffer, label = _parse_example_proto(raw_record)
  
    image = imagenet_preprocessing.preprocess_image(
        image_buffer=image_buffer,
        output_height=_DEFAULT_IMAGE_SIZE,
        output_width=_DEFAULT_IMAGE_SIZE,
        num_channels=_NUM_CHANNELS,
        is_training=is_training)
    image = tf.cast(image, dtype)
  
    return image, label
docs: Parses a record containing a training example of an image.
  
    The input record is parsed into a label and image, and the image is passed
    through preprocessing steps (cropping, flipping, and so on).
  
    Args:
      raw_record: scalar Tensor tf.string containing a serialized
        Example protocol buffer.
      is_training: A boolean denoting whether the input is for training.
      dtype: data type to use for images/features.
  
    Returns:
      Tuple with processed image tensor and one-hot-encoded label tensor.