MCPcopy Create free account
hub / github.com/deepdrive/deepdrive / has_stuff

Function has_stuff

utils.py:197–207  ·  view source on GitHub ↗
(path, warn_existing=False, overwrite=False)

Source from the content-addressed store, hash-verified

195
196
197def has_stuff(path, warn_existing=False, overwrite=False):
198 if os.path.exists(path) and (dir_has_stuff(path) or file_has_stuff(path)):
199 if warn_existing:
200 print('%s exists, do you want to re-download and overwrite the existing files (y/n)?' % path, end=' ')
201 overwrite = input()
202 if 'n' in overwrite.lower():
203 print('USING EXISTING %s - Try rerunning and overwriting if you run into problems.' % path)
204 return True
205 elif not overwrite:
206 return True
207 return False
208
209
210def ensure_executable(path):

Callers 2

init_fnFunction · 0.90
downloadFunction · 0.85

Calls 2

dir_has_stuffFunction · 0.85
file_has_stuffFunction · 0.85

Tested by

no test coverage detected