MCPcopy Create free account
hub / github.com/AnswerDotAI/ModernBERT / __init__

Method __init__

src/sequence_packer.py:493–500  ·  view source on GitHub ↗
(self, iterable: Iterable[T], buffer_size: int)

Source from the content-addressed store, hash-verified

491
492class BufferedIterator(Generic[T]):
493 def __init__(self, iterable: Iterable[T], buffer_size: int):
494 self.iterator = iter(iterable)
495 self.buffer = deque(maxlen=buffer_size)
496 self.buffer_size = buffer_size
497 self.lock = threading.Lock()
498 self.exhausted = False
499 self.filler_thread = threading.Thread(target=self._background_fill, daemon=True)
500 self.filler_thread.start()
501
502 def _background_fill(self):
503 # Fill up the buffer, whenever possible, in the background

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected