Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def download_data():
directory = input("Where would you like to download MineRL-v0?\n")
if input("(y)es to confirm: ").lower() in ['yes', 'y', 'yeah', 'sure', 'please']:
minerl.data.download(directory=directory)
should_download = True
try:
data = minerl.data.make('MineRLObtainDiamondVectorObf-v0', data_dir=data_dir)
assert len(data._get_all_valid_recordings(data.data_dir)) > 0
should_download = False
except FileNotFoundError:
print("The data directory does not exist in your submission, are you running this script from"
" the root of the repository? data_dir={}".format(data_dir))
except RuntimeError:
print("The data contained in your data directory is out of date! data_dir={}".format(data_dir))
except AssertionError:
print("No MineRLObtainDiamond-v0 data found. Did the data really download correctly?" )
if should_download:
print("Attempting to download the dataset...")
minerl.data.download(data_dir)
print("Data verified! A+!")