L iJdZddlZddlZddlZddlmZddlmZGddZGddeZ ddl Z dd Z ejd k(r d Zdd lmZdZydd lmZy#e $r  dd Z Y3wxYw)z, Backports of fixes for joblib dependencies N)util)basenamec<eZdZdZd dZdZdZdZdZdZ d Z y) VersionBackport from deprecated distutils We maintain this backport to avoid introducing a new dependency on `packaging`. We might rexplore this choice in the future if all major Python projects introduce a dependency on packaging anyway. Nc,|r|j|yyNparseselfvstrings V/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/joblib/backports.py__init__zVersion.__init__  JJw  cL|jjdt|dS)Nz ('z')) __class____name__strr s r__repr__zVersion.__repr__s"nn55s4yAArcB|j|}|tur|S|dk(SNr_cmpNotImplementedr othercs r__eq__zVersion.__eq__& IIe   HAv rcB|j|}|tur|S|dkSrrrs r__lt__zVersion.__lt__#& IIe   H1u rcB|j|}|tur|S|dkSrrrs r__le__zVersion.__le__)r"rcB|j|}|tur|S|dkDSrrrs r__gt__zVersion.__gt__/r%rcB|j|}|tur|S|dk\Srrrs r__ge__zVersion.__ge__5r"rr ) r __module__ __qualname____doc__rrr!r$r'r)r+rrrr s+ B    rrcjeZdZdZej dej Zd dZdZ dZ dZ dZ y) LooseVersionrz(\d+ | [a-z]+ | \.)Nc,|r|j|yyr r r s rrzLooseVersion.__init__Hrrc||_|jj|Dcgc] }|s|dk7s |}}t|D]\}} t |||<||_ycc}w#t $rY/wxYw)N.)r component_resplit enumerateint ValueErrorversion)r rx componentsiobjs rr zLooseVersion.parseLs !%!2!2!8!8!ATAQ1PS8aT T + FAs  #C 1   " U  s!A#A#A# A(( A43A4c|jSr )rrs r__str__zLooseVersion.__str__Zs ||rcdt|zS)NzLooseVersion ('%s'))rrs rrzLooseVersion.__repr__]s$s4y00rct|tr t|}nt|tstS|j|jk(ry|j|jkry|j|jkDryy)Nr) isinstancerr1rr:)r rs rrzLooseVersion._cmp`sd eS ! 'EE<0! ! <<5== ( <<%-- ' <<%-- ' (rr ) rr,r-r.recompileVERBOSEr5rr r@rrr/rrr1r1<s92::4bjjAL  "1 rr1c$tjdj|t|t j t j||||||}tt jdkr||_ |rddl m }|||S)abCustom memmap constructor compatible with numpy.memmap. This function: - is a backport the numpy memmap offset fix (See https://github.com/numpy/numpy/pull/8443 for more details. The numpy fix is available starting numpy 1.13) - adds ``unlink_on_gc_collect``, which specifies explicitly whether the process re-constructing the memmap owns a reference to the underlying file. If set to True, it adds a finalizer to the newly-created memmap that sends a maybe_unlink request for the memmaped file to resource_tracker. z?[MEMMAP READ] creating a memmap (shape {}, filename {}, pid {}))dtypemodeoffsetshapeorderz1.13rD)add_maybe_unlink_finalizer) rdebugformatrosgetpidnpmemmapr1 __version__rL_memmapping_reducerrO) filenamerJrKrLrMrNunlink_on_gc_collectmmrOs r make_memmapr[qs{* M T Tx)299;  YY EV5PU   '& 0BI  G &r * rctd)NzL'joblib.backports.make_memmap' should not be used if numpy is not installed.)NotImplementedError)rXrJrKrLrMrNrYs rr[r[s" )  rnt) )replacecd}d}d}||kr t||y#t$r>}t|ddtvr t j |||z }|dz}nYd}~nd}~wwxYw||kr_R)zRenames ``src`` into ``dst`` overwriting ``dst`` if it exists. On Windows os.replace can yield permission errors if executed by two different processes. rDrgMbP?winerrorN)ra Exceptiongetattraccess_denied_errorstimesleep)srcdstmax_sleep_timetotal_sleep_time sleep_timeexcs rconcurrency_safe_renamerps  / S!  3 D15IIJJz*$ 2$!OJ   /s  A"4AA")uint8zr+rNCF)r.rRrFrhmultiprocessingros.pathrrr1numpyrTr[ ImportErrornamergrarpr/rrrxs --`/7/d6  "$l77d?".6[  "   sA!!A32A3