code: def scheduled_sample_prob(
      ground_truth_x, generated_x, batch_size, scheduled_sample_var
  ):
      """Probability based scheduled sampling.
  
      Args:
        ground_truth_x: tensor of ground-truth data points.
        generated_x: tensor of generated data points.
        batch_size: batch size
        scheduled_sample_var: probability of choosing from ground_truth.
      Returns:
        New batch with randomly selected data points.
      """
      probability_threshold = scheduled_sample_var
      probability_of_generated = tf.random_uniform([batch_size])
      return tf.where(
          probability_of_generated > probability_threshold,
          generated_x,
          ground_truth_x,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import contrib
  import tensorflow.compat.v1
  from tensorflow.python.ops import summary_op_util
label_desc: Use image node_id 9 for calling a global function with example usage: scheduled_sample_prob(ground_truth_x, generated_x, batch_size, scheduled_sample_var) and returns: tf