code: def augment_observation_fn_with_parameters(
      parameterized_observation_fn, parameter_constraining_bijector
  ):
      """Augments an observation fn to take `ParametersAndState` namedtuples."""
  
      def observation_from_params_and_state_fn(
          step, params_and_state, **kwargs
      ):
          # Extract the state, to pass through to the observation fn.
          unconstrained_parameters, state = params_and_state
          if "state_history" in kwargs:
              _, kwargs["state_history"] = kwargs["state_history"]
  
          return parameterized_observation_fn(
              step,
              state,
              parameters=parameter_constraining_bijector.forward(
                  unconstrained_parameters
              ),
              **kwargs,
          )
  
      return observation_from_params_and_state_fn
  
imports: import collections
  import contextlib
  import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import joint_distribution_named
  from tensorflow_probability.python.distributions import joint_distribution_sequential
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.experimental.mcmc.particle_filter import infer_trajectories
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 4 for calling a global function with example usage: augment_observation_fn_with_parameters(parameterized_observation_fn, parameter_constraining_bijector) and returns: observation_from_params_and_state_fn, parameterized_observation_fn