code: def _get_mixing_indices(size, seed=None, name=None):
      """Generates an array of indices suitable for mutation operation.
  
      The mutation operation in differential evolution requires that for every
      element of the population, three distinct other elements be chosen to produce
      a trial candidate. This function generates an array of shape [size, 3]
      satisfying the properties that:
        (a). array[i, :] does not contain the index 'i'.
        (b). array[i, :] does not contain any overlapping indices.
        (c). All elements in the array are between 0 and size - 1 inclusive.
  
      Args:
        size: Scalar integer `Tensor`. The number of samples as well as a the range
          of the indices to sample from.
        seed: `int` or None. The random seed for this `Op`. If `None`, no seed is
          applied.
          Default value: `None`.
        name:  Python `str` name prefixed to Ops created by this function.
          Default value: 'get_mixing_indices'.
  
      Returns:
        sample: A `Tensor` of shape [size, 3] and same dtype as `size` containing
        samples without replacement between 0 and size - 1 (inclusive) with the
        `i`th row not including the number `i`.
      """
      with tf.name_scope(name or "get_mixing_indices"):
          size = tf.convert_to_tensor(size)
          dtype = size.dtype
          stream = seed_stream.SeedStream(
              seed, salt="get_mixing_indices"
          )
          first = tf.random.uniform(
              [size], maxval=size - 1, dtype=dtype, seed=stream()
          )
          second = tf.random.uniform(
              [size], maxval=size - 2, dtype=dtype, seed=stream()
          )
          third = tf.random.uniform(
              [size], maxval=size - 3, dtype=dtype, seed=stream()
          )
  
          # Shift second if it is on top of or to the right of first
          second = tf.where(first < second, second, second + 1)
          smaller = tf.math.minimum(first, second)
          larger = tf.math.maximum(first, second)
          # Shift the third one so it does not coincide with either the first or the
          # second number. Assuming first < second, shift by 1 if the number is in
          # [first, second) and by 2 if the number is greater than or equal to the
          # second.
          third = tf.where(third < smaller, third, third + 1)
          third = tf.where(third < larger, third, third + 1)
          sample = tf.stack([first, second, third], axis=1)
          to_avoid = tf.expand_dims(tf.range(size), axis=-1)
          sample = tf.where(sample < to_avoid, sample, sample + 1)
          return sample
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import categorical
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.util import seed_stream
label_desc: Use image node_id 10 for calling a global function with example usage: _get_mixing_indices(size, seed, name) and returns: sample