JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr ړgQ$ddlmZddlZddlmZddlmZddlZddl Z ddl Z ddl m Z ddl m Z ddl m Z ddl mZddl mZdd l mZdd l mZdd l mZdd l mZdd l mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddlmZ ddlm Z ddlm!Z!ddlm"Z"ddlm#Z#ddlm$Z$ddlm%Z%ddlm&Z&dd lm'Z'dd!lm(Z(dd"lm)Z)dd#lm*Z*dd$lm+Z+dd%lm,Z,dd&lm-Z-dd'lm.Z.dd(lm/Z/dd)lm0Z0dd*lm1Z1ed+e ,Z2ed-Z3ed.d/Z4ed0d1Z5ed2Z6ed3d/Z7ejpre9e jNe'gZ:n e9e'gZ:ejvrdd4ldZ=ed5Z?eee e@eee0d6fZAGd7d8e*ZBGd9d:e*e2ZCGd;ddd? dld@ZF dmdAZG dndBZHdddC dodDZIddE dpdFZJdqdGZKdrdHZLdsdIZMdtdJZNdudKZOdvdLZPdwdMZQdxdNZRdydOZS dz d{dPZTed|dQZUed}dRZUe dmdSZU dmdTZUe d~dUZVe ddVZV ddWZVddXZWdtdYZXddZZY dd[ZZdd\ dd]Z[dd^Z\Gd_d`e*Z]edae],Z^Gdbdcee^Z_edde]deZ`Gdfdgee`Zaedhee die f,ZbGdjdkeebZcy)) annotationsN)deque)Any)Callable)cast)Dict) ForwardRef)Generic)Iterable)Mapping)NewType)NoReturn)Optional)overload)Set)Tuple)Type) TYPE_CHECKING)TypeVar)Union)compatT) Annotated) Concatenate)dataclass_transform)Final)final)get_args) get_origin)Literal) NotRequired) ParamSpec)Protocol) SupportsIndex) TypeAlias) TypedDict) TypeGuard)Self) TypeAliasType)Never_T)bound_KT_KT_co) covariant _KT_contra) contravariant_VT_VT_co)NoneTypeNonezGenericProtocol[Any]ceZdZUdZded<y)ArgsTypeProtocolz_protocol for types that have ``__args__`` there's no public interface for this AFAIK Tuple[_AnnotationScanType, ...]__args__N__name__ __module__ __qualname____doc____annotations__G/opt/hc_python/lib64/python3.12/site-packages/sqlalchemy/util/typing.pyr7r7Zs .-rAr7c&eZdZUdZded<ded<y)GenericProtocolzXprotocol for generic types. this since Python.typing _GenericAlias is private r8r9Type[_T] __origin__Nr:r@rArBrDrDds .-rArDceZdZddZddZy)SupportsKeysAndGetItemcyNr@)selfs rBkeyszSupportsKeysAndGetItem.keysysSrAcyrJr@)rK_SupportsKeysAndGetItem__ks rB __getitem__z"SupportsKeysAndGetItem.__getitem__{ssrAN)returnz Iterable[_KT])rNr-rPr3)r;r<r=rLrOr@rArBrHrHxs(2rArH*Fstr_cleanup_fninclude_generic _already_seencl|}t|r |j}t|trr |}t |}rht |r]t |sR t|vr|Sj|tfd|jD}t||S|S)a;Resolve annotations that may be string based into real objects. This is particularly important if a module defines "from __future__ import annotations", as everything inside of __annotations__ is a string. We want to at least have generic containers like ``Mapped``, ``Union``, ``List``, etc. locals_in_classc 3BK|]}t|yw)rRN)de_stringify_annotation).0elemrUclsrTrXoriginating_modulerSs rB z*de_stringify_annotation..s<  , $"- /+  ,s) is_fwd_ref__forward_arg__ isinstancestreval_expression is_generic is_literalsetaddtupler9_copy_generic_annotation_with) r^ annotationr_rXrSrTrUoriginal_annotationelementss ` ````` rBr[r[s.%*// *c" ' 4FGJ$ *Gc  z ":&  EM  & ' &   j )   #++   -ZBB rAc t|rt|tttt j t jt jt jt jfvrttjdt|sUt|jtt!|Dcgc]}t#|t$r t'|n|!c}S|Scc}w)zfCorrect dict['x', 'y'] into dict[ForwardRef('x'), ForwardRef('y')] and similar for list, set z3typing.(?:Dict|List|Set|.*Mapping|.*Sequence|.*Set))rfrdictrhlistcollections_abc MutableSetMutableMappingMutableSequencer Sequencerematchrepr__class_getitem__rjrrcrdr )type_r]s rBfixup_container_fwd_refsr|s 5 u      & &  * *  + +  # #  $ $   A4; % 22 !) /)34(=Jt$4G /    L s8$C) cZt|dr|j|S|j|S)N copy_with)hasattrr~rF)rlrns rBrkrks2z;'##H--$$X..rArWc tj|j} |Qt |j}|j |j||j|t|||}|St|||} |S#t$r}t d|d||d}~wwxYw#t$r}t d||d}~wwxYw)NModule z9 isn't present in sys.modules; can't evaluate expression z"Could not de-stringify annotation ) sysmodules__dict__KeyError NameErrorrp setdefaultr;updateeval Exception) expression module_namerXrY base_globalske cls_namespacerlerrs rBreres'*{{;'?'H'H    !2!23M  $ $X%6%6 A   .j-AJ j,@J 1 k]###-, 0  & 0 ?  s5BAB&3 B& B# BB#& C/B>>CrXcJd|vrt|||S tj|j} ||S#t$r}t d|d||d}~wwxYw#t$r?} t j|cYd}~S#t$rYnwxYwt d|d||d}~wwxYw)N.rrz2 isn't present in sys.modules; can't resolve name zCould not locate name z in module )rerrrrrbuiltins)namerrXrrs rBeval_name_onlyr!s  d{t['BB'*{{;'?'H'H  D!! k]# 6 #     $$T* *   $TF+k] C   sJ7A AAA B"$A<6B"< BBBBB"cX t||}t|d|S#t$r|cYSwxYw)Nr;)rgetattrr)rrobjs rBresolve_name_to_real_class_namerCs:.T;/sJ--  s  ))c0|duxrt|tuSrJ)rrr{s rB is_pep593rLs   ?E!2i!??rAcht|tjxrt|ttf SrJ)rcrrr rdbytes)rs rBis_non_string_iterablerPs1 c?33 4 Z c5\>:rAc$t|tvSrJ)r LITERAL_TYPESrs rBrgrgVs e  --rAct|dS)N __supertype__rrs rB is_newtyperZs 5/ **rAc6t|dxr t|dS)Nr9rFrrs rBrfrfbs 5* % F'%*FFrAc"t|tSrJ)rcr)rs rB is_pep695rfs e] ++rAcd|j}t|r|j}t|r|SrJ)rr)r{ super_types rBflatten_newtyperjs0$$J Z --  Z rAc:tfd|}t|trot}t|}|rV|j }t|tr|j |n!|j |tthvrdn||rV|S|hS)zExtracts the value from a TypeAliasType, recursively exploring unions and inner TypeAliasType to flatten them into a single set. Forward references are not evaluated, so no recursive exploration happens into them. c|vr|Sj|t|s|S|j}t|s|S|jDcgc] }| c}Scc}wrJ)rir __value__is_unionr9)r{valuet_seenrecursive_values rBrz&pep695_values..recursive_valuezs` E>L %LL,1NN;Nq"N;;;s AN) rhrcrqrpopleftextendrir4NoneFwd)r{restypesstackrrrs @@rB pep695_valuesrqs EE < % C#tc  A!T" Q !'':":$B   u rAcrt|tryt|try|r)t|rt fd|j DSy)NTc3:K|]}t|dyw)T)check_for_plain_stringN)ra)r\argrs rBr`zis_fwd_ref..s/ & T2H  &sF)rcrdr rfanyr9)r{ check_genericrs `rBrarasP *UC"8 E: & :e, ~~    rAcyrJr@rs rBde_optionalize_union_typesrs36rAcyrJr@rs rBrrs?BrAcyrJr@rs rBrrrAct|r t|dSt|rt|rtj rt |j}n{t|g}t }|rR|j}|jD]0}t|r|j| |j|2|rR|jd|jt|jtt|S|S)zGiven a type, filter out ``Union`` types that include ``NoneType`` to not include the ``NoneType``. Contains extra logic to work on non-flattened unions, unions that contain ``None`` (seen in py38, 37) FN)ra#_de_optionalize_fwd_ref_union_typesr includes_nonerpy39rhr9rrappendridiscardr4rmake_union_type)r{typstack_of_unionsu_typr]s rBrrs%25%@@ %]51 ;;enn%C$UGnO%C!'//1!NND~'..t4 +" KK  H G$$ rAcyrJr@r{return_has_nones rBrrs rAcyrJr@rs rBrrrrAc|j}tjd|}|r^|jdj dd}|dk(r|rdSt |jdS|dk(r d |jdvrg}g}d }|jdD]r}|d k(r|dz }nT|d k(r|dz}nI|d k(rD|d k(r?|j d j|j|jb|j |tn%tjd|jd}|D cgc]} | dk7s t | } } |rt|t| k7S| rt| StS|rdS|Stjd|} d| v} |r| S| r+djd| D} | r t | StS|Scc} w)zreturn the non-optional type for Optional[], Union[None, ...], x|None, etc. without de-stringifying forward refs. unfortunately this seems to require lots of hardcoded heuristics z^(.+?)\[(.+)\]$rrrTr[r],z,\s*r5Fz\s*\|\s*|c3,K|] }|dk7s |yw)r5Nr@)r\ps rBr`z6_de_optionalize_fwd_ref_union_types..sB{!a6kA{s ) rbrwrxgroupsplitr rjoinstripclearlenrr*)r{rrlmmg1rncurrent ignore_commacharr]parts pipe_tokenshas_noneanno_strs rBrrs&&J $j 1B XXa[  s #B '  *4 G 288A;0G G 7]bhhqk!&(%' HHQKDs{$) $) %*ts{ (8(>(>(@A  NN4((88GRXXa[92:M($dfnZ%(EM8}E 2227.BUB+5 6 6((; 3K$H88B{BB'/z(#:U: L!Ns ; G Gc,tj|S)zMake a Union type.)rrO)rs rBrr#s   U ##rAcjt|r t|dSt|rtdt |DSt |rt t |dSt|rtdt|DSt|rt |jS|ttdfvS)a.Returns if the type annotation ``type_`` allows ``None``. This function supports: * forward refs * unions * pep593 - Annotated * pep695 - TypeAliasType (does not support looking into fw reference of other pep695) * NewType * plain types like ``int``, ``None``, etc Tc32K|]}t|ywrJrr\rs rBr`z includes_none..7s=_=#_rc32K|]}t|ywrJrrs rBr`z includes_none..;sB-A=#-ArN) rarrrrrrrrrrrr4rs rBrr(s%25$??=Xe_===Xe_Q/00B]5-ABBB%U0011 Wh- --rAct|ddS)Nr UnionType) is_origin_ofrs rBrrAs w 44rAcZt|}|yt|txr t||S)z[return True if the given type has an __origin__ that shares a base with the given classF)rrctype issubclass)r{ class_objorigins rBis_origin_of_clsrEs/  F ~ fd # E 69(EErA)modulec~t|}|yt||vxr!|duxs|jj|S)z\return True if the given type has an __origin__ with the given name and optional module.NF)r_get_type_namer< startswith)r{rnamesrs rBrrRsJ  F ~ & !U * $>&++66v>rAcvtjr |jSt|dd}| t|dd}|S)Nr;_name)rpy310r;r)r{typ_names rBrras: ||~~5*d3  ugt4HrAc$eZdZddZddZddZy)DescriptorProtocyrJr@rKinstanceowners rB__get__zDescriptorProto.__get__msCrAcyrJr@rKr rs rB__set__zDescriptorProto.__set__os#rAcyrJr@rKr s rB __delete__zDescriptorProto.__delete__qsrAN)r objectr rrPr)r rrrrPr5r rrPr5)r;r<r=r rrr@rArBrrls ?=4rAr_DESCc.eZdZdZer ddZddZddZyy) DescriptorReferenceaa descriptor that refers to a descriptor. used for cases where we need to have an instance variable referring to an object that is itself a descriptor, which typically confuses typing tools as they don't know when they should use ``__get__`` or not when referring to the descriptor assignment as an instance variable. See sqlalchemy.orm.interfaces.PropComparator.prop cyrJr@r s rBr zDescriptorReference.__get__#rAcyrJr@rs rBrzDescriptorReference.__set__rAcyrJr@rs rBrzDescriptorReference.__delete__SrAN)r rr rrPr)r rrrrPr5rr;r<r=r>rr rrr@rArBrrwsEC8 rAr_DESC_co)r,r/c.eZdZdZer ddZddZddZyy) RODescriptorReferenceza descriptor that refers to a descriptor. same as :class:`.DescriptorReference` but is read-only, so that subclasses can define a subtype as the generically contained element cyrJr@r s rBr zRODescriptorReference.__get__sSrAcyrJr@rs rBrzRODescriptorReference.__set__rrAcyrJr@rs rBrz RODescriptorReference.__delete__srAN)r rr rrPr )r rrrrPr)r rrPrrr@rArBr"r"sHE< rAr"_FN.c.eZdZdZer ddZddZddZyy) CallableReferenceza descriptor that refers to a callable. works around mypy's limitation of not allowing callables assigned as instance variables cyrJr@r s rBr zCallableReference.__get__rrAcyrJr@rs rBrzCallableReference.__set__scrAcyrJr@rs rBrzCallableReference.__delete__rrAN)r rr rrPr&)r rrr&rPr5rrr@rArBr(r(sCA8 rAr()r^ Type[Any]rl_AnnotationScanTyper_rdrXzMapping[str, Any]rSz#Optional[Callable[[str, str], str]]rTboolrUzOptional[Set[Any]]rPr,)r{r-rPr-)rlzGenericProtocol[_T]rnr8rPrE) rrdrrdrXOptional[Mapping[str, Any]]rYzOptional[Type[Any]]rPr)rrdrrdrXr/rPr)rrdrrdrPrd)r{z Optional[Any]rPr.)rrrPzTypeGuard[Iterable[Any]])r{rrPr.)r{zOptional[_AnnotationScanType]rPzTypeGuard[NewType])r{r-rPzTypeGuard[GenericProtocol[Any]])r{r-rPzTypeGuard[TypeAliasType])r{r rPr,)r{r-rPzSet[Any])FF)r{r-rr.rr.rPzTypeGuard[ForwardRef])r{rdrPrd)r{r,rPr,)r{r rz Literal[True]rPr.)r{r rzLiteral[False]rPr-)r{r rr.rPz Union[_AnnotationScanType, bool])rr-rPr,)r{rrPzTypeGuard[ArgsTypeProtocol])r{rrz'Union[Tuple[Type[Any], ...], Type[Any]]rPr.)r{rrrdrz Optional[str]rPr.)r{r,rPrd)d __future__rr collectionsrcollections.abcabcrrrwrtypingrrrrr r r r r rrrrrrrrrrrtyping_extensionsrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r-r.r0r2r3py38 frozensetrrrr4rrrdr-r7rDrH _LiteralStarr[r|rkrerrrrrgrrfrrrrarrrrrrrrrrrr r"r&r(r@rArBr9s#)  8<106:4<86@888.@0 T en T * \ 6  en T * ;;v~~w78Mwi(M <<+DzH V IsJ8NN .x.hrl(3Xc6k23s| ;?!(,D D#DD D 8 DD&DDN& &&R/#//N/ /,0$( !!!) ! " !  !P,0  )   D.@ .+G,"N #( ! ( 6 6 B B    & &&R  (5     (6  3 3(,3%3l$ .25 F  FB F  F6:    %2   5h5 /9'%.9( :_ E=GH-="e8HS#X$6789 9rA