code: def _distort_color(image, color_ordering=0, scope=None):
      """Distort the color of a Tensor image.
  
      Each color distortion is non-commutative and thus ordering of the color ops
      matters. Ideally we would randomly permute the ordering of the color ops.
      Rather then adding that level of complication, we select a distinct ordering
      of color ops for each preprocessing thread.
  
      Args:
        image: 3-D Tensor containing single image in [0, 1].
        color_ordering: Python int, a type of distortion (valid values: 0-3).
        scope: Optional scope for name_scope.
      Returns:
        3-D Tensor color-distorted image on range [0, 1]
      Raises:
        ValueError: if color_ordering not in [0, 3]
      """
      with tf.name_scope(scope, "distort_color", [image]):
          if color_ordering == 0:
              image = tf.image.random_brightness(
                  image, max_delta=32.0 / 255.0
              )
              image = tf.image.random_saturation(
                  image, lower=0.5, upper=1.5
              )
              image = tf.image.random_hue(image, max_delta=0.2)
              image = tf.image.random_contrast(
                  image, lower=0.5, upper=1.5
              )
          elif color_ordering == 1:
              image = tf.image.random_saturation(
                  image, lower=0.5, upper=1.5
              )
              image = tf.image.random_brightness(
                  image, max_delta=32.0 / 255.0
              )
              image = tf.image.random_contrast(
                  image, lower=0.5, upper=1.5
              )
              image = tf.image.random_hue(image, max_delta=0.2)
          elif color_ordering == 2:
              image = tf.image.random_contrast(
                  image, lower=0.5, upper=1.5
              )
              image = tf.image.random_hue(image, max_delta=0.2)
              image = tf.image.random_brightness(
                  image, max_delta=32.0 / 255.0
              )
              image = tf.image.random_saturation(
                  image, lower=0.5, upper=1.5
              )
          elif color_ordering == 3:
              image = tf.image.random_hue(image, max_delta=0.2)
              image = tf.image.random_saturation(
                  image, lower=0.5, upper=1.5
              )
              image = tf.image.random_contrast(
                  image, lower=0.5, upper=1.5
              )
              image = tf.image.random_brightness(
                  image, max_delta=32.0 / 255.0
              )
          else:
              raise ValueError("color_ordering must be in [0, 3]")
  
          # The random_* ops do not necessarily clamp.
          return tf.clip_by_value(image, 0.0, 1.0)
  
file_path: tensor2tensor/tensor2tensor/data_generators/vqa_utils.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  from tensorflow.python.ops import control_flow_ops
label_desc: Use image node_id 4 for calling a global function with example usage: _distort_color(image, color_ordering, scope) and returns: tf