U C^@sdZddlmZddlmZddlmZddlmZddlZddl Z ddgiZ dd d gZ Gd d d eZ ddefd dZ ddZddZe jdddkreedd Zeedd ZneZeZdS)z^ Thin wrappers around common functions. Subpackages contain potentially unstable extensions. )tqdm) ObjectWrapper)deepcopyNz github.com/Z casperdcl tenumeratetziptmapc@seZdZdZdddZdS) DummyTqdmFilez'Dummy file-like that will write to tqdmFcCs&t|dkr"tj||j|ddS)Nr)filenolock)lenrstriprwriteZ_wrapped)selfxr r7/tmp/pip-install-6_kvzl1k/tqdm/tqdm/contrib/__init__.pyr szDummyTqdmFile.writeN)F)__name__ __module__ __qualname____doc__r rrrrrsrcKs`z ddl}Wntk r Yn.Xt||jrN|||fd|pD|ji|St||f||S)z Equivalent of `numpy.ndenumerate` or builtin `enumerate`. Parameters ---------- tqdm_class : [default: tqdm.auto.tqdm]. rNtotal)Znumpy ImportError isinstanceZndarrayZ ndenumeratesize enumerate)iterablestartr tqdm_class tqdm_kwargsnprrrrs   cos:t|}|dt}t||f|f|D] }|Vq*dS)zr Equivalent of builtin `zip`. Parameters ---------- tqdm_class : [default: tqdm.auto.tqdm]. rN)rpop tqdm_autozip)Ziter1Z iter2plusrkwargsrirrr_tzip,s r%cost||D]}||Vq dS)zr Equivalent of builtin `map`. Parameters ---------- tqdm_class : [default: tqdm.auto.tqdm]. N)r%)function sequencesrr$rrr_tmap:sr()cOstt||SN)listr%argsr#rrrrGscOstt||Sr+)r,r(r-rrrrKs)rrZ tqdm.autor!Z tqdm.utilsrcopyr functoolssys __author____all__rrr%r( version_infowrapsrrrrrrs&