/usr/local/lib/python3.6/site-packages/datasets/commands/__pycache__
NameSizeModeActions
convert.cpython-36.pyc61750644editdlrm
datasets_cli.cpython-36.pyc15490644editdlrm
dummy_data.cpython-36.pyc157450644editdlrm
env.cpython-36.pyc16880644editdlrm
run_beam.cpython-36.pyc45890644editdlrm
test.cpython-36.pyc51220644editdlrm
__init__.cpython-36.pyc7780644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/datasets/commands/__pycache__/test.cpython-36.pyc (5122B)
3 <%Egã@s¸ddlZddlmZddlmZddlmZmZddlm Z ddl Z ddl m Z ddlmZddlmZdd lmZmZdd lmZdd lmZmZeeƒZd d „ZGdd„deƒZdS)éN)ÚArgumentParser)ÚPath)ÚcopyfileÚrmtree)Ú Generator)ÚDatasetBuilder)ÚBaseDatasetsCLICommand)Ú DownloadMode)Údataset_module_factoryÚimport_main_class)Úlogger)ÚERRORÚ get_loggerc Cs*t|j|j|j|j|j|j|j|j|j ƒ S)N) Ú TestCommandÚdatasetÚnameÚ cache_dirÚdata_dirÚ all_configsÚ save_infosÚignore_verificationsÚforce_redownloadÚ clear_cache)Úargs©rú@/usr/local/lib/python3.6/site-packages/datasets/commands/test.pyÚ_test_command_factorysrc @sHeZdZdZeedœdd„ƒZeeeeeeeeedœ dd„Z dd „Z d S) rF)ÚparsercCs´|jddd}|jdtddd|jdtddd|jd tdd d|jd d d d|jdd dd|jdd dd|jdd dd|jdd dd|jdtdd|jtddS)NÚtestzTest dataset implementation.)Úhelpz--namezDataset processing name)ÚtypeÚdefaultrz --cache_dirz.Cache directory where the datasets are stored.z --data_dirz@Can be used to specify a manual directory to get the files from.z --all_configsÚ store_truezTest all dataset configurations)Úactionrz --save_infoszSave the dataset infos filez--ignore_verificationsz0Run the test without checksums and splits checksz--force_redownloadzForce dataset redownloadz --clear_cachezBRemove downloaded files and cached datasets after each config testrzName of the dataset to download)r r)Úfunc)Ú add_parserÚ add_argumentÚstrÚ set_defaultsr)rZ test_parserrrrÚregister_subcommand$s. zTestCommand.register_subcommand) rrrrrrrrrc Cs^||_||_||_||_||_||_||_||_| |_| rP| rPt dƒt dƒ|rZd|_dS)Na When --clear_cache is used, specifying a cache directory is mandatory. The 'download' folder of the cache directory and the dataset builder cache will be deleted after each configuration test. Please provide a --cache_dir that will be used to test the dataset script.éT) Ú_datasetÚ_nameÚ _cache_dirÚ _data_dirÚ _all_configsÚ _save_infosÚ_ignore_verificationsÚ_force_redownloadÚ _clear_cacheÚprintÚexit) ÚselfrrrrrrrrrrrrÚ__init__Bs  zTestCommand.__init__c s@tƒjtƒˆjdk r,ˆjr,tdƒtdƒˆjˆj}‰t|ƒ‰t ˆj ƒ‰ˆjrbˆj rbt ˆj ƒnd}t tddfdœ‡‡‡‡fdd„ }x¨t|ƒƒD]˜\}}td|jj›d|d›d|›d ƒd |_|jˆjsÚtjntjˆjd d |jƒˆjr|jƒˆjrÆtjjˆjƒtjj ƒ}t!|ƒjd }tjj||ƒ}tjj"|ƒrXtjj#|ƒ} n:tjj"|ƒrl|} n&tjj$|ƒr€|} nd} td|›ƒ| dk rÆtjj| tjj ƒ} t%|| ƒtd| ›ƒˆj&r–tjj$|j'ƒrøt(j)d|j'›ƒt*|j'ƒtjjˆj'tjj+ƒ} tjj$| ƒr–t(j)d| ›ƒt*| ƒq–WtdƒdS)NzABoth parameters `config` and `all_configs` can't be used at once.r*)Úreturnc3s¸ˆjrnˆjrnx¦tˆjƒD]P\}}dˆjkrHˆfˆjˆjdœˆj—ŽVqˆf|jˆjˆjdœˆj—ŽVqWnFdˆjkr–ˆfˆjˆjdœˆj—ŽVnˆfˆˆjˆjdœˆj—ŽVdS)NÚ config_name)rr)r9rr)r/ÚBUILDER_CONFIGSÚ enumerateZbuilder_kwargsr-r.r)ÚiÚconfig)Ú builder_clsr9Úmoduler6rrÚ get_buildersks&   z%TestCommand.run..get_builderszTesting builder 'z' (ú/ú)TF)Z download_moderZtry_from_hf_gcsz.pyzDataset Infos file saved at zClearing cache at zTest successful.),Ú fl_loggerÚsetLevelr r,r/r4r5r+r r Ú module_pathr:Úlenrrr;r=rZ _record_infosZdownload_and_preparer2r ZREUSE_CACHE_IF_EXISTSZFORCE_REDOWNLOADr1Z as_datasetr0ÚosÚpathÚjoinZget_imported_module_dirÚdatasetsZDATASETDICT_INFOS_FILENAMErÚisfileÚdirnameÚisdirrr3r-r ÚwarningrZDOWNLOADED_DATASETS_DIR) r6rHZ n_buildersr@ÚjZbuilderZdataset_infos_pathrZ combined_pathZ dataset_dirZuser_dataset_infos_pathÚ download_dirr)r>r9r?r6rÚrunas\  "$      zTestCommand.runN) Ú__name__Ú __module__Ú __qualname__Z__test__Ú staticmethodrr)r'Úboolr7rQrrrrr!sr)rGÚargparserÚpathlibrÚshutilrrÚtypingrZdatasets.configrJZdatasets.builderrZdatasets.commandsrZ"datasets.download.download_managerr Z datasets.loadr r Zdatasets.utils.filelockr rCZdatasets.utils.loggingr rrRrrrrrrÚs