code: def _dummy_indices_like(indices):
      """Returns dummy indices ([0, 1, 2, ...]) with batch shape like `indices`."""
      indices_shape = ps.shape(indices)
      num_particles = indices_shape[0]
      return tf.broadcast_to(
          ps.reshape(
              ps.range(num_particles),
              ps.pad(
                  [num_particles],
                  paddings=[[0, ps.rank_from_shape(indices_shape) - 1]],
                  constant_values=1,
              ),
          ),
          indices_shape,
      )
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import weighted_resampling
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 1 for calling a global function with example usage: _dummy_indices_like(indices) and returns: tf