MCPcopy Create free account
hub / github.com/InternScience/SciReason / load_datasets

Function load_datasets

tests/dataset/test_local_datasets.py:94–115  ·  view source on GitHub ↗
(source, conf)

Source from the content-addressed store, hash-verified

92
93
94def load_datasets(source, conf):
95 environ['DATASET_SOURCE'] = source
96 if 'lang' in conf:
97 dataset = conf['type'].load(path=conf['path'], lang=conf['lang'])
98 return dataset
99 if 'setting_name' in conf:
100 dataset = conf['type'].load(path=conf['path'],
101 name=conf['name'],
102 setting_name=conf['setting_name'])
103 return dataset
104 if 'name' in conf:
105 dataset = conf['type'].load(path=conf['path'], name=conf['name'])
106 return dataset
107
108 if 'local_mode' in conf:
109 dataset = conf['type'].load(path=conf['path'], local_mode=conf['local_mode'])
110 return dataset
111 try:
112 dataset = conf['type'].load(path=conf['path'])
113 except Exception:
114 dataset = conf['type'].load(**conf)
115 return dataset
116
117
118def clean_string(value):

Callers 1

compare_datasetsMethod · 0.70

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected