code: def intensity_shift(
      image, label, per_class_intensity_scale, per_class_intensity_shift
  ):
      """Perturb intensity in lesion and non-lesion regions."""
  
      if per_class_intensity_scale < 0.000001 and (
          per_class_intensity_shift < 0.000001
      ):
          return image
  
      # Randomly change (mostly increase) intensity of non-lesion region.
      per_class_noise = _truncated_normal(
          per_class_intensity_shift, per_class_intensity_scale
      )
      image = image + per_class_noise * (
          image * tf.cast(tf.greater(label, 1.5), tf.float32)
      )
  
      # Randomly change (mostly decrease) intensity of lesion region.
      per_class_noise = _truncated_normal(
          -per_class_intensity_shift, per_class_intensity_scale
      )
      image = image + per_class_noise * (
          image * tf.cast(tf.less(label, 1.5), tf.float32)
      )
  
      return image
  
file_path: mesh/mesh_tensorflow/experimental/data_aug_lib.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow.compat.v1
  import tensorflow_probability
  from tensorflow.contrib import image
label_desc: Use image node_id 9 for calling a global function with example usage: intensity_shift(image, label, per_class_intensity_scale, per_class_intensity_shift) and returns: image, image