class_docstr: Ring buffer of recent data batches for minibatch SGD.
  
  This is for use with AsyncSamplesOptimizer.
class_docstr_tok: ["Ring","buffer","of","recent","data","batches","for","minibatch","SGD",".","This","is","for","use","with","AsyncSamplesOptimizer","."]
docstr: Get a new batch from the internal ring buffer.
  
  Returns:
     buf: Data item saved from inqueue.
     released: True if the item is now removed from the ring buffer.
docstr_tok: ["Get","a","new","batch","from","the","internal","ring","buffer",".","Returns",":","buf",":","Data","item","saved","from","inqueue",".","released",":","True","if","the","item","is","now","removed","from","the","ring","buffer","."]
code: def get(self) -> Tuple[Any, bool]:
      """Get a new batch from the internal ring buffer.
  
      Returns:
         buf: Data item saved from inqueue.
         released: True if the item is now removed from the ring buffer.
      """
      if self.ttl[self.idx] <= 0:
          self.buffers[self.idx] = self.inqueue.get(
              timeout=self.timeout
          )
          self.ttl[self.idx] = self.cur_initial_ttl
          if self.cur_initial_ttl < self.max_initial_ttl:
              self.cur_initial_ttl += 1
      buf = self.buffers[self.idx]
      self.ttl[self.idx] -= 1
      released = self.ttl[self.idx] <= 0
      if released:
          self.buffers[self.idx] = None
      self.idx = (self.idx + 1) % len(self.buffers)
      return buf, released
  
imports: from typing import Any, Tuple
  import queue
label_desc: Use image node_id 2 for calling the MinibatchBuffer obj's underlying member method code with example usage: obj.get() and returns: buf,  released