code: def random_walk_normal_fn(scale=1.0, name=None):
      """Returns a callable that adds a random normal perturbation to the input.
  
      This function returns a callable that accepts a Python `list` of `Tensor`s of
      any shapes and `dtypes`  representing the state parts of the `current_state`
      and a random seed. The supplied argument `scale` must be a `Tensor` or Python
      `list` of `Tensor`s representing the scale of the generated
      proposal. `scale` must broadcast with the state parts of `current_state`.
      The callable adds a sample from a zero-mean normal distribution with the
      supplied scales to each state part and returns a same-type `list` of `Tensor`s
      as the state parts of `current_state`.
  
      Args:
        scale: a `Tensor` or Python `list` of `Tensor`s of any shapes and `dtypes`
          controlling the scale of the normal proposal distribution.
        name: Python `str` name prefixed to Ops created by this function.
            Default value: 'random_walk_normal_fn'.
  
      Returns:
        random_walk_normal_fn: A callable accepting a Python `list` of `Tensor`s
          representing the state parts of the `current_state` and an `int`
          representing the random seed to be used to generate the proposal. The
          callable returns the same-type `list` of `Tensor`s as the input and
          represents the proposal for the RWM algorithm.
      """
  
      def _fn(state_parts, seed, experimental_shard_axis_names=None):
          """Adds a normal perturbation to the input state.
  
          Args:
            state_parts: A list of `Tensor`s of any shape and real dtype representing
              the state parts of the `current_state` of the Markov chain.
            seed: PRNG seed; see `tfp.random.sanitize_seed` for details.
            experimental_shard_axis_names: A structure of string names indicating how
              members of the state are sharded.
  
          Returns:
            perturbed_state_parts: A Python `list` of The `Tensor`s. Has the same
              shape and type as the `state_parts`.
  
          Raises:
            ValueError: if `scale` does not broadcast with `state_parts`.
          """
          with tf.name_scope(name or "random_walk_normal_fn"):
              scales = (
                  scale if mcmc_util.is_list_like(scale) else [scale]
              )
              if len(scales) == 1:
                  scales *= len(state_parts)
              if len(state_parts) != len(scales):
                  raise ValueError(
                      "`scale` must broadcast with `state_parts`."
                  )
  
              part_seeds = list(
                  samplers.split_seed(seed, n=len(state_parts))
              )
              part_seeds = distribute_lib.fold_in_axis_index(
                  part_seeds, experimental_shard_axis_names
              )
  
              next_state_parts = [
                  samplers.normal(  # pylint: disable=g-complex-comprehension
                      mean=state_part,
                      stddev=scale_part,
                      shape=ps.shape(state_part),
                      dtype=dtype_util.base_dtype(state_part.dtype),
                      seed=seed_part,
                  )
                  for scale_part, state_part, seed_part in zip(
                      scales, state_parts, part_seeds
                  )
              ]
  
              return next_state_parts
  
      return _fn
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc import metropolis_hastings
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 1 for calling a global function with example usage: random_walk_normal_fn(scale, name) and returns: _fn, next_state_parts