code: def make_one_step_fn(dtype):
      def one_step(current_state, previous_kernel_results):
          # Make next_state.
          if is_list_like(current_state):
              next_state = []
              for i, s in enumerate(current_state):
                  next_state.append(
                      tf.identity(s * dtype(i + 2), name="next_state")
                  )
          else:
              next_state = tf.identity(
                  2.0 * current_state, name="next_state"
              )
          # Make kernel_results.
          kernel_results = {}
          for fn in sorted(previous_kernel_results._fields):
              if fn == "grads_target_log_prob":
                  kernel_results["grads_target_log_prob"] = [
                      tf.identity(0.5 * g, name="grad_target_log_prob")
                      for g in previous_kernel_results.grads_target_log_prob
                  ]
              elif fn == "extraneous":
                  kernel_results[fn] = getattr(
                      previous_kernel_results, fn, None
                  )
              else:
                  kernel_results[fn] = tf.identity(
                      0.5 * getattr(previous_kernel_results, fn, None),
                      name=fn,
                  )
          kernel_results = type(previous_kernel_results)(
              **kernel_results
          )
          # Done.
          return next_state, kernel_results
  
      return one_step
  
imports: import collections
  import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc import metropolis_hastings
  from tensorflow_probability.python.mcmc.internal.util import is_list_like
label_desc: Use image node_id 1 for calling a global function with example usage: make_one_step_fn(dtype) and returns: one_step, next_state,  kernel_results