def download_data(dataset_name=None, prompt=prompt_stdin):
dr = data_resources[dataset_name]<EOL>if not authorize_download(dataset_name, prompt=prompt):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if '<STR_LIT>' in dr:<EOL><INDENT>for url, files, suffices in zip(dr['<STR_LIT>'], dr['<STR_LIT>'], dr['<STR_LIT>']):<EOL><INDENT>for file, suffix in zip(files, suffices):<EOL><INDENT>download_url(url=os.path.join(url,file),<EOL>dir_name = data_path,<EOL>store_directory=dataset_name,<EOL>suffix=suffix)<EOL><DEDENT><DEDENT><DEDENT>elif '<STR_LIT>' in dr:<EOL><INDENT>for url, dirs, files in zip(dr['<STR_LIT>'], dr['<STR_LIT>'], dr['<STR_LIT>']):<EOL><INDENT>for file, dir in zip(files, dirs):<EOL><INDENT>print(file, dir)<EOL>download_url(<EOL>url=os.path.join(url,dir,file),<EOL>dir_name = data_path,<EOL>store_directory=os.path.join(dataset_name,dir)<EOL>)<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>for url, files in zip(dr['<STR_LIT>'], dr['<STR_LIT>']):<EOL><INDENT>for file in files:<EOL><INDENT>download_url(<EOL>url=os.path.join(url,file),<EOL>dir_name = data_path,<EOL>store_directory=dataset_name<EOL>)<EOL><DEDENT><DEDENT><DEDENT>return True<EOL>
Check with the user that the are happy with terms and conditions for the data set, then download it.