code: def cifar_tf_preprocess(
      inp,
      random_crop=True,
      random_flip=True,
      whiten=True,
      br_sat_con=False,
  ):
      image_size = 32
      image = inp
      if random_crop:
          image = tf.image.resize_image_with_crop_or_pad(
              inp, image_size + 4, image_size + 4
          )
          image = tf.random_crop(image, [image_size, image_size, 3])
      if random_flip:
          image = tf.image.random_flip_left_right(image)
      # Brightness/saturation/constrast provides small gains .2%~.5% on cifar.
      if br_sat_con:
          image = tf.image.random_brightness(
              image, max_delta=63.0 / 255.0
          )
          image = tf.image.random_saturation(
              image, lower=0.5, upper=1.5
          )
          image = tf.image.random_contrast(image, lower=0.2, upper=1.8)
      if whiten:
          image = tf.image.per_image_standardization(image)
      return image
  
file_path: cleverhans/cleverhans_v3.1.0/examples/multigpu_advtrain/utils_cifar.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import os
  import cPickle
  import numpy
  from six.moves import range
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: cifar_tf_preprocess(inp, random_crop, random_flip, whiten, br_sat_con) and returns: image