MCPcopy Create free account
hub / github.com/imrahulr/hat / _setup

Function _setup

core/setup.py:17–29  ·  view source on GitHub ↗
(data_dir, name='train')

Source from the content-addressed store, hash-verified

15 return 1
16
17def _setup(data_dir, name='train'):
18 dataset = os.path.basename(os.path.normpath(data_dir))
19 data_file = os.path.join(data_dir, f'{name}.zip')
20 tmp_dir = os.path.join(os.environ['TMPDIR'], dataset)
21
22 if not os.path.isdir(tmp_dir):
23 os.makedirs(tmp_dir, exist_ok=True)
24 copy(data_file, tmp_dir)
25 if name in ['train']:
26 extract_zip(os.path.join(tmp_dir, f'{name}.zip'), os.path.join(tmp_dir, name))
27 else:
28 extract_zip(os.path.join(tmp_dir, f'{name}.zip'), tmp_dir)
29 os.remove(os.path.join(tmp_dir, f'{name}.zip'))
30
31
32def setup_train(data_dir):

Callers 2

setup_trainFunction · 0.85
setup_valFunction · 0.85

Calls 2

copyFunction · 0.85
extract_zipFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…