/usr/local/lib/python3.6/site-packages/datasets/utils/__pycache__
NameSizeModeActions
beam_utils.cpython-36.pyc20170644editdlrm
deprecation_utils.cpython-36.pyc33470644editdlrm
doc_utils.cpython-36.pyc6540644editdlrm
download_manager.cpython-36.pyc1560644editdlrm
extract.cpython-36.pyc108680644editdlrm
filelock.cpython-36.pyc104840644editdlrm
file_utils.cpython-36.pyc179040644editdlrm
info_utils.cpython-36.pyc45360644editdlrm
logging.cpython-36.pyc72580644editdlrm
metadata.cpython-36.pyc179400644editdlrm
patching.cpython-36.pyc34380644editdlrm
py_utils.cpython-36.pyc263160644editdlrm
readme.cpython-36.pyc89000644editdlrm
stratify.cpython-36.pyc31290644editdlrm
tf_utils.cpython-36.pyc18000644editdlrm
typing.cpython-36.pyc3550644editdlrm
version.cpython-36.pyc45390644editdlrm
_hf_hub_fixes.cpython-36.pyc32630644editdlrm
__init__.cpython-36.pyc3810644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/datasets/utils/__pycache__/filelock.cpython-36.pyc (10484B)
3 <%Eg5&@sldZddlZddlZddlZddlZy ddlZWnek rHdZYnXy ddlZWnek rndZYnXy ddlZWnek rdZYnXye Wne k re Z YnXddddddgZ d Z dad d ZGd dde ZGd ddZGdddZGdddeZGdddeZGdddeZdZerDeZn$erPeZneZedk rhejddS)zD A platform independent file lock that supports the with-statement. NTimeout BaseFileLockWindowsFileLock UnixFileLock SoftFileLockFileLockz3.0.12cCstp tjtatS)z0Returns the logger instance used in this module.)_loggerlogging getLogger__name__r r A/usr/local/lib/python3.6/site-packages/datasets/utils/filelock.pyloggerPsrc@s eZdZdZddZddZdS)rzN Raised when the lock could not be acquired in *timeout* seconds. cCs ||_dS) N) lock_file)selfrr r r __init___szTimeout.__init__cCsd|jd}|S)NzThe file lock 'z' could not be acquired.)r)rtempr r r __str__eszTimeout.__str__N)r __module__ __qualname____doc__rrr r r r rYsc@s$eZdZddZddZddZdS)_Acquire_ReturnProxycCs ||_dS)N)lock)rrr r r rvsz_Acquire_ReturnProxy.__init__cCs|jS)N)r)rr r r __enter__zsz_Acquire_ReturnProxy.__enter__cCs|jjdS)N)rrelease)rexc_type exc_value tracebackr r r __exit__}s z_Acquire_ReturnProxy.__exit__N)r rrrrrr r r r rusrc@seZdZdZd!ddZeddZedd Zejd d Zd d Z d dZ eddZ d"ddZ d#ddZ ddZddZddZeeedddZdS)$rz3 Implements the base class of a file lock. NcCsB|dk r |nd}|j||}||_d|_||_tj|_d|_dS)rNr)hash_filename_if_too_long _lock_file _lock_file_fdtimeout threadingLock _thread_lock _lock_counter)rrr%max_filename_lengthr r r rs  zBaseFileLock.__init__cCs|jS)z, The path to the lock file. )r#)rr r r rszBaseFileLock.lock_filecCs|jS)a} You can set a default timeout for the filelock. It will be used as fallback value in the acquire method, if no timeout value (*None*) is given. If you want to disable the timeout, set it to a negative value. A timeout of 0 means, that there is exactly one attempt to acquire the file lock. *New in version 2.0.0* )_timeout)rr r r r%szBaseFileLock.timeoutcCst||_dS)rN)floatr+)rvaluer r r r%s cCs tdS)z Platform dependent. If the file lock could be acquired, self._lock_file_fd holds the file descriptor of the lock file. N)NotImplementedError)rr r r _acquireszBaseFileLock._acquirecCs tdS)zH Releases the lock and sets self._lock_file_fd to None. N)r.)rr r r _releaseszBaseFileLock._releasecCs |jdk S)z{ True, if the object holds the file lock. This was previously a method and is now a property. N)r$)rr r r is_lockedszBaseFileLock.is_locked皙?cCsL|dkr|j}|j|jd7_WdQRXt|}|j}tj}yx|j,|jsvtjd|d||j WdQRX|jrtjd|d|PqH|dkrtj||krtjd|d|t |jqHtjd|d |d |d tj |qHWWn2|jt d|jd|_WdQRXYnXt |d S) a  Acquires the file lock or fails with a :exc:`Timeout` error. ```py # You can use this method in the context manager (recommended) with lock.acquire(): pass # Or use an equivalent try-finally construct: lock.acquire() try: pass finally: lock.release() ``` :arg float timeout: The maximum time waited for the file lock. If ``timeout < 0``, there is no timeout and this method will block until the lock could be acquired. If ``timeout`` is None, the default :attr:`~timeout` is used. :arg float poll_intervall: We check once in *poll_intervall* seconds if we can acquire the file lock. :raises Timeout: if the lock could not be acquired in *timeout* seconds. This method returns now a *proxy* object instead of *self*, so that it can be used in a with statement without side effects. Nr zAttempting to acquire lock z on zLock z acquired on rzTimeout on acquiring lock z not acquired on z , waiting z seconds ...)r)r%r(r)idr#timer1rdebugr/rsleepmaxr)rr%Zpoll_intervalllock_id lock_filename start_timer r r acquires6" zBaseFileLock.acquireFc Cs|jt|jrv|jd8_|jdks*|rvt|}|j}tjd|d||jd|_tjd|d|WdQRXdS)aV Releases the file lock. Please note, that the lock is only completly released, if the lock counter is 0. Also note, that the lock file itself is not automatically deleted. :arg bool force: If true, the lock counter is ignored and the lock is released in every case. r rzAttempting to release lock z on zLock z released on N)r(r1r)r3r#rr5r0)rforcer8r9r r r r"s "zBaseFileLock.releasecCs |j|S)N)r;)rr r r r?szBaseFileLock.__enter__cCs |jdS)N)r)rrrrr r r rCszBaseFileLock.__exit__cCs|jdddS)NT)r<)r)rr r r __del__Gs zBaseFileLock.__del__)path max_lengthreturncCsrtjj|}t||krj|dkrjtjj|}tt|}|d|t|dd|d}tjj||S|SdS)Nrz...z.lock)osr>basenamelendirnamestrhashjoin)rr>r?filenamerEZhashed_filenameZ new_filenamer r r r"Ks   $z&BaseFileLock.hash_filename_if_too_long)rJN)Nr2)F)r rrrrpropertyrr%setterr/r0r1r;rrrr=rFintr"r r r r rs     G cs2eZdZdZd fdd ZddZdd ZZS) rze Uses the :func:`msvcrt.locking` function to hard lock the lock file on windows systems. r Ncs2ddlm}tj|||dd||j|_dS)Nr )relative_to_absolute_path)r%r*z\\?\)Z file_utilsrNsuperrrr#)rrr%r*rN) __class__r r r`s zWindowsFileLock.__init__cCsxtjtjBtjB}ytj|j|}Wntk r8YnrE f_namemaxrOr)rrr%r*)rPr r rszUnixFileLock.__init__c CsbtjtjBtjB}tj|j|}ytj|tjtj BWnt k rVtj |YnX||_ dS)N) rBrQrRrSrTr#fcntlflockZLOCK_EXZLOCK_NBrUrXr$)rrYrZr r r r/szUnixFileLock._acquirecCs(|j}d|_tj|tjtj|dS)N)r$r_r`ZLOCK_UNrBrX)rrZr r r r0s  zUnixFileLock._releaserJ)rJN)r rrrrr/r0r\r r )rPr rs c@s eZdZdZddZddZdS)rz8 Simply watches the existence of the lock file. c CsJtjtjBtjBtjB}ytj|j|}Wntk r>YnX||_dS)N) rBO_WRONLYrRO_EXCLrSrTr#rUr$)rrYrZr r r r/szSoftFileLock._acquirec Cs<tj|jd|_ytj|jWntk r6YnXdS)N)rBrXr$r[r#rU)rr r r r0s zSoftFileLock._releaseN)r rrrr/r0r r r r rs z only soft file lock is available)rr rBr&r4warnings ImportErrorrVr_ TimeoutError NameErrorrU__all__ __version__rrrrrrrrrwarnr r r r sX         Y/%!