code: def alternating_epsilons_actor_core(
      policy_network: EpsilonPolicy, epsilons: Sequence[float]
  ) -> DQNPolicy:
      """Returns actor components for alternating epsilon exploration.
  
      Args:
        policy_network: A feedforward action selecting function.
        epsilons: epsilons to alternate per-episode for epsilon-greedy exploration.
  
      Returns:
        A feedforward policy.
      """
      epsilons = jnp.array(epsilons)
  
      def apply_and_sample(
          params: networks_lib.Params,
          observation: networks_lib.Observation,
          state: EpsilonActorState,
      ):
          random_key, key = jax.random.split(state.rng)
          actions = policy_network(
              params, key, observation, state.epsilon
          )  # pytype: disable=wrong-arg-types  # jax-ndarray
          return (
              actions.astype(jnp.int32),
              EpsilonActorState(rng=random_key, epsilon=state.epsilon),
          )
  
      def policy_init(random_key: networks_lib.PRNGKey):
          random_key, key = jax.random.split(random_key)
          epsilon = jax.random.choice(key, epsilons)
          return EpsilonActorState(rng=random_key, epsilon=epsilon)
  
      return actor_core_lib.ActorCore(
          init=policy_init,
          select_action=apply_and_sample,
          get_extras=lambda _: None,
      )
  
file_path: acme/acme/agents/jax/dqn/actor.py
imports: from typing import Callable, Sequence
  from acme.agents.jax import actor_core
  from acme.agents.jax.dqn import networks
  from acme.jax import networks
  from acme.jax import utils
  import chex
  import jax
  import jax.numpy
label_desc: Use image node_id 1 for calling a global function with example usage: alternating_epsilons_actor_core(policy_network, epsilons) and returns: actor_core_lib, actions,  EpsilonActorState, EpsilonActorState