EmergentTwilight's picture
download
raw
774 Bytes
from vlmeval.utils.dynamic_queue import next_index
class FakeStore:
def __init__(self):
self.values = {}
def add(self, key, increment):
self.values[key] = self.values.get(key, 0) + increment
return self.values[key]
def test_workers_claim_each_query_once_from_one_counter() -> None:
store = FakeStore()
claims = [
next_index(store, "queue", total=5), # worker 0
next_index(store, "queue", total=5), # worker 1
next_index(store, "queue", total=5), # worker 0 finishes first
next_index(store, "queue", total=5), # worker 0 finishes first again
next_index(store, "queue", total=5), # worker 1
next_index(store, "queue", total=5),
]
assert claims == [0, 1, 2, 3, 4, None]

Xet Storage Details

Size:
774 Bytes
·
Xet hash:
a3192cb39564f340d158f1ce0c8fc72539a9758f480fd150eaebc39ee7e3c9df

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.