class_docstr: Stores multi-agent episode data.
  
  The central attribute of the class is the timestep mapping
  `global_t_to_local_t` that maps the global (environment)
  timestep to the local (agent) timesteps.
  
  The `MultiAgentEpisode` is based on the `SingleAgentEpisode`s
  for each agent, stored in `MultiAgentEpisode.agent_episodes`.
class_docstr_tok: ["Stores","multi-agent","episode","data",".","The","central","attribute","of","the","class","is","the","timestep","mapping","`","global_t_to_local_t","`","that","maps","the","global","(","environment",")","timestep","to","the","local","(","agent",")","timesteps",".","The","`","MultiAgentEpisode","`","is","based","on","the","`","SingleAgentEpisode","`","s","for","each","agent",",","stored","in","`","MultiAgentEpisode.agent_episodes","`","."]
docstr: Creates a multi-agent episode from a state dictionary.
  
  See `MultiAgentEpisode.get_state()` for creating a state for
  a `MultiAgentEpisode` pickable state. For recreating a
  `MultiAgentEpisode` from a state, this state has to be complete,
  i.e. all data must have been stored in the state.
code: def from_state(state) -> None:
      """Creates a multi-agent episode from a state dictionary.
  
      See `MultiAgentEpisode.get_state()` for creating a state for
      a `MultiAgentEpisode` pickable state. For recreating a
      `MultiAgentEpisode` from a state, this state has to be complete,
      i.e. all data must have been stored in the state.
      """
      # TODO (simon): Add the buffers.
      episode = MultiAgentEpisode(id=state[0][1])
      episode._agent_ids = state[1][1]
      episode.global_t_to_local_t = state[2][1]
      episode.global_actions_t = state[3][1]
      episode.partial_rewards_t = state[4][1]
      episode.partial_rewards = state[5][1]
      episode.agent_episodes = {
          agent_id: SingleAgentEpisode.from_state(agent_state)
          for agent_id, agent_state in state[6][1]
      }
      episode.t_started = state[7][1]
      episode.t = state[8][1]
      episode.ts_carriage_return = state[9][1]
      episode.is_terminated = state[10][1]
      episode.is_trcunated = state[11][1]
      return episode
  
imports: from collections import defaultdict
  from queue import Queue
  from typing import Any, Dict, List, Optional, Set, Union
  import uuid
  import numpy
  from ray.rllib.env.single_agent_episode import SingleAgentEpisode
  from ray.rllib.policy.sample_batch import MultiAgentBatch
  from ray.rllib.utils.typing import MultiAgentDict
label_desc: Use image node_id 16 for calling the MultiAgentEpisode obj's underlying member method code with example usage: obj.from_state(state) and returns: episode