code: def periodic_update(
      new_tensors: Any,
      old_tensors: Any,
      steps: chex.Array,
      update_period: int,
  ):
      """Periodically switch all elements from a nested struct with new elements."""
      warnings.warn(
          "Rlax periodic_update will be deprecated. Please use optax instead.",
          PendingDeprecationWarning,
          stacklevel=2,
      )
      return conditional_update(
          new_tensors, old_tensors, is_time=steps % update_period == 0
      )
  
imports: from typing import Any
  import warnings
  import chex
  import jax
label_desc: Use image node_id 2 for calling a global function with example usage: periodic_update(new_tensors, old_tensors, steps, update_period) and returns: conditional_update