code: def default_trajectory_length_sample(
      trajectory_length_params: DefaultTrajectoryLengthParams,
      step: fun_mc.IntArray,
      seed: Any,
  ) -> fun_mc.FloatArray:
      """Samples a trajectory length.
  
      The trajectory length is sampled from `[0, 2 * mean_trajectory_length]`. The
      stochasticity is derived from a Halton sequence keyed by the `step`. The
      `seed` is ignored.
  
      Args:
        trajectory_length_params: `DefaultTrajectoryLengthParams`.
        step: Current chain step.
        seed: PRNG seed. Ignored.
  
      Returns:
        trajectory_length: Sampled trajectory.
      """
      del seed
      mean_trajectory_length = jnp.exp(
          fun_mc.clip_grads(
              trajectory_length_params.log_mean_trajectory_length, 1.0
          )
      )
      trajectory_length = (
          2
          * _halton(jnp.asarray(step, mean_trajectory_length.dtype))
          * mean_trajectory_length
      )
      return trajectory_length
  
imports: from collections.abc import Mapping
  from typing import Any, Callable, NamedTuple, Optional
  import immutabledict
  from fun_mc import backend
  from fun_mc import fun_mc_lib
label_desc: Use image node_id 5 for calling a global function with example usage: default_trajectory_length_sample(trajectory_length_params, step, seed) and returns: trajectory_length