code: def get_experience(
      state: train_state.TrainState,
      simulators: list[agent.RemoteSimulator],
      steps_per_actor: int,
  ):
      """Collect experience from agents.
  
      Runs `steps_per_actor` time steps of the game for each of the `simulators`.
      """
      all_experience = []
      # Range up to steps_per_actor + 1 to get one more value needed for GAE.
      for _ in range(steps_per_actor + 1):
          sim_states = []
          for sim in simulators:
              sim_state = sim.conn.recv()
              sim_states.append(sim_state)
          sim_states = np.concatenate(sim_states, axis=0)
          log_probs, values = agent.policy_action(
              state.apply_fn, state.params, sim_states
          )
          log_probs, values = jax.device_get((log_probs, values))
          probs = np.exp(np.array(log_probs))
          for i, sim in enumerate(simulators):
              probabilities = probs[i]
              action = np.random.choice(probs.shape[1], p=probabilities)
              sim.conn.send(action)
          experiences = []
          for i, sim in enumerate(simulators):
              sim_state, action, reward, done = sim.conn.recv()
              value = values[i, 0]
              log_prob = log_probs[i][action]
              sample = agent.ExpTuple(
                  sim_state, action, reward, value, log_prob, done
              )
              experiences.append(sample)
          all_experience.append(experiences)
      return all_experience
  
imports: import functools
  from typing import Any, Callable
  from absl import logging
  import flax
  from flax import linen
  import agent
  import models
  import test_episodes
  from flax.metrics import tensorboard
  from flax.training import checkpoints
  from flax.training import train_state
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  import optax
label_desc: Use image node_id 4 for calling a global function with example usage: get_experience(state, simulators, steps_per_actor) and returns: all_experience