class_docstr: This buffer adds replayed samples to a stream of new experiences.
  
  - Any newly added batch (`add()`) is immediately returned upon
  the next `sample` call (close to on-policy) as well as being moved
  into the buffer.
  - Additionally, a certain number of old samples is mixed into the
  returned sample according to a given "replay ratio".
  - If >1 calls to `add()` are made without any `sample()` calls
  in between, all newly added batches are returned (plus some older samples
  according to the "replay ratio").
  
  .. testcode::
      :skipif: True
  
      # replay ratio 0.66 (2/3 replayed, 1/3 new samples):
      buffer = MultiAgentMixInReplayBuffer(capacity=100,
                                           replay_ratio=0.66)
      buffer.add(<A>)
      buffer.add(<B>)
      buffer.sample(1)
  
  .. testoutput::
  
      ..[<A>, <B>, <B>]
  
  .. testcode::
      :skipif: True
  
      buffer.add(<C>)
      buffer.sample(1)
  
  .. testoutput::
  
      [<C>, <A>, <B>]
      or: [<C>, <A>, <A>], [<C>, <B>, <A>] or [<C>, <B>, <B>],
      but always <C> as it is the newest sample
  
  .. testcode::
      :skipif: True
  
      buffer.add(<D>)
      buffer.sample(1)
  
  .. testoutput::
  
      [<D>, <A>, <C>]
      or [<D>, <A>, <A>], [<D>, <B>, <A>] or [<D>, <B>, <C>], etc..
      but always <D> as it is the newest sample
  
  .. testcode::
      :skipif: True
  
      # replay proportion 0.0 -> replay disabled:
      buffer = MixInReplay(capacity=100, replay_ratio=0.0)
      buffer.add(<A>)
      buffer.sample()
  
  .. testoutput::
  
      [<A>]
  
  .. testcode::
      :skipif: True
  
      buffer.add(<B>)
      buffer.sample()
  
  .. testoutput::
  
      [<B>]
class_docstr_tok: ["This","buffer","adds","replayed","samples","to","a","stream","of","new","experiences",".","-","Any","newly","added","batch","(","`","add","(",")","`",")","is","immediately","returned","upon","the","next","`","sample","`","call","(","close","to","on-policy",")","as","well","as","being","moved","into","the","buffer",".","-","Additionally",",","a","certain","number","of","old","samples","is","mixed","into","the","returned","sample","according","to","a","given","``","replay","ratio","''",".","-","If",">","1","calls","to","`","add","(",")","`","are","made","without","any","`","sample","(",")","`","calls","in","between",",","all","newly","added","batches","are","returned","(","plus","some","older","samples","according","to","the","``","replay","ratio","''",")",".","..","testcode",":",":",":","skipif",":","True","#","replay","ratio","0.66","(","2\/3","replayed",",","1\/3","new","samples",")",":","buffer","=","MultiAgentMixInReplayBuffer","(","capacity=100",",","replay_ratio=0.66",")","buffer.add","(","<","A",">",")","buffer.add","(","<","B",">",")","buffer.sample","(","1",")","..","testoutput",":",":","..","[","<","A",">",",","<","B",">",",","<","B",">","]","..","testcode",":",":",":","skipif",":","True","buffer.add","(","<","C",">",")","buffer.sample","(","1",")","..","testoutput",":",":","[","<","C",">",",","<","A",">",",","<","B",">","]","or",":","[","<","C",">",",","<","A",">",",","<","A",">","]",",","[","<","C",">",",","<","B",">",",","<","A",">","]","or","[","<","C",">",",","<","B",">",",","<","B",">","]",",","but","always","<","C",">","as","it","is","the","newest","sample","..","testcode",":",":",":","skipif",":","True","buffer.add","(","<","D",">",")","buffer.sample","(","1",")","..","testoutput",":",":","[","<","D",">",",","<","A",">",",","<","C",">","]","or","[","<","D",">",",","<","A",">",",","<","A",">","]",",","[","<","D",">",",","<","B",">",",","<","A",">","]","or","[","<","D",">",",","<","B",">",",","<","C",">","]",",","etc","..","but","always","<","D",">","as","it","is","the","newest","sample","..","testcode",":",":",":","skipif",":","True","#","replay","proportion","0.0","-",">","replay","disabled",":","buffer","=","MixInReplay","(","capacity=100",",","replay_ratio=0.0",")","buffer.add","(","<","A",">",")","buffer.sample","(",")","..","testoutput",":",":","[","<","A",">","]","..","testcode",":",":",":","skipif",":","True","buffer.add","(","<","B",">",")","buffer.sample","(",")","..","testoutput",":",":","[","<","B",">","]"]
docstr: Returns all local state.
  
  Returns:
      The serializable local state.
docstr_tok: ["Returns","all","local","state",".","Returns",":","The","serializable","local","state","."]
code: def get_state(self) -> Dict[str, Any]:
      """Returns all local state.
  
      Returns:
          The serializable local state.
      """
      data = {
          "last_added_batches": self.last_added_batches,
      }
      parent = MultiAgentPrioritizedReplayBuffer.get_state(self)
      parent.update(data)
      return parent
  
imports: import collections
  import logging
  import random
  from typing import Any, Dict, Optional
  import numpy
  from ray.rllib.policy.rnn_sequencing import timeslice_along_seq_lens_with_overlap
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID, SampleBatch, concat_samples_into_ma_batch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.replay_buffers.multi_agent_prioritized_replay_buffer import MultiAgentPrioritizedReplayBuffer
  from ray.rllib.utils.replay_buffers.multi_agent_replay_buffer import MultiAgentReplayBuffer, ReplayMode, merge_dicts_with_warning
  from ray.rllib.utils.replay_buffers.replay_buffer import _ALL_POLICIES, StorageUnit
  from ray.rllib.utils.typing import PolicyID, SampleBatchType
  from ray.util.annotations import DeveloperAPI
  from ray.util.debug import log_once
label_desc: Use image node_id 4 for calling the MultiAgentMixInReplayBuffer obj's underlying member method code with example usage: obj.get_state() and returns: parent