code: def _update_batch(ind, b_update, b=None, batch_shape=None):
      """Updates a batch of `i`, `j`, `q1[i]` or `q0[j]`."""
      updates = tf.gather_nd(b_update, ind)
      if b is None:
          return tf.scatter_nd(ind, updates, batch_shape)
      return tf.tensor_scatter_nd_update(b, ind, updates)
  
file_path: probability/tensorflow_probability/python/stats/ranking.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 3 for calling a global function with example usage: _update_batch(ind, b_update, b, batch_shape) and returns: tf, tf