code: def _maybe_embed_swaps_validation(swaps, null_swaps, validate_args):
      """Return `swaps`, possibly with embedded "once only" assertion."""
      if not validate_args:
          return swaps
  
      assertions = [
          assert_util.assert_equal(
              null_swaps,
              mcmc_util.index_remapping_gather(swaps, swaps),
              message=(
                  'Proposed replica swaps must be consist of "once only '
                  'swaps," i.e., be a self-inverse permutation, '
                  "`range(swaps.shape[0]) == gather(swaps, swaps)."
              ),
          ),
      ]
      with tf.control_dependencies(assertions):
          return tf.identity(swaps)
  
imports: import collections
  import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import unnest
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 4 for calling a global function with example usage: _maybe_embed_swaps_validation(swaps, null_swaps, validate_args) and returns: swaps, tf