MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __getitem__

Method __getitem__

SwissArmyTransformer/sat/data_utils/datasets.py:43–48  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

41 return self.length
42
43 def __getitem__(self, idx):
44
45 with self.env.begin(write=False) as txn:
46 key = str(idx).encode('utf-8')
47 row = pickle.loads(txn.get(key))
48 return self.process_fn(row)
49
50class BinaryDataset(Dataset):
51 def __init__(self, path, process_fn, length_per_sample=64+1024+4096, dtype='int32', preload=False, **kwargs):

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
encodeMethod · 0.45

Tested by

no test coverage detected