code: def maybe_add_noise(
      image,
      noise_shape,
      scale0,
      scale1,
      image_noise_probability,
      image_noise_ratio,
  ):
      """Add noise at two scales."""
  
      if image_noise_probability < 0.000001 or (
          image_noise_ratio < 0.000001
      ):
          return image
  
      noise_list = []
      for scale in [scale0, scale1]:
          rand_image_noise_ratio = tf.random.uniform(
              shape=[], minval=0.0, maxval=image_noise_ratio
          )
          noise_list.append(
              _rand_noise(
                  0.0, rand_image_noise_ratio, scale, noise_shape
              )
          )
  
      skip_noise = tf.greater(
          tf.random.uniform([]), image_noise_probability
      )
      image = tf.cond(
          skip_noise, lambda: image, lambda: image + noise_list[0]
      )
      image = tf.cond(
          skip_noise, lambda: image, lambda: image + noise_list[1]
      )
  
      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 4 for calling a global function with example usage: maybe_add_noise(image, noise_shape, scale0, scale1, image_noise_probability, image_noise_ratio) and returns: image, image