code: def gather_mh_like_result(results):
      """Gather log_accept_ratio and target_log_prob from kernel result."""
      # For MH kernel result.
      if hasattr(results, "proposed_results") and hasattr(
          results, "accepted_results"
      ):
          return (
              results.log_accept_ratio,
              results.accepted_results.target_log_prob,
          )
      # For NUTS kernel result.
      if hasattr(results, "log_accept_ratio") and hasattr(
          results, "target_log_prob"
      ):
          return results.log_accept_ratio, results.target_log_prob
      # For TransformTransitionKernel Result.
      if hasattr(results, "inner_results"):
          return gather_mh_like_result(results.inner_results)
      raise TypeError("Cannot find MH results.")
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import weighted_resampling
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.math.generic import log1mexp
  from tensorflow_probability.python.math.generic import log_add_exp
  from tensorflow_probability.python.math.generic import reduce_logmeanexp
  from tensorflow_probability.python.mcmc import hmc
  from tensorflow_probability.python.mcmc import random_walk_metropolis
  from tensorflow_probability.python.mcmc import transformed_kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 1 for calling a global function with example usage: gather_mh_like_result(results) and returns: results,  results, results,  results, gather_mh_like_result