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: Writes values from one buffer to another.
code: def _copy_buffer(self, episode: "MultiAgentEpisode") -> None:
      """Writes values from one buffer to another."""
  
      for agent_id, agent_buffer in episode.agent_buffers.items():
          for buffer_name, buffer in agent_buffer.items():
              # If the buffer is full write over the values.
              if buffer.full():
                  # Get the item from them buffer.
                  item = buffer.get_nowait()
                  # Flush the destination buffer, if it is full.
                  if self.agent_buffers[agent_id][buffer_name].full():
                      self.agent_buffers[agent_id][
                          buffer_name
                      ].get_nowait()
                  # Write it to the destination buffer.
                  self.agent_buffers[agent_id][buffer_name].put_nowait(
                      item
                  )
                  # The source buffer might still need the item.
                  buffer.put_nowait(item)
              # If the buffer is empty, empty the destination buffer.
              else:
                  if self.agent_buffers[agent_id][buffer_name].full():
                      self.agent_buffers[agent_id][
                          buffer_name
                      ].get_nowait()
  
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 26 for calling the MultiAgentEpisode obj's underlying member method code with example usage: obj._copy_buffer(episode) without return types