code: def enable_store_parameters_in_results(kernel):
      """Enables the `store_parameters_in_results` parameter in a chain of kernels.
  
      This is a temporary utility for use during the transition period of the
      parameter storage methods.
  
      Args:
        kernel: A TransitionKernel.
  
      Returns:
        kernel: The same kernel, but recreated with `store_parameters_in_results`
            recursively set to `True` in its parameters and its inner kernels (as
            appropriate).
      """
      kernel_stack = []
      while (
          hasattr(kernel, "parameters")
          and "inner_kernel" in kernel.parameters
      ):
          kernel_stack.append(kernel)
          kernel = kernel.parameters["inner_kernel"]
  
      def _recreate_kernel(kernel, parameters):
          new_parameters = kernel.parameters.copy()
          new_parameters.update(parameters)
          if "store_parameters_in_results" in new_parameters:
              new_parameters["store_parameters_in_results"] = True
          with deprecation.silence():
              return type(kernel)(**new_parameters)
  
      if hasattr(kernel, "parameters"):
          kernel = _recreate_kernel(kernel, {})
  
      for outer_kernel in reversed(kernel_stack):
          outer_kernel = _recreate_kernel(
              outer_kernel, {"inner_kernel": kernel}
          )
          kernel = outer_kernel
  
      return kernel
  
imports: import warnings
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.math.gradient import value_and_gradient
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 15 for calling a global function with example usage: enable_store_parameters_in_results(kernel) and returns: kernel, type