uBFjv (dZddlZddlZddlZejjZejjeejjz Zejd ej eZ [dZ dZ dZGddeZd Zd ZGd d ZdS) zC A universal module with functions / classes without dependencies. Nz (?:\.[^{0}]+|[{0}]__init__\.py)$cfd}|S)Nc.t|i|SN)listargskwargsfuncs BC:\PYTHON\_runtimes\venv\Lib\site-packages\jedi/inference/utils.pywrapperzto_list..wrappers DD$)&))***r r s` r to_listrs!+++++ Nr cfd}|S)Nc.t|i|Sr)tuplers r r zto_tuple..wrappers TT4*6**+++r rrs` r to_tuplers!,,,,, Nr c4td|DS)z5Turns a two dimensional array into a one dimensional.c3$K|] }|D]}|V dSrr).0typestyps r zunite..s/::uE::Ss:::::::r )set)iterables r uniters ::::: : ::r ceZdZdZdS)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 cFtjfd}|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. cZ |i|S#t$r}t||d}~wwxYwr)AttributeErrorr)rkwdser s r r z!reraise_uncaught..wrapper@sL 34&&& & 3 3 3(++ 2 3s *%*) functoolswrapsrs` r r&r&/s:"_T33333 Nr c&eZdZdZdZdZdZdS)PushBackIteratorc"g|_||_dSr)pushesiterator)selfr3s r __init__zPushBackIterator.__init__Js   r c:|j|dSr)r2append)r4values r push_backzPushBackIterator.push_backNs 5!!!!!r c|Srrr4s r __iter__zPushBackIterator.__iter__Qs r c|jr|j|_nt|j|_|jSr)r2popcurrentnextr3r;s r __next__zPushBackIterator.__next__Ts: ; /;??,,DLL ..DL|r N)r r!r"r5r9r<rArr r r0r0IsP!!!"""r r0)r#r-reospathsep_sepaltsepcompileformatescape_path_rerrr Exceptionrr'r&r0rr r rMs II  w{7>BGND 2:9@@4QQ R R  ;;;     Y   ,,,4r