code: def hmc_like_log_accept_prob_getter_fn(kernel_results):
      log_accept_ratio = unnest.get_innermost(
          kernel_results, "log_accept_ratio"
      )
      safe_accept_ratio = tf.where(
          tf.math.is_finite(log_accept_ratio),
          log_accept_ratio,
          tf.constant(-np.inf, dtype=log_accept_ratio.dtype),
      )
      return tf.minimum(safe_accept_ratio, 0.0)
  
imports: import collections
  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.internal import tensorshape_util
  from tensorflow_probability.python.internal import unnest
  from tensorflow_probability.python.math.generic import reduce_logmeanexp
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 3 for calling a global function with example usage: hmc_like_log_accept_prob_getter_fn(kernel_results) and returns: tf