MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / find_keys

Method find_keys

tensorpack/dataflow/format.py:97–106  ·  view source on GitHub ↗
(txn, size)

Source from the content-addressed store, hash-verified

95
96 def _set_keys(self, keys=None):
97 def find_keys(txn, size):
98 logger.warn("Traversing the database to find keys is slow. Your should specify the keys.")
99 keys = []
100 with timed_operation("Loading LMDB keys ...", log_start=True), \
101 get_tqdm(total=size) as pbar:
102 for k in self._txn.cursor():
103 assert k[0] != b'__keys__'
104 keys.append(k[0])
105 pbar.update()
106 return keys
107
108 self.keys = self._txn.get(b'__keys__')
109 if self.keys is not None:

Callers

nothing calls this directly

Calls 4

timed_operationFunction · 0.85
get_tqdmFunction · 0.85
appendMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected