def METHOD_NAME(self, image):
    """Preprocess a single image in [height, width, depth] layout."""
    if self.subset == "train" and self.use_distortion:
        # Pad 4 pixels on each dimension of feature map, done in mini-batch
        image = tf.image.resize_image_with_crop_or_pad(image, 40, 40)
        image = tf.random_crop(image, [HEIGHT, WIDTH, DEPTH])
        image = tf.image.random_flip_left_right(image)
    return image