human
Complete this python program:
def imagenet_preprocess_examples(examples, mode):
assistant
#Here is the Python program you requested.

    """Preprocessing used for Imagenet and similar problems.
    """
    def preprocess(img):
        img = tf.image.resize_images(img, [360, 360])
        img = common_layers.image_augmentation((tf.to_float(img) / 255.0))
        return tf.to_int64((img * 255.0))
    def resize(img):
        return tf.to_int64(tf.image.resize_images(img, [299, 299]))
    inputs = tf.cast(examples['inputs'], tf.int64)
    if (mode == tf.contrib.learn.ModeKeys.TRAIN):
        examples['inputs'] = tf.cond(tf.less(tf.random_uniform([]), 0.9), (lambda img=inputs: preprocess(img)), (lambda img=inputs: resize(img)))
    else:
        examples['inputs'] = resize(inputs)
    return examples