code: def make_transform_fn(bijector, direction):
      """Makes a function which applies a list of Bijectors' `forward`s."""
      if not mcmc_util.is_list_like(bijector):
          dtype = getattr(bijector, "{}_dtype".format(direction))()
          if mcmc_util.is_list_like(dtype):
              return getattr(bijector, direction)
          elif tf.nest.is_nested(dtype):
              raise ValueError(
                  "Only list-like multi-part bijectors are currently supported, but "
                  "got {}.".format(
                      tf.nest.map_structure(lambda _: ".", dtype)
                  )
              )
          bijector = [bijector]
  
      def fn(state_parts):
          if len(bijector) != len(state_parts):
              raise ValueError(
                  "State has {} parts, but bijector has {}.".format(
                      len(state_parts), len(bijector)
                  )
              )
          transformed_parts = [
              getattr(b, direction)(sp)
              for b, sp in zip(bijector, state_parts)
          ]
          return tf.nest.pack_sequence_as(
              state_parts, transformed_parts
          )
  
      return fn
  
imports: import collections
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc.internal import util
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 2 for calling a global function with example usage: make_transform_fn(bijector, direction) and returns: fn, tf, getattr