code: def _maybe_validate_target_accept_prob(
      target_accept_prob, validate_args
  ):
      """Validates that target_accept_prob is in (0, 1)."""
      if not validate_args:
          return target_accept_prob
      assertions = [
          assert_util.assert_greater(
              target_accept_prob,
              tf.zeros([], dtype=target_accept_prob.dtype),
              message="`target_accept_prob` must be > 0.",
          ),
          assert_util.assert_less(
              target_accept_prob,
              tf.ones([], dtype=target_accept_prob.dtype),
              message="`target_accept_prob` must be < 1.",
          ),
      ]
      with tf.control_dependencies(assertions):
          return tf.identity(target_accept_prob)
  
imports: import collections
  import functools
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math.generic import reduce_logmeanexp
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
  from tensorflow_probability.python.mcmc.simple_step_size_adaptation import get_differing_dims
  from tensorflow_probability.python.mcmc.simple_step_size_adaptation import hmc_like_log_accept_prob_getter_fn
  from tensorflow_probability.python.mcmc.simple_step_size_adaptation import hmc_like_step_size_getter_fn
  from tensorflow_probability.python.mcmc.simple_step_size_adaptation import hmc_like_step_size_setter_fn
label_desc: Use image node_id 1 for calling a global function with example usage: _maybe_validate_target_accept_prob(target_accept_prob, validate_args) and returns: target_accept_prob, tf