TL i VdZddlZddlZddlZejj Zejjeejjz ZejdjejeZ [dZ dZ dZGddeZd Zd ZGd d Zy) zC A universal module with functions / classes without dependencies. Nz (?:\.[^{0}]+|[{0}]__init__\.py)$cfd}|S)Nc&t|i|SN)listargskwargsfuncs Z/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/jedi/inference/utils.pywrapperzto_list..wrappersD$)&)**r r s` r to_listrs + Nr cfd}|S)Nc&t|i|Sr)tuplers r r zto_tuple..wrappersT4*6*++r rrs` r to_tuplers , Nr c&td|DS)z5Turns a two dimensional array into a one dimensional.c3.K|] }|D]}|ywrr).0typestyps r zunite..s:uE:Ss:s:s)set)iterables r uniters :: ::r ceZdZdZy)UncaughtAttributeErrora Important, because `__getattr__` and `hasattr` catch AttributeErrors implicitly. This is really evil (mainly because of `__getattr__`). Therefore this class originally had to be derived from `BaseException` instead of `Exception`. But because I removed relevant `hasattr` from the code base, we can now switch back to `Exception`. :param base: return values of sys.exc_info(). N)__name__ __module__ __qualname____doc__rr r rrsr rc*tt|Sr)propertyreraise_uncaught)r s r safe_propertyr'+s $T* ++r cBtjfd}|S)a* Re-throw uncaught `AttributeError`. Usage: Put ``@rethrow_uncaught`` in front of the function which does **not** suppose to raise `AttributeError`. AttributeError is easily get caught by `hasattr` and another ``except AttributeError`` clause. This becomes problem when you use a lot of "dynamic" attributes (e.g., using ``@property``) because you can't distinguish if the property does not exist for real or some code inside of the "dynamic" attribute through that error. In a well written code, such error should not exist but getting there is very difficult. This decorator is to help us getting there by changing `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch. This helps us noticing bugs earlier and facilitates debugging. cP |i|S#t$r}t||d}~wwxYwr)AttributeErrorr)rkwdser s r r z!reraise_uncaught..wrapper@s5 3&& & 3(+ 2 3s % %) functoolswrapsrs` r r&r&/s'"__T33 Nr c$eZdZdZdZdZdZy)PushBackIteratorc.g|_||_d|_yr)pushesiteratorcurrent)selfr3s r __init__zPushBackIterator.__init__Js    r c:|jj|yr)r2append)r5values r push_backzPushBackIterator.push_backOs 5!r c|Srrr5s r __iter__zPushBackIterator.__iter__Rs r c|jr+|jj|_|jSt|j|_|jSr)r2popr4nextr3r<s r __next__zPushBackIterator.__next__UsC ;;;;??,DL||  .DL||r N)r r!r"r6r:r=rArr r r0r0Is "r r0)r#r-reospathsep_sepaltsepcompileformatescape_path_rerrr Exceptionrr'r&r0rr r rMsI  ww{{77>>BGGNND 2::9@@4Q R  ; Y ,4r