code: def _forbid_inner_transformed_kernel(inner_kernel):
      """Forbids inner kernel from containing `TransformedTransitionKernel`."""
      # TODO(b/169898277): The issue is that the proposed_velocity must be in the
      # same space as the chain state, and TransformedTransitionKernel breaks that
      # invariant.
      while (
          hasattr(inner_kernel, "parameters")
          and "inner_kernel" in inner_kernel.parameters
      ):
          if isinstance(
              inner_kernel,
              transformed_kernel.TransformedTransitionKernel,
          ):
              raise ValueError(
                  "The inner kernel cannot contain a `TransformedTransitionKernel`. "
                  "Please place the `TransformedTransitionKernel` above this kernel "
                  "in the hierarchy (see the docstring example of "
                  "`GradientBasedTrajectoryLengthAdaptation` kernel.)"
              )
          inner_kernel = inner_kernel.parameters["inner_kernel"]
  
imports: import collections
  import functools
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import distribute_lib
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import unnest
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.mcmc import kernel
  from tensorflow_probability.python.mcmc import simple_step_size_adaptation
  from tensorflow_probability.python.mcmc import transformed_kernel
  from tensorflow_probability.python.mcmc.internal import util
  from tensorflow.python.util import nest
label_desc: Use image node_id 12 for calling a global function with example usage: _forbid_inner_transformed_kernel(inner_kernel) without return types