code: def make_rwmh_kernel_fn(target_log_prob_fn, init_state, scalings):
      """Generate a Random Walk MH kernel."""
      with tf.name_scope("make_rwmh_kernel_fn"):
          state_std = [
              tf.math.reduce_std(x, axis=0, keepdims=True)
              for x in init_state
          ]
          step_size = [
              s
              * ps.cast(  # pylint: disable=g-complex-comprehension
                  bu.left_justified_expand_dims_like(scalings, s),
                  s.dtype,
              )
              for s in state_std
          ]
          return random_walk_metropolis.RandomWalkMetropolis(
              target_log_prob_fn,
              new_state_fn=random_walk_metropolis.random_walk_normal_fn(
                  scale=step_size
              ),
          )
  
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 3 for calling a global function with example usage: make_rwmh_kernel_fn(target_log_prob_fn, init_state, scalings) and returns: random_walk_metropolis