/usr/local/lib/python3.6/site-packages/datasets/__pycache__
NameSizeModeActions
arrow_dataset.cpython-36.pyc1898500644editdlrm
arrow_reader.cpython-36.pyc224830644editdlrm
arrow_writer.cpython-36.pyc221100644editdlrm
builder.cpython-36.pyc527790644editdlrm
combine.cpython-36.pyc55080644editdlrm
config.cpython-36.pyc51810644editdlrm
dataset_dict.cpython-36.pyc833190644editdlrm
data_files.cpython-36.pyc301530644editdlrm
fingerprint.cpython-36.pyc189790644editdlrm
info.cpython-36.pyc173590644editdlrm
inspect.cpython-36.pyc185830644editdlrm
iterable_dataset.cpython-36.pyc629320644editdlrm
keyhash.cpython-36.pyc33410644editdlrm
load.cpython-36.pyc629220644editdlrm
metric.cpython-36.pyc232170644editdlrm
naming.cpython-36.pyc25710644editdlrm
search.cpython-36.pyc313390644editdlrm
splits.cpython-36.pyc225220644editdlrm
streaming.cpython-36.pyc41190644editdlrm
table.cpython-36.pyc796120644editdlrm
__init__.cpython-36.pyc22820644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/datasets/__pycache__/streaming.cpython-36.pyc (4119B)
3 <%Eg@sddlZddlZddlmZddlmZmZmZddlm Z m Z m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZddlmZddl m!Z!ee"Z#erdd l$m%Z%deee&e'fd d d Z(d dddZ)dS)N)wraps) TYPE_CHECKINGOptionalUnion) xbasenamexdirname xet_parsexgetsizexglobxisdirxisfilexjoinxlistdirxopenxpandas_read_csvxpandas_read_excelxPathxrelpath xsio_loadmatxsplit xsplitextxwalkxxml_dom_minidom_parse) get_logger)patch_submodule) get_imports)DatasetBuilder)use_auth_tokencstj|}t|dr|jrdSfdd}t|d|tjt|d|tjt|d|tjt|d|t jt|d t jt|d t jt|d t jt|d t jt|d tjt|dtjt|d|tjt|d|tjt|d|tjt|dtjt|d|tdgdjt|dtdgdjt|d|tdgdjt|d|tjt|d|tjd|_dS)a Extend the module to support streaming. We patch some functions in the module to use `fsspec` to support data streaming: - We use `fsspec.open` to open and read remote files. We patch the module function: - `open` - We use the "::" hop separator to join paths and navigate remote compressed/archive files. We patch the module functions: - `os.path.join` - `pathlib.Path.joinpath` and `pathlib.Path.__truediv__` (called when using the "/" operator) The patched functions are replaced with custom functions defined to work with the :class:`~download.streaming_download_manager.StreamingDownloadManager`. Args: module_path: Path to the module to be extended. use_auth_token: Whether to use authentication token. _patched_for_streamingNcs tfdd}d|_|S)Ncs|di|S)Nr)argskwargs)functionrr .wrap_auth..wrapper wrap_auth)rZ_decorator_name_)r#r%)r)r#r$r&@sz.extend_module_for_streaming..wrap_authopenz os.listdirzos.walkz glob.globz os.path.joinzos.path.dirnamezos.path.basenamezos.path.relpathz os.path.splitzos.path.splitextz os.path.isdirzos.path.isfilezos.path.getsizez pathlib.Pathzpandas.read_csv __version__)attrszpandas.read_excelzscipy.io.loadmatzxml.etree.ElementTree.parsezxml.dom.minidom.parseT) importlib import_modulehasattrrrrstartrrr rrrrrrr r r rrrrr r) module_pathrmoduler&r )rr$extend_module_for_streaming's0  r0r)buildercCs|t|j|jd|jjdsxxZttj|jD]F}|ddkr.|d}dj|jj ddd|g}t||jdq.WdS) a{Extend the dataset builder module and the modules imported by it to support streaming. Args: builder (:class:`DatasetBuilder`): Dataset builder instance. use_auth_token (``str`` or :obj:`bool`, optional): Optional string or boolean to use as Bearer token for remote files on the Datasets Hub. If True, will get token from `"~/.huggingface"`. )rz datasets.rZinternalr.N) r0 __module__r startswithrinspectgetfile __class__joinsplit)r1ZimportsZinternal_import_nameZinternal_module_namer r r$$extend_dataset_builder_for_streamingbs    r;)N)*r*r6 functoolsrtypingrrrZ#download.streaming_download_managerrrr r r r r rrrrrrrrrrrrZ utils.loggingrZutils.patchingrZutils.py_utilsr__name__loggerr1rstrboolr0r;r r r r$s T    ;