
    ,h                      S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SS	KJ
r
  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r   SS KJ!r!  SS!KJ"r"  SS"KJ#r#  SS#K"J$r$  SS$K"J%r%  SS%K"J&r&  SS&K"J'r'  SS'K(J)r)  SS(K*J+r+  SS)K*J,r,  SS*K*J-r-  SS+K.J/r/  SS,K.J0r0  SS-K1J2r2  SS.K3J4r4  SS/K3J5r5  SS0K3J6r6  SS1K3J7r7  SS2K3J8r8  \Rr                  (       a  SS3K*J:r:  SS4K*J;r;  SS5K<J=r=  SS6K>J?r?  SS7K>J@r@  \" S8\S99rA\" S:\S;S<9rB\" S=\S;S>9rC\" S?\S99rD\" S@\S99rE\" SA\S99rFSSSSSSBSB\2R                  \2R                  \2R                  \2R                  \2R                  \2R                  \2R                  SC.                                 SySD jjrH " SE SF\%5      rI " SG SH\5\B   5      rJ " SI SJ\55      rK " SK SL\K\5\C   5      rL " SM SN\K\5\C   5      rM " SO SP\55      rN " SQ SR\N\5\C   5      rO " SS ST\N\5\C   5      rP " SU SV\5\A   5      rQ " SW SX\55      rR " SY SZ\55      rS " S[ S\\55      rT " S] S^\5\A   5      rU " S_ S`\&R                  \'\A   \,\U\A   5      rW\" SaSbS99rX " Sc Sd\)\A   5      rY " Se Sf\Y\A   5      rZ " Sg Sh\Y\A   5      r[ " Si Sj\Y\A   5      r\ " Sk Sl\Q\A   5      r]\" SmSnS99r^  " So Sp\\^   5      r_ " Sq Sr\_\A   5      r` " Ss St\`\A   \\A   5      ra " Su Sv\_\F   \\E\F4   5      rb " Sw Sx\`\A   \\A   5      rcg)zzContain the ``AssociationProxy`` class.

The ``AssociationProxy`` is a Python property object which provides
transparent proxied access to the endpoint of an association object.

See the example ``examples/association/proxied_association.py``.

    )annotationsN)AbstractSet)Any)Callable)cast)
Collection)Dict)Generic	ItemsView)Iterable)Iterator)KeysView)List)Mapping)MutableMapping)MutableSequence)
MutableSet)NoReturn)Optional)overload)Set)Tuple)Type)TypeVar)Union
ValuesView   )ColumnElement)exc)inspect)orm)util)collections)InspectionAttrExtensionType)
interfaces)ORMDescriptor)SQLORMOperations)_AttributeOptions)_DCAttributeOptions)_DEFAULT_ATTRIBUTE_OPTIONS)	operators)or_)_NoArg)Literal)Protocol)Self)SupportsIndex)SupportsKeysAndGetItem)MapperProperty)PropComparator)Mapper)_ColumnExpressionArgument)	_InfoType_T)bound_T_coT)r;   	covariant_T_con)r;   contravariant_S_KT_VTF)creatorgetset_factoryproxy_factoryproxy_bulk_setinfocascade_scalar_deletescreate_on_none_assignmentinitreprdefaultdefault_factorycomparekw_onlyhashc               >    [        U UUUUUUUU[        XXXU5      S9
$ )a  Return a Python property implementing a view of a target
attribute which references an attribute on members of the
target.

The returned value is an instance of :class:`.AssociationProxy`.

Implements a Python property representing a relationship as a collection
of simpler values, or a scalar value.  The proxied property will mimic
the collection type of the target (list, dict or set), or, in the case of
a one to one relationship, a simple scalar value.

:param target_collection: Name of the attribute that is the immediate
  target.  This attribute is typically mapped by
  :func:`~sqlalchemy.orm.relationship` to link to a target collection, but
  can also be a many-to-one or non-scalar relationship.

:param attr: Attribute on the associated instance or instances that
  are available on instances of the target object.

:param creator: optional.

  Defines custom behavior when new items are added to the proxied
  collection.

  By default, adding new items to the collection will trigger a
  construction of an instance of the target object, passing the given
  item as a positional argument to the target constructor.  For cases
  where this isn't sufficient, :paramref:`.association_proxy.creator`
  can supply a callable that will construct the object in the
  appropriate way, given the item that was passed.

  For list- and set- oriented collections, a single argument is
  passed to the callable. For dictionary oriented collections, two
  arguments are passed, corresponding to the key and value.

  The :paramref:`.association_proxy.creator` callable is also invoked
  for scalar (i.e. many-to-one, one-to-one) relationships. If the
  current value of the target relationship attribute is ``None``, the
  callable is used to construct a new object.  If an object value already
  exists, the given attribute value is populated onto that object.

  .. seealso::

    :ref:`associationproxy_creator`

:param cascade_scalar_deletes: when True, indicates that setting
    the proxied value to ``None``, or deleting it via ``del``, should
    also remove the source object.  Only applies to scalar attributes.
    Normally, removing the proxied target will not remove the proxy
    source, as this object may have other state that is still to be
    kept.

    .. versionadded:: 1.3

    .. seealso::

        :ref:`cascade_scalar_deletes` - complete usage example

:param create_on_none_assignment: when True, indicates that setting
  the proxied value to ``None`` should **create** the source object
  if it does not exist, using the creator.  Only applies to scalar
  attributes.  This is mutually exclusive
  vs. the :paramref:`.assocation_proxy.cascade_scalar_deletes`.

  .. versionadded:: 2.0.18

:param init: Specific to :ref:`orm_declarative_native_dataclasses`,
 specifies if the mapped attribute should be part of the ``__init__()``
 method as generated by the dataclass process.

 .. versionadded:: 2.0.0b4

:param repr: Specific to :ref:`orm_declarative_native_dataclasses`,
 specifies if the attribute established by this :class:`.AssociationProxy`
 should be part of the ``__repr__()`` method as generated by the dataclass
 process.

 .. versionadded:: 2.0.0b4

:param default_factory: Specific to
 :ref:`orm_declarative_native_dataclasses`, specifies a default-value
 generation function that will take place as part of the ``__init__()``
 method as generated by the dataclass process.

 .. versionadded:: 2.0.0b4

:param compare: Specific to
 :ref:`orm_declarative_native_dataclasses`, indicates if this field
 should be included in comparison operations when generating the
 ``__eq__()`` and ``__ne__()`` methods for the mapped class.

 .. versionadded:: 2.0.0b4

:param kw_only: Specific to :ref:`orm_declarative_native_dataclasses`,
 indicates if this field should be marked as keyword-only when generating
 the ``__init__()`` method as generated by the dataclass process.

 .. versionadded:: 2.0.0b4

:param hash: Specific to
 :ref:`orm_declarative_native_dataclasses`, controls if this field
 is included when generating the ``__hash__()`` method for the mapped
 class.

 .. versionadded:: 2.0.36

:param info: optional, will be assigned to
 :attr:`.AssociationProxy.info` if present.


The following additional parameters involve injection of custom behaviors
within the :class:`.AssociationProxy` object and are for advanced use
only:

:param getset_factory: Optional.  Proxied attribute access is
    automatically handled by routines that get and set values based on
    the `attr` argument for this proxy.

    If you would like to customize this behavior, you may supply a
    `getset_factory` callable that produces a tuple of `getter` and
    `setter` functions.  The factory is called with two arguments, the
    abstract type of the underlying collection and this proxy instance.

:param proxy_factory: Optional.  The type of collection to emulate is
    determined by sniffing the target collection.  If your collection
    type can't be determined by duck typing or you'd like to use a
    different collection implementation, you may supply a factory
    function to produce those collections.  Only applicable to
    non-scalar relationships.

:param proxy_bulk_set: Optional, use with proxy_factory.


rC   rD   rE   rF   rG   rH   rI   attribute_options)AssociationProxyr*   )target_collectionattrrC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   s                   W/var/www/auris/envauris/lib/python3.13/site-packages/sqlalchemy/ext/associationproxy.pyassociation_proxyrX   T   s>    r %#%5";+'D
     c                      \ rS rSrSrSrg)AssociationProxyExtensionType   ASSOCIATION_PROXY N)__name__
__module____qualname____firstlineno__r]   __static_attributes__r^   rY   rW   r[   r[      s    +rY   r[   c                      \ rS rSrSS jrSrg)_GetterProtocoli  c                    g Nr^   )selfinstances     rW   __call___GetterProtocol.__call__	  s    rY   r^   N)ri   r   returnr<   r_   r`   ra   rb   rj   rc   r^   rY   rW   re   re     s    3rY   re   c                      \ rS rSrSrg)_SetterProtocoli  r^   Nr_   r`   ra   rb   rc   r^   rY   rW   ro   ro     s    rY   ro   c                      \ rS rSrSS jrSrg)_PlainSetterProtocoli  c                    g rg   r^   )rh   ri   values      rW   rj   _PlainSetterProtocol.__call__  s    crY   r^   N)ri   r   rt   r>   rl   Nonerm   r^   rY   rW   rr   rr     s    ArY   rr   c                      \ rS rSrSS jrSrg)_DictSetterProtocoli  c                    g rg   r^   )rh   ri   keyrt   s       rW   rj   _DictSetterProtocol.__call__  s    rY   r^   N)ri   r   rz   r   rt   r>   rl   rv   rm   r^   rY   rW   rx   rx     s    KrY   rx   c                      \ rS rSrSrg)_CreatorProtocoli  r^   Nrp   r^   rY   rW   r}   r}     s    #rY   r}   c                      \ rS rSrSS jrSrg)_PlainCreatorProtocoli  c                    g rg   r^   rh   rt   s     rW   rj   _PlainCreatorProtocol.__call__  s    crY   r^   N)rt   r>   rl   r   rm   r^   rY   rW   r   r     s    1rY   r   c                      \ rS rSrSS jrSrg)_KeyCreatorProtocoli   c                    g rg   r^   rh   rz   rt   s      rW   rj   _KeyCreatorProtocol.__call__!  s    #rY   r^   N)rz   r   rt   zOptional[_T_con]rl   r   rm   r^   rY   rW   r   r      s    ErY   r   c                  "    \ rS rSr  SS jrSrg)_LazyCollectionProtocoli$  c                    g rg   r^   rh   s    rW   rj    _LazyCollectionProtocol.__call__%  s     rY   r^   Nrl   zCUnion[MutableSet[_T], MutableMapping[Any, _T], MutableSequence[_T]]rm   r^   rY   rW   r   r   $  s    
rY   r   c                  *    \ rS rSr      SS jrSrg)_GetSetFactoryProtocoli,  c                    g rg   r^   )rh   collection_classassoc_instances      rW   rj   _GetSetFactoryProtocol.__call__-  s     8;rY   r^   N)r   Optional[Type[Any]]r   AssociationProxyInstance[Any]rl   ,Tuple[_GetterProtocol[Any], _SetterProtocol]rm   r^   rY   rW   r   r   ,  s#    ;-; 6; 
6	;rY   r   c                  2    \ rS rSr          SS jrSrg)_ProxyFactoryProtocoli4  c                    g rg   r^   )rh   lazy_collectionrC   
value_attrparents        rW   rj   _ProxyFactoryProtocol.__call__5  s     rY   r^   N)
r   z_LazyCollectionProtocol[Any]rC   r}   r   strr   r   rl   r   rm   r^   rY   rW   r   r   4  s7    5 " 	
 . 
rY   r   c                  *    \ rS rSr      SS jrSrg)_ProxyBulkSetProtocoli>  c                    g rg   r^   )rh   proxy
collections      rW   rj   _ProxyBulkSetProtocol.__call__?  s    rY   r^   N)r   _AssociationCollection[Any]r   Iterable[Any]rl   rv   rm   r^   rY   rW   r   r   >  s    0>K	rY   r   c                      \ rS rSr% SrS\S'   S\S'   S\S'   S\S'   S	\S
'   S	\S'   S\S'   S\S'   S\S'   \R                  SS j5       r S     SS jjr	    SS jr
Srg)_AssociationProxyProtocoliD  zldescribes the interface of :class:`.AssociationProxy`
without including descriptor methods in the interface.Optional[_CreatorProtocol]rC   r   rz   rU   r   boolrH   rI    Optional[_GetSetFactoryProtocol]rD   Optional[_ProxyFactoryProtocol]rE   Optional[_ProxyBulkSetProtocol]rF   c                    g rg   r^   r   s    rW   rG   _AssociationProxyProtocol.infoR  s    !$rY   Nc                    g rg   r^   rh   class_objs      rW   	for_class#_AssociationProxyProtocol.for_classU  s    '*rY   c                    g rg   r^   )rh   r   s     rW   _default_getset)_AssociationProxyProtocol._default_getsetY  s    7:rY   r^   rl   r9   rg   r   	Type[Any]r   zOptional[object]rl   AssociationProxyInstance[_T]r   r   rl   r   )r_   r`   ra   rb   __doc____annotations__r$   ro_memoized_propertyrG   r   r   rc   r^   rY   rW   r   r   D  s    > ('	HO  ##442233	$ $ :>++&6+	%+; #;	5;rY   r   c            	      N   \ rS rSrSrSr\R                  rSSSSSSSSS.                   SS jjr	\
      SS j5       r\
      SS	 j5       r\
SS
 j5       r      SS jrSS jrSS jr S     SS jjr      SS jrSS jr    SS jrS S jrSrg)!rT   i^  zDA descriptor that presents a read/write view of an object attribute.TNFrR   c                  Xl         X l        X0l        X@l        XPl        X`l        U(       a  U	(       a  [        R                  " S5      eXl        Xl	        S[        U 5      R                  < SU< S[        U 5      < 3U l        U(       a  Xpl        U
(       a  U
[        :w  a  SU l        Xl        gSU l        [        U l        g)a   Construct a new :class:`.AssociationProxy`.

The :class:`.AssociationProxy` object is typically constructed using
the :func:`.association_proxy` constructor function. See the
description of :func:`.association_proxy` for a description of all
parameters.


z[The cascade_scalar_deletes and create_on_none_assignment parameters are mutually exclusive._TFN)rU   r   rC   rD   rE   rF   r!   ArgumentErrorrH   rI   typer_   idrz   rG   r,   _has_dataclass_arguments_attribute_options)rh   rU   rV   rC   rD   rE   rF   rG   rH   rI   rS   s              rW   __init__AssociationProxy.__init__i  s    . "3,*,!&?##5  '=#)B& JtH

 I !%??,0D)&7#,1D)&@D#rY   c                    g rg   r^   rh   ri   owners      rW   __get__AssociationProxy.__get__       rY   c                    g rg   r^   r   s      rW   r   r     s     (+rY   c                    g rg   r^   r   s      rW   r   r     s    ;>rY   c                l    Uc  U $ U R                  X!5      nU(       a  UR                  U5      $ Ub   eU $ rg   )_as_instanceget)rh   ri   r   insts       rW   r   r     sA     =K  188H%%rY   c                Z    [        U5      nU R                  X15      R                  X5        g rg   )r   r   set)rh   ri   valuesr   s       rW   __set__AssociationProxy.__set__  s$    h&+//ArY   c                Z    [        U5      nU R                  X!5      R                  U5        g rg   )r   r   delete)rh   ri   r   s      rW   
__delete__AssociationProxy.__delete__  s$    h&+228<rY   c                $    U R                  X5      $ )aI  Return the internal state local to a specific mapped class.

E.g., given a class ``User``::

    class User(Base):
        # ...

        keywords = association_proxy("kws", "keyword")

If we access this :class:`.AssociationProxy` from
:attr:`_orm.Mapper.all_orm_descriptors`, and we want to view the
target class for this proxy as mapped by ``User``::

    inspect(User).all_orm_descriptors["keywords"].for_class(User).target_class

This returns an instance of :class:`.AssociationProxyInstance` that
is specific to the ``User`` class.   The :class:`.AssociationProxy`
object remains agnostic of its parent class.

:param class\_: the class that we are returning state for.

:param obj: optional, an instance of the class that is required
 if the attribute refers to a polymorphic target, e.g. where we have
 to look at the type of the actual destination object to get the
 complete path.

.. versionadded:: 1.3 - :class:`.AssociationProxy` no longer stores
   any state specific to a particular parent class; the state is now
   stored in per-class :class:`.AssociationProxyInstance` objects.


)r   r   s      rW   r   AssociationProxy.for_class  s    F   --rY   c                @    UR                   U R                  S-      nUcF  U R                  U5      nUb0  [        R                  XU5      n[        XR                  S-   U5        OS nUb"  UR                  (       d  UR                  U5      $ U$ ! [         a    S n N~f = f)N_inst)	__dict__rz   KeyError_calc_ownerAssociationProxyInstance	for_proxysetattr_is_canonical_non_canonical_get_for_object)rh   r   r   r   r   s        rW   r   AssociationProxy._as_instance  s    	??488g#56D
 <$$V,E /99$sK7 2D9D$6$6 55c::K)  	D	s   B BBc                     [        U5      nUR                  R                  R                  $ ! [        R
                   a     g f = frg   )r"   mapperclass_managerr   r!   NoInspectionAvailable)rh   
target_clsinsps      rW   r   AssociationProxy._calc_owner  sE    		4:&D ;;,,333 (( 	
 	s   - AAc                   ^^ U R                   m[        R                  " T5      mSU4S jjnU[        L a  SU4S jjnX#4$ SU4S jjnX$4$ )Nc                   > U b  T" U 5      $ S $ rg   r^   ri   _getters    rW   getter0AssociationProxy._default_getset.<locals>.getter      (0(<78$F$FrY   c                    > [        U TU5        g rg   r   ri   krt   rV   s      rW   dict_setter5AssociationProxy._default_getset.<locals>.dict_setter      $.rY   c                    > [        U TU5        g rg   r   ovrV   s     rW   plain_setter6AssociationProxy._default_getset.<locals>.plain_setter$      4#rY   )ri   r   rl   Optional[Any])ri   r   r   r   rt   r   rl   rv   )r  r   r  r   rl   rv   r   operator
attrgetterdictrh   r   r   r   r  r   rV   s        @@rW   r    AssociationProxy._default_getset  sN     %%d+	G t#/ &&$ ''rY   c                @    SU R                   < SU R                  < S3$ )NzAssociationProxy(z, ))rU   r   r   s    rW   __repr__AssociationProxy.__repr__)  s    ""OO
 	
rY   )r   r   rH   rI   rC   rD   rG   rz   rF   rE   rU   r   )rU   r   rV   r   rC   r   rD   r   rE   r   rF   r   rG   Optional[_InfoType]rH   r   rI   r   rS   zOptional[_AttributeOptions])ri   Literal[None]r   r  rl   r2   )ri   r  r   r   rl   r   )ri   objectr   r   rl   r:   )ri   r  r   r   rl   z=Union[AssociationProxyInstance[_T], _T, AssociationProxy[_T]])ri   r  r   r:   rl   rv   )ri   r  rl   rv   rg   r   )r   r   r   r   rl   r   )r   r   rl   r   r   rl   r   )r_   r`   ra   rb   r   is_attributer[   r]   extension_typer   r   r   r   r   r   r   r   r   r  rc   r^   rY   rW   rT   rT   ^  s    OL2DDN /3;?9=:>$(',*/9=6A6A 6A
 ,6A 96A 76A 86A "6A !%6A $(6A 76Ap %.;	  +%+.1+	%+ + > >'*	FB=
 :>#.#.&6#.	%#.J #	%64( #(	5(.
rY   rT   _Selfr   c                     \ rS rSr% SrS\S'   S\S'           S,S	 jrS\S'    \        S-S
 j5       r\            S.S j5       r	S/S jr
\S0S j5       rS1S jr\      S2S j5       r\R                     S3S j5       r\S4S j5       r\S5S j5       r\S6S j5       r\R                   S7S j5       r\R                   S7S j5       r\S7S j5       rS\S'   S\S'   S8S jr    S9S jr\R4                  S:S j5       r\S;S j5       r\S<S j5       r    S=S  jrS>S! jrS?S" jr    S@S# jr       SAS$ jr!SBS% jr" SC     SDS' jjr# SC     SDS( jjr$ SC     SDS) jjr%SES* jr&S+r'g&)Fr   i6  a  A per-class object that serves class- and object-specific results.

This is used by :class:`.AssociationProxy` when it is invoked
in terms of a specific class or instance of a class, i.e. when it is
used as a regular Python descriptor.

When referring to the :class:`.AssociationProxy` as a normal Python
descriptor, the :class:`.AssociationProxyInstance` is the object that
actually serves the information.   Under normal circumstances, its presence
is transparent::

    >>> User.keywords.scalar
    False

In the special case that the :class:`.AssociationProxy` object is being
accessed directly, in order to get an explicit handle to the
:class:`.AssociationProxyInstance`, use the
:meth:`.AssociationProxy.for_class` method::

    proxy_state = inspect(User).all_orm_descriptors["keywords"].for_class(User)

    # view if proxy object is scalar or not
    >>> proxy_state.scalar
    False

.. versionadded:: 1.3

r   r   _AssociationProxyProtocol[_T]r   r   target_classc                    Xl         UR                  U l        X l        UR                  U l        S U l        X0l        X@l        g rg   )r   rz   owning_classrU   r   r  r   )rh   r   r  r  r   s        rW   r   !AssociationProxyInstance.__init__W  s;     ::(!'!9!9 $($rY   c                D   UR                   nUR                  n[        S[        R                  " U5      R                  U5      5      n[        U[        R                  5      (       d  [        S5      S eUR                  R                  n [        SU R                  Xu5      5      nU R                  XX'U5      $ ! [         a    [        XXu5      s $ [         aF  n	[         R"                  " SUR$                   SUR                   SUR$                   SU	 35      U	eS n	A	ff = f)Nzorm.RelationshipProperty[_T]zEassociation proxy to a non-relationship intermediary is not supportedr   zRAssociation proxy received an unexpected error when trying to retreive attribute ".z" from class "z": )rU   r   r   r#   class_mapperget_property
isinstanceRelationshipPropertyNotImplementedErrorr   r   _cls_unwrap_target_assoc_proxy_construct_for_assocAttributeError!AmbiguousAssociationProxyInstance	Exceptionr!   InvalidRequestErrorr_   )
clsr   r  parent_instancerU   r   propr  target_assocerrs
             rW   r   "AssociationProxyInstance.for_proxyo  s=    #44&&
*\*778IJ
 $ 8 899%0 
 {{))	.22<LL& ++l*   	 5l   	)) ))*!F,=,=+> ?&//0C5:
 	s   
B8 8D	DADDc                    Ub  [        X#XE5      $ [        XE5      n[        US5      (       d  [        X#XE5      $ UR                  nU(       a  [        X#XE5      $ [        X#XE5      $ )N_is_internal_proxy)ObjectAssociationProxyInstancegetattrhasattrr+  _impl_uses_objectsColumnAssociationProxyInstance)r.  r1  r   r  r  r   rV   	is_objects           rW   r)  -AssociationProxyInstance._construct_for_assoc  s~     #1l  |0t1224l  ++	1l  2l rY   c                t    [         R                  " U R                  5      R                  U R                  5      $ rg   )r#   r#  r  r$  rU   r   s    rW   _get_property&AssociationProxyInstance._get_property  s/     1 12??""
 	
rY   c                V    [        U R                  U R                  5      R                  $ rg   )r7  r  rU   
comparatorr   s    rW   _comparator$AssociationProxyInstance._comparator  s%    t55

*	rY   c                    [        S5      e)NzqThe association proxy can't be used as a plain column expression; it only works inside of a comparison expressionr'  r   s    rW   __clause_element__+AssociationProxyInstance.__clause_element__  s    !J
 	
rY   c                v    [        X5      n[        U[        5      (       a   e[        U[        5      (       a  U$ g rg   )r7  r%  rT   r   )r.  r  r   rV   s       rW   r(  7AssociationProxyInstance._cls_unwrap_target_assoc_proxy  s8     |0d$45555d455KrY   c                N    U R                  U R                  U R                  5      $ rg   )r(  r  r   r   s    rW   _unwrap_target_assoc_proxy3AssociationProxyInstance._unwrap_target_assoc_proxy  s&     22t
 	
rY   c                V    [        S[        U R                  U R                  5      5      $ )zThe 'remote' class attribute referenced by this
:class:`.AssociationProxyInstance`.

.. seealso::

    :attr:`.AssociationProxyInstance.attr`

    :attr:`.AssociationProxyInstance.local_attr`

SQLORMOperations[_T])r   r7  r  r   r   s    rW   remote_attr$AssociationProxyInstance.remote_attr  s'     "GD,=,=t$O
 	
rY   c                V    [        S[        U R                  U R                  5      5      $ )zThe 'local' class attribute referenced by this
:class:`.AssociationProxyInstance`.

.. seealso::

    :attr:`.AssociationProxyInstance.attr`

    :attr:`.AssociationProxyInstance.remote_attr`

SQLORMOperations[Any])r   r7  r  rU   r   s    rW   
local_attr#AssociationProxyInstance.local_attr  s*     #D%%t'='=>
 	
rY   c                2    U R                   U R                  4$ )aD  Return a tuple of ``(local_attr, remote_attr)``.

This attribute was originally intended to facilitate using the
:meth:`_query.Query.join` method to join across the two relationships
at once, however this makes use of a deprecated calling style.

To use :meth:`_sql.select.join` or :meth:`_orm.Query.join` with
an association proxy, the current method is to make use of the
:attr:`.AssociationProxyInstance.local_attr` and
:attr:`.AssociationProxyInstance.remote_attr` attributes separately::

    stmt = (
        select(Parent)
        .join(Parent.proxied.local_attr)
        .join(Parent.proxied.remote_attr)
    )

A future release may seek to provide a more succinct join pattern
for association proxy attributes.

.. seealso::

    :attr:`.AssociationProxyInstance.local_attr`

    :attr:`.AssociationProxyInstance.remote_attr`

)rS  rO  r   s    rW   rV   AssociationProxyInstance.attr  s    : !1!122rY   c                r    U R                  5       R                  (       + nU(       a  U R                  5         U$ )zkReturn ``True`` if this :class:`.AssociationProxyInstance`
proxies a scalar relationship on the local side.)r>  uselist_initialize_scalar_accessors)rh   scalars     rW   rZ  AssociationProxyInstance.scalar  s/    
 '')111--/rY   c                    U R                  5       R                  R                  U R                  5      R                  (       + $ rg   )r>  r   r$  r   rX  r   s    rW   _value_is_scalar)AssociationProxyInstance._value_is_scalar(  s1     ""$VLL1W	
rY   c                    [        5       erg   rE  r   s    rW   _target_is_object*AssociationProxyInstance._target_is_object0  s    !##rY   z_GetterProtocol[_T]_scalar_get_PlainSetterProtocol[_T]_scalar_setc                    U R                   R                  (       a  U R                   R                  S U 5      u  pOU R                   R                  S 5      u  pU[        SU5      sU l        U l        g )Nrc  )r   rD   r   r   rb  rd  )rh   r   set_s      rW   rY  5AssociationProxyInstance._initialize_scalar_accessors7  s[    ;;%%224>IC33D9IC-0$&3
*$*rY   c                   ^^ U R                   m[        R                  " T5      mSU4S jjnU[        L a  SU4S jjnX#4$ SU4S jjnX$4$ )Nc                   > U b  T" U 5      $ S $ rg   r^   r   s    rW   r   8AssociationProxyInstance._default_getset.<locals>.getterF  r   rY   c                    > [        U TU5        g rg   r   r   s      rW   r   =AssociationProxyInstance._default_getset.<locals>.dict_setterK  r  rY   c                    > [        U TU5        g rg   r   r  s     rW   r  >AssociationProxyInstance._default_getset.<locals>.plain_setterQ  r  rY   )ri   r   rl   zOptional[_T])ri   r   r   r   rt   r:   rl   rv   )r  r   r  r:   rl   rv   r
  r  s        @@rW   r   (AssociationProxyInstance._default_getset@  sN     %%d+	G t#/ &&$ ''rY   c                .    U R                   R                  $ rg   )r   rG   r   s    rW   rG   AssociationProxyInstance.infoV  s    {{rY   c                    g rg   r^   rh   r   s     rW   r   AssociationProxyInstance.getZ  s    7:rY   c                    g rg   r^   rs  s     rW   r   rt  ]  s    #&rY   c                   Uc  U $ U R                   (       a&  [        XR                  5      nU R                  U5      $  [	        S[        XR
                  5      5      u  p4n[        U5      U:X  a   [        U 5      U:X  a  U R                  c   eU$ U R                  [        XR                  5      5      u  U l        n[        XR
                  [        U5      [        U 5      U45        U$ ! [         a     Nef = f)NzTuple[int, int, _T])rZ  r7  rU   rb  r   rz   r   r   r*  _new_lazy_collectionr   )rh   r   target
creator_idself_idr   s         rW   r   rt  `  s     ;K ;;S"8"89F##F++! .2)73+A.*
U c7j(RX-@00<<< L+/99 &<&<=,(D!5 CBsGRXu#=>L " s   "C( (
C54C5c                X   U R                   (       a  [        SU R                  R                  (       a  U R                  R                  OU R                  5      n[        XR                  5      nUc<  Uc  U R                  R                  (       d  g [        XR                  U" U5      5        g U R                  XB5        Uc3  U R                  R                  (       a  [        XR                  S 5        g g g U R                  U5      nU R                  c   eXRLa  UR                  X5        g g )N_PlainCreatorProtocol[_T])rZ  r   r   rC   r  r7  rU   rI   r   rd  rH   r   r   _bulk_replace)rh   r   r   rC   ry  r   s         rW   r   AssociationProxyInstance.set  s    ;;+ {{** KK''**G S"8"89F~N KKAA33WV_E  0>dkk&H&HC!7!7> 'I> HHSME((444"##D1 #rY   c                    U R                   c  U R                  US 5        U R                  (       a-  [        XR                  5      nUb  [        X R                  5        [        XR                  5        g rg   )r  r   rZ  r7  rU   delattrr   rh   r   ry  s      rW   r   AssociationProxyInstance.delete  sU    $S$';;S"8"89F!0++,rY   c                t   U R                   R                  b  U R                   R                  O[        SU R                  5      n[        R
                  " U" 5       5      nUc  [        R                  " SU 35      eU R                   R                  (       a)  UU R                   R                  XU R                  U 5      4$ U R                   R                  (       a  U R                   R                  X05      u  pEOU R                   R                  U5      u  pEU[        L a  U[        [        [        XXEU 5      5      4$ U[        L a  U[        [        [!        XXEU 5      5      4$ U["        L a  U[        [        [%        XXEU 5      5      4$ [        R&                  " SU R(                  < SU R*                  < S35      e)Nr}   zDlazy collection factory did not return a valid collection type, got z=could not guess which interface to use for collection_class "z" backing "z6"; specify a proxy_factory and proxy_bulk_set manually)r   rC   r   r  r$   duck_type_collectionr!   r-  rE   r   rD   r   listr:   _AssociationListr  _AssociationDictr   _AssociationSetr   r   rU   )rh   r   rC   r   r   setters         rW   rw  AssociationProxyInstance._new  s   
 {{"". KK($*;*;< 	
  44_5FG#))..>-?A  ;;$$ ))#doot  ;;%%![[778HONFF![[889IJNFt# $'&$  % $'&$  $ #'&$  ## (($*@*@B rY   c                   U R                   R                  (       a  U R                   R                  X5        g U R                  [        L a  [	        SU5      R                  U5        g U R                  [        L a  [	        SU5      R                  U5        g U R                  [        L a  [	        SU5      R                  U5        g [        R                  " S5      e)Nz_AssociationList[Any]z_AssociationDict[Any, Any]z_AssociationSet[Any]zEno proxy_bulk_set supplied for custom collection_class implementation)r   rF   r   r  r   extendr  updater   r!   r   )rh   r   r   s      rW   _setAssociationProxyInstance._set  s     ;;%%KK&&u5""d*(%077?""d*-u5<<VD""c)'/66v>##2 rY   c                   U R                   R                  =(       a    U R                   R                  =(       d    [        [        U R                  5      nU R                   R
                  (       a)  U R                   R                  U R                  U 5      u  p4O'U R                   R                  U R                  5      u  p4X!l        X1l        XAl	        g rg   )
r   rC   r   r}   r  rD   r   r   r   r  )rh   r   rC   r   r  s        rW   _inflate!AssociationProxyInstance._inflate  s    KK $##9$d&7&78 	 ;;%%![[77%%tNFF "[[889N9NONFrY   Nc                   UR                  SS 5      nU R                  nUb/  UR                  " SSU0UD6nU R                  R                  U5      $ U R                  (       a>  [        U R                  U R                  5      nUR                  R                  " U40 UD6nO?U(       a  [        R                  " S5      eU(       a  Ub  [        R                  " S5      eUnU R                  R                  U5      $ )Nis_has	criterionzJCan't apply keyword arguments to column-targeted association proxy; use ==zINon-empty has() not allowed for column-targeted association proxy; use ==r^   )poprK  _criterion_existsrB  r`  r7  r  r   rA  r!   r   )rh   r  kwargsr  r1  innerrV   
value_exprs           rW   r  *AssociationProxyInstance._criterion_exists
  s    
 Hd+66# 22 #'-E ##55e<<!!4,,doo>D::9OOJ''0  I1''@ 
 #J11*==rY   c                    U R                   cI  U R                  (       a8  U R                  (       a  U R                  (       a  [        R
                  " S5      eU R                  " SUSS.UD6$ )zProduce a proxied 'any' expression using EXISTS.

This expression will be a composed product
using the :meth:`.Relationship.Comparator.any`
and/or :meth:`.Relationship.Comparator.has`
operators of the underlying proxied attributes.

z9'any()' not implemented for scalar attributes. Use has().Fr  r  r^   rK  rZ  r`  r]  r!   r-  r  rh   r  r  s      rW   anyAssociationProxyInstance.any+  se     **2KK++t/D/D))K  %% 

17
 	
rY   c                    U R                   cI  U R                  (       a"  U R                  (       a'  U R                  (       d  [        R
                  " S5      eU R                  " SUSS.UD6$ )zProduce a proxied 'has' expression using EXISTS.

This expression will be a composed product
using the :meth:`.Relationship.Comparator.any`
and/or :meth:`.Relationship.Comparator.has`
operators of the underlying proxied attributes.

z3'has()' not implemented for collections. Use any().Tr  r^   r  r  s      rW   hasAssociationProxyInstance.hasC  se     **2&&t/D/D))E  %% 

06
 	
rY   c                R    U R                   R                  < SU R                  < S3$ )N(r  )	__class__r_   r   r   s    rW   r  !AssociationProxyInstance.__repr__[  s    >>22DKK@@rY   )	rb  rd  r   rz   r  r   r  rU   r   )r   r  r  r   r  r   r   r   )r   zAssociationProxy[_T]r  r   r/  r   rl   r   )r1  &Optional[AssociationProxyInstance[_T]]r   r  r  r   r  r   r   r   rl   r   )rl   zMapperProperty[Any])rl   zPropComparator[Any]rl   r   )r  r   r   r   rl   r  )rl   r  )rl   rN  )rl   rR  )rl   z2Tuple[SQLORMOperations[Any], SQLORMOperations[_T]]rl   r   rl   rv   r   r   )rh   r  r   r  rl   r  )r   r   rl   r:   )r   r   rl   z1Union[Optional[_T], AssociationProxyInstance[_T]])r   r   r   r:   rl   rv   )r   r   rl   rv   )r   z_LazyCollectionProtocol[_T]rl   zTuple[Type[Any], _T])r   r   r   r   rl   rv   )r   r   rl   rv   rg   )r  )Optional[_ColumnExpressionArgument[bool]]r  r   rl   ColumnElement[bool]r  )(r_   r`   ra   rb   r   r   r   classmethodr   r)  r>  propertyrB  rF  r(  r$   memoized_propertyrK  rO  rS  rV   rZ  r]  r`  rY  r   ro_non_memoized_propertyrG   r   r   r   r   rw  r  r  r  r  r  r  rc   r^   rY   rW   r   r   6  s   : *)))%-%  %  	%
 %  ,$,  , 	,
 
&, ,\ < .  	
    
& 8

  

 ,/	/  

	/
 
 
 
 
 
  3 3< 
  

 
 $ $ %$))
( #(	5(, 
""  #  : :& &	:>28-@:@	@D0:G	"( @D><> > 
	>F @D
<
 
 
	
4 @D
<
 
 
	
0ArY   r   c                     ^  \ rS rSrSrSrSS jrSU 4S jjrSS jrSS jr	 S     SS jjr
 S     SS	 jjr\R                  SS
 j5       r    SS jr      SS jrSrU =r$ )r+  i_  z[an :class:`.AssociationProxyInstance` where we cannot determine
the type of target object.
Fc                    [        SU R                  R                  < SU R                  < SU R                  < SU R
                  < S3	5      e)NzAssociation proxy r"  z refers to an attribute 'z'' that is not directly mapped on class ze; therefore this operation cannot proceed since we don't know what type of object is referred towards)r*  r  r_   rU   r   r  r   s    rW   
_ambiguous,AmbiguousAssociationProxyInstance._ambiguousf  s>     !!**&&!!	
 	
rY   c                ,   > Uc  U $ [         TU ]  U5      $ rg   )superr   )rh   r   r  s     rW   r   %AmbiguousAssociationProxyInstance.gett  s    ;K7;s##rY   c                $    U R                  5         g rg   r  rs  s     rW   __eq__(AmbiguousAssociationProxyInstance.__eq__z      rY   c                $    U R                  5         g rg   r  rs  s     rW   __ne__(AmbiguousAssociationProxyInstance.__ne__}  r  rY   c                $    U R                  5         g rg   r  r  s      rW   r  %AmbiguousAssociationProxyInstance.any      
 	rY   c                $    U R                  5         g rg   r  r  s      rW   r  %AmbiguousAssociationProxyInstance.has  r  rY   c                    0 $ rg   r^   r   s    rW   _lookup_cache/AmbiguousAssociationProxyInstance._lookup_cache  s	    
 	rY   c                <   Ubl  [        XR                  5      nUbT   [        U5      nUR                  nUR                  nXPR
                  ;  a  U R                  XT5         U R
                  U   $ U $ ! [         a     U $ f = f! [        R                   a     U $ f = frg   )
r7  rU   r"   r   r   r  _populate_cacher   r!   r   )rh   r/  
actual_objr   r   instance_classs         rW   r   ?AmbiguousAssociationProxyInstance._non_canonical_get_for_object  s     & 2H2HIJ%":.D "[[F%+]]N%-?-??,,^D#11.AA  $   00  s#   B !A2 2
B ?B BBc                   [         R                  " U R                  5      R                  U R                  5      nUR                  UR                  5      (       ai  Un U R                  X@R                  5      nU R                  [        SU5      U R                  U R                  UU R                  5      U R                  U'   g g ! [         a     g f = f)Nr   )r#   r#  r  r$  rU   isar   r(  r   r)  r   r   r  r*  )rh   r  r   r0  r  r1  s         rW   r  1AmbiguousAssociationProxyInstance._populate_cache  s      1 12??""
 ::dkk"")L#BB //  6:5N5N7FKK%% OO6"">2 # " s   C 
CCr^   r  )r   r   rl   r   )r   r  rl   r   rg   )r  r  r  r   rl   r   )rl   z-Dict[Type[Any], AssociationProxyInstance[_T]])r/  r   rl   r   )r  r   r   zMapper[Any]rl   rv   )r_   r`   ra   rb   r   r   r  r   r  r  r  r  r$   r  r  r   r  rc   __classcell__)r  s   @rW   r+  r+  _  s     M
$
 @D<  
	 @D<  
	 
 "	%2!+6	 rY   r+  c                  J    \ rS rSr% SrSrS\S'   SrSS jrSS jr	SS jr
S	rg
)r6  i  zEan :class:`.AssociationProxyInstance` that has an object as a target.Tr   r`  c                ~   U R                   nUbC  U R                  R                  UR                  (       d  UR	                  U5      5      $ X1:H  5      $ U R
                  (       aj  U R                  (       aY  U R                  (       dH  U R                  R                  [        U R                  U R                  5      R	                  U5      5      $ U R
                  (       a8  U R                  (       a'  U R                  (       a  [        R                  " S5      eU R                  R                  " S0 U R                  U0D6$ )a  Produce a proxied 'contains' expression using EXISTS.

This expression will be a composed product
using the :meth:`.Relationship.Comparator.any`,
:meth:`.Relationship.Comparator.has`,
and/or :meth:`.Relationship.Comparator.contains`
operators of the underlying proxied attributes.
z<contains() doesn't apply to a scalar object endpoint; use ==r^   )rK  rB  r  rZ  containsr`  r]  r  r7  r  r   r!   r-  )rh   otherkwr1  s       rW   r  'ObjectAssociationProxyInstance.contains  s    66###55#** %%e,  "*  ""))##''))4??;DDUK  ##8M8M))N  ##55 ??E* rY   c                    Uc?  [        U R                  R                  " S0 U R                  U0D6U R                  S :H  5      $ U R                  R                  " S0 U R                  U0D6$ Nr^   )r.   rB  r  r   rs  s     rW   r  %ObjectAssociationProxyInstance.__eq__  si     ;  $$>'=>  D( 
 ##''A4??C*@AArY   c                z    U R                   R                  [        U R                  U R                  5      U:g  5      $ rg   )rB  r  r7  r  r   rs  s     rW   r  %ObjectAssociationProxyInstance.__ne__  s6     ##D%%t73>
 	
rY   r^   N)r  r   r  r   rl   r  )r   r   rl   r  )r_   r`   ra   rb   r   r`  r   r   r  r  r  rc   r^   rY   rW   r6  r6    s&    O"t"M D	B
rY   r6  c                  P    \ rS rSr% SrSrS\S'   SrSS jr        SS jr	S	r
g
)r:  i  zNan :class:`.AssociationProxyInstance` that has a database column as a
target.
Fr   r`  Tc                    U R                  U R                  R                  [        R                  U5      5      nUc  [        X R                  S :H  5      $ U$ rg   )r  rO  operater-   eqr.   rB  )rh   r  exprs      rW   r  %ColumnAssociationProxyInstance.__eq__
  sN    %%$$Y\\59
 =t--566KrY   c                `    U R                  U R                  R                  " U/UQ70 UD65      $ rg   )r  rO  r  )rh   opr  r  s       rW   r  &ColumnAssociationProxyInstance.operate  s5     %%$$R:%:6:
 	
rY   r^   N)r  r   rl   r  )r  zoperators.OperatorTyper  r   r  r   rl   zColumnElement[Any])r_   r`   ra   rb   r   r`  r   r   r  r  rc   r^   rY   rW   r:  r:    sC     $t#M
(
25
AD
	
rY   r:  c                  @    \ rS rSrSS jr  S	S jrS
S jrSS jrSrg)rx  i  c                    Xl         X l        g rg   r   ry  r  s      rW   r   _lazy_collection.__init__  s    rY   c                B    [        U R                  U R                  5      $ rg   )r7  r   ry  r   s    rW   rj   _lazy_collection.__call__!  s     t{{DKK00rY   c                4    U R                   U R                  S.$ )N)r   ry  r  r   s    rW   __getstate___lazy_collection.__getstate__&  s    {{dkk::rY   c                ,    US   U l         US   U l        g )Nr   ry  r  rh   states     rW   __setstate___lazy_collection.__setstate__)  s    ElHorY   r  N)r   r   ry  r   r   rl   r   r  r   rl   rv   )	r_   r`   ra   rb   r   rj   r  r  rc   r^   rY   rW   rx  rx    s    1	L1
;&rY   rx  _ITr   c                      \ rS rSr% S\S'    S\S'    S\S'   S\S	'    S
\S'              SS jr\R                  (       a  S\S'   O	\" S 5      r	SS jr
SS jrSS jrSS jrSS jrSrg)_AssociationCollectioni8  _GetterProtocol[_IT]r   r}   rC   AssociationProxyInstance[_IT]r   ro   r  _LazyCollectionProtocol[_IT]r   c                @    Xl         X l        X0l        X@l        XPl        g)zConstructs an _AssociationCollection.

This will always be a subclass of either _AssociationList,
_AssociationSet, or _AssociationDict.

N)r   rC   r   r  r   )rh   r   rC   r   r  r   s         rW   r   _AssociationCollection.__init__O  s      /rY   zCollection[_IT]colc                "    U R                  5       $ rg   )r   r   s    rW   <lambda>_AssociationCollection.<lambda>f  s    D$8$8$:rY   c                ,    [        U R                  5      $ rg   lenr   r   s    rW   __len___AssociationCollection.__len__h      488}rY   c                ,    [        U R                  5      $ rg   )r   r   r   s    rW   __bool___AssociationCollection.__bool__k  s    DHH~rY   c                4    U R                   U R                  S.$ )Nr   r   r  r   s    rW   r  #_AssociationCollection.__getstate__n  s    ++$:N:NOOrY   c                b    US   U l         US   U l        U R                   R                  U 5        g )Nr   r   )r   r   r  r  s     rW   r  #_AssociationCollection.__setstate__q  s-    Ho$%67T"rY   c                    [        5       erg   rE  r   s    rW   clear_AssociationCollection.clearv  s    !##rY   )rC   r   r   r   r  N)
r   r  rC   r}   r   r  r  ro   r   r  rl   intr  r  r  r  )r_   r`   ra   rb   r   r   typingTYPE_CHECKINGr  r   r  r  r  r  r  rc   r^   rY   rW   r  r  8  s      F *) 21F5 " %	
   .( :;P#
$rY   r  c                  T    \ rS rSr% S\S'   S\S'   SS jrSS jr      SS jrS	rg
)_AssociationSingleItemiz  rc  r  r}  rC   c                $    U R                  U5      $ rg   rC   r   s     rW   _create_AssociationSingleItem._create~  s    ||E""rY   c                $    U R                  U5      $ rg   r   rh   object_s     rW   _get_AssociationSingleItem._get      {{7##rY   c                F    U R                  5         UR                  X5        g rg   )r  r  )rh   assoc_proxyr   s      rW   r~  $_AssociationSingleItem._bulk_replace  s     	

&rY   r^   N)rt   r:   rl   r   )r"  r   rl   r:   )r'  r   r   zIterable[_IT]rl   rv   )	r_   r`   ra   rb   r   r  r#  r~  rc   r^   rY   rW   r  r  z  s5    $$&&#$'8'BO'	'rY   r  c                  Z   \ rS rSr% SrS\S'   S-S jr\S.S j5       r\S/S j5       r    S0S jr\S1S	 j5       r	\S2S
 j5       r	      S3S jr	\S4S j5       r
\S5S j5       r
S6S jr
S7S jrS8S jrS9S jrS:S jrS;S jrS1S jrS<S.S jjrS9S jrS=S jrS=S jrS>S jrS?S jrS?S jrS@S jrS@S jrS@S jrS@S jrSAS  jrSAS! jrSBS" jrSBS# jrSCS$ jr SDS% jr!\"RF                  (       a   SE       SFS& jjr$OS:S' jr$SGS( jr%SHS) jr&S=S* jr'\"RF                  (       d  \(" \)" 5       RU                  5       5       Hb  u  r+r,\-" \,5      (       d  M  \,R                   \+:X  d  M'  \,R                  (       a  M:  \." \(\+5      (       d  MJ  \/" \(\+5      R                  \,l        Md     C+C,S+r0g,S+r0g,)Ir  i  z(Generic, converting, list-to-list proxy.MutableSequence[_T]r   c                &    U R                  X5        g rg   r  )rh   r"  rt   s      rW   r  _AssociationList._set  s    G#rY   c                    g rg   r^   rh   indexs     rW   __getitem___AssociationList.__getitem__      -0rY   c                    g rg   r^   r/  s     rW   r1  r2    s    @CrY   c                    [        U[        5      (       d  U R                  U R                  U   5      $ U R                  U    Vs/ s H  o R                  U5      PM     sn$ s  snf rg   )r%  slicer#  r   )rh   r0  members      rW   r1  r2    sO     %''99TXXe_--48HHUODO&IIf%ODDDs   A"c                    g rg   r^   rh   r0  rt   s      rW   __setitem___AssociationList.__setitem__  s    :=rY   c                    g rg   r^   r9  s      rW   r:  r;    s    FIrY   c                   [        U[        5      (       d*  U R                  U R                  U   [	        SU5      5        g UR
                  c  [        U 5      nO5UR
                  S:  a  [        U 5      UR
                  -   nOUR
                  nUR                  =(       d    SnUR                  =(       d    Sn[        [        UR                  =(       d    SX45      5      n[        U5      nUS:X  a-  U H  nX	 M     UnU H  n	U R                  X5        US-  nM     g [        U5      [        U5      :w  a%  [        S[        U5      < S[        U5      < 35      e[        Xb5       H$  u  pU R                  U R                  U   U	5        M&     g )Nr:   r      z#attempt to assign sequence of size z to extended slice of size )r%  r6  r  r   r   stopr  stepstartr  rangeinsert
ValueErrorzip)
rh   r0  rt   r?  r@  rA  rngsized_valueiitems
             rW   r:  r;    s<    %''IIdhhuotD%'89zz!4ya4y5::-zz::?DKK$1EuU[[-At:;Cu+KqyA 'DKK(FA ( {#s3x/$ {+SX7 
  #3GAIIdhhqk40  /rY   c                    g rg   r^   r/  s     rW   __delitem___AssociationList.__delitem__  s    /2rY   c                    g rg   r^   r/  s     rW   rK  rL    s    14rY   c                    U R                   U	 g rg   r   r/  s     rW   rK  rL    s    HHUOrY   c                X    U R                    H  nU R                  U5      U:X  d  M    g   gNTFr   r#  )rh   rt   r7  s      rW   __contains___AssociationList.__contains__  s)    hhFyy E)  rY   c              #  X   #    U R                    H  nU R                  U5      v   M     g7f)zIterate over proxied values.

For the actual domain objects, iterate over .col instead or
just use the underlying collection directly from its property
on the parent.
NrR  rh   r7  s     rW   __iter___AssociationList.__iter__  s'      hhF))F##    (*c                `    U R                   nU R                  U5      nUR                  U5        g rg   )r   r  append)rh   rt   r   rI  s       rW   r[  _AssociationList.append  s%    hh||E"

4rY   c                4    SnU  H  nX1:X  d  M
  US-  nM     U$ Nr   r>  r^   )rh   rt   countr  s       rW   r_  _AssociationList.count  s&    Az
  rY   c                8    U H  nU R                  U5        M     g rg   )r[  )rh   r   r  s      rW   r  _AssociationList.extend  s    AKKN rY   c                @    U R                  U5      /U R                  X& g rg   )r  r   r9  s      rW   rC  _AssociationList.insert  s    !%e!4 5rY   c                V    U R                  U R                  R                  U5      5      $ rg   )r   r   r  r/  s     rW   r  _AssociationList.pop  s    {{488<<.//rY   c                h    [        U 5       H  u  p#X1:X  d  M  U R                  U	   g    [        S5      e)Nzvalue not in list)	enumerater   rD  )rh   rt   rH  vals       rW   remove_AssociationList.remove  s3    oFA|HHQK & ,--rY   c                    [        5       e)z#Not supported, use reversed(mylist)rE  r   s    rW   reverse_AssociationList.reverse       "##rY   c                    [        5       e)z!Not supported, use sorted(mylist)rE  r   s    rW   sort_AssociationList.sort	  ro  rY   c                H    U R                   S[        U R                   5      2	 g )Nr   )r   r  r   s    rW   r  _AssociationList.clear  s    HHQTXX&'rY   c                    [        U 5      U:H  $ rg   r  rh   r  s     rW   r  _AssociationList.__eq__      DzU""rY   c                    [        U 5      U:g  $ rg   rv  rw  s     rW   r  _AssociationList.__ne__  ry  rY   c                    [        U 5      U:  $ rg   rv  rw  s     rW   __lt___AssociationList.__lt__      DzE!!rY   c                    [        U 5      U:*  $ rg   rv  rw  s     rW   __le___AssociationList.__le__  ry  rY   c                    [        U 5      U:  $ rg   rv  rw  s     rW   __gt___AssociationList.__gt__  r  rY   c                    [        U 5      U:  $ rg   rv  rw  s     rW   __ge___AssociationList.__ge__   ry  rY   c                b     [        U5      n[        U 5      U-   $ ! [         a	    [        s $ f = frg   r  	TypeErrorNotImplementedrw  s     rW   __add___AssociationList.__add__#  s8    	"KE DzE!!  	"!!	"    ..c                b     [        U5      nU[        U 5      -   $ ! [         a	    [        s $ f = frg   r  rw  s     rW   __radd___AssociationList.__radd__*  s8    	"KE tDz!!  	"!!	"r  c                T    [        U[        5      (       d  [        $ [        U 5      U-  $ rg   r%  r  r  r  rh   ns     rW   __mul___AssociationList.__mul__1  s#    !S!!!!DzA~rY   c                T    [        U[        5      (       d  [        $ U[        U 5      -  $ rg   r  r  s     rW   __rmul___AssociationList.__rmul__6  s#    !S!!!!4:~rY   c                (    U R                  U5        U $ rg   )r  )rh   iterables     rW   __iadd___AssociationList.__iadd__;  s    HrY   c                    [        U[        5      (       d
  [        5       eUS:X  a  U R                  5         U $ US:  a   U R	                  [        U 5      US-
  -  5        U $ r^  )r%  r  r'  r  r  r  r  s     rW   __imul___AssociationList.__imul__?  sX    
 !S!!%''6JJL  UKKT
a!e,-rY   c                    g rg   r^   )rh   rt   rA  r?  s       rW   r0  _AssociationList.indexN  s    rY   c                >    [        U 5      nUR                  " U/UQ76 $ rg   )r  r0  )rh   rt   arglss       rW   r0  r  T  s    dB88E(C((rY   c                    [        U 5      $ rg   rv  r   s    rW   copy_AssociationList.copyX  s    DzrY   c                *    [        [        U 5      5      $ rg   )rK   r  r   s    rW   r  _AssociationList.__repr__[      DJrY   c                D    [        S[        U 5      R                  -  5      eNz%s objects are unhashabler  r   r_   r   s    rW   __hash___AssociationList.__hash__^      3d4j6I6IIJJrY   r^   N)r"  r   rt   r:   rl   rv   )r0  r  rl   r:   )r0  r6  rl   r*  )r0  Union[int, slice]rl   zUnion[_T, MutableSequence[_T]])r0  r  rt   r:   rl   rv   )r0  r6  rt   Iterable[_T]rl   rv   )r0  r  rt   zUnion[_T, Iterable[_T]]rl   rv   )r0  r  rl   rv   )r0  r6  rl   rv   )r0  zUnion[slice, int]rl   rv   )rt   r  rl   r   rl   zIterator[_T])rt   r:   rl   rv   )rt   r   rl   r  )r   r  rl   rv   )r  r  r  r  rl   r   )r  List[_T]rl   r   )r  r  rl   r  )r  r3   rl   r  )r  r  rl   r2   )r  r3   rl   r2   )..)rt   r   rA  r  r?  r  rl   r  )rl   r  r  )1r_   r`   ra   rb   r   r   r  r   r1  r:  rK  rS  rW  r[  r_  r  rC  r  rj  rm  rq  r  r  r  r}  r  r  r  r  r  r  r  r  r  r  r  r0  r  r  r  r  localsitems	func_namefunccallabler8  r7  rc   r^   rY   rW   r  r    s   2	$ 0 0C CE&E	'E = =I I"1&"1/F"1	"1H 2 24 4

60.$
$
(##"#"#""

  =@		%(	69			) K #FHNN$45OItMMY.D),,&tY7??  6 t  rY   r  c                      \ rS rSr% SrS\S'   S\S'   S\S'   S)S	 jrS*S
 jrS+S jrS,S jr	S-S jr
S.S jrS/S jrS0S jrS1S jrS2S jrS2S jrS3S jr\S4S j5       r\S5S j5       r S6     S7S jjrS6S8S jjrS9S jrS:S jrS;S jr\S<S j5       r\ S=     S5S jj5       rS>S jrS?S  jr\      S@S! j5       r\      SAS" j5       r\SBS# j5       rSCS$ jr      SDS% jrSES& jrSFS' jr\R>                  (       d  \ " \!" 5       R-                  5       5       Hb  u  r"r#\$" \#5      (       d  M  \#R                   \":X  d  M'  \#R                  (       a  M:  \%" \&\"5      (       d  MJ  \'" \&\"5      R                  \#l        Md     C"C#S(r(gS(r(g)Gr  im  z(Generic, converting, dict-to-dict proxy.z_DictSetterProtocol[_VT]r  z_KeyCreatorProtocol[_VT]rC   z"MutableMapping[_KT, Optional[_VT]]r   c                $    U R                  X5      $ rg   r  r   s      rW   r  _AssociationDict._createt  s    ||C''rY   c                $    U R                  U5      $ rg   r   r!  s     rW   r#  _AssociationDict._getw  r%  rY   c                &    U R                  XU5      $ rg   r,  )rh   r"  rz   rt   s       rW   r  _AssociationDict._setz  s    {{7//rY   c                >    U R                  U R                  U   5      $ rg   )r#  r   rh   rz   s     rW   r1  _AssociationDict.__getitem__}  s    yy#''rY   c                    XR                   ;   a   U R                  U R                   U   X5        g U R                  X5      U R                   U'   g rg   )r   r  r  r   s      rW   r:  _AssociationDict.__setitem__  s7    ((?IIdhhsmS0 LL4DHHSMrY   c                    U R                   U	 g rg   rO  r  s     rW   rK  _AssociationDict.__delitem__  s    HHSMrY   c                    XR                   ;   $ rg   rO  r  s     rW   rS  _AssociationDict.__contains__  s    hhrY   c                H    [        U R                  R                  5       5      $ rg   )iterr   keysr   s    rW   rW  _AssociationDict.__iter__  s    DHHMMO$$rY   c                8    U R                   R                  5         g rg   r   r  r   s    rW   r  _AssociationDict.clear      rY   c                    [        U 5      U:H  $ rg   r  rw  s     rW   r  _AssociationDict.__eq__  ry  rY   c                    [        U 5      U:g  $ rg   r  rw  s     rW   r  _AssociationDict.__ne__  ry  rY   c                *    [        [        U 5      5      $ rg   )rK   r  r   s    rW   r  _AssociationDict.__repr__  r  rY   c                    g rg   r^   rh   _AssociationDict__keys     rW   r   _AssociationDict.get  s    03rY   c                    g rg   r^   rh   r  rL   s      rW   r   r    s    JMrY   Nc                0     X   $ ! [          a    Us $ f = frg   )r   rh   rz   rL   s      rW   r   r    s#    	9 	N	s    c                h    XR                   ;  a   U R                  X5      U R                   U'   U$ X   $ rg   )r   r  r  s      rW   
setdefault_AssociationDict.setdefault  s1     hh LL6DHHSMN9rY   c                6    U R                   R                  5       $ rg   )r   r  r   s    rW   r  _AssociationDict.keys  s    xx}}rY   c                    [        U 5      $ rg   r   r   s    rW   r  _AssociationDict.items  s    rY   c                    [        U 5      $ rg   r   r   s    rW   r   _AssociationDict.values  s    $rY   c                    g rg   r^   r  s     rW   r  _AssociationDict.pop  s    &)rY   c                    g rg   r^   r  s      rW   r  r    s     rY   c                d    U R                   R                  " U/UQ70 UD6nU R                  U5      $ rg   )r   r  r#  )rh   r  r  r  r7  s        rW   r  r    s-    e0c0R0yy  rY   c                h    U R                   R                  5       nUS   U R                  US   5      4$ r^  )r   popitemr#  )rh   rI  s     rW   r  _AssociationDict.popitem  s0    xx!Q47+,,rY   c                    g rg   r^   rh   _AssociationDict__mr  s      rW   r  _AssociationDict.update  r   rY   c                    g rg   r^   r  s      rW   r  r    r   rY   c                    g rg   r^   )rh   r  s     rW   r  r    r3  rY   c                f    0 nUR                   " U0 UD6  UR                  5        H	  u  pEXPU'   M     g rg   )r  r  )rh   ar  uprz   rt   s         rW   r  r    s1    
		1((*JCI %rY   c                <   [        U 5      nUR                  U=(       d    S5      n[        U=(       d    S5      R                  U5      nUR                  U5      nUR                  5       =(       d    S H  u  pxXu;   a  XU'   M  Xt;   d  M  XU'   M     U H  nX	 M     g r  )r   intersection
differencer  )	rh   r'  r   existing	constants	additionsremovalsrz   r7  s	            rW   r~  _AssociationDict._bulk_replace  s    
 t9))&,B7	"%00;	&&y1!<<>/R/KC"S	!"S		 0 C	 rY   c                4    [        U R                  5       5      $ rg   )r  r  r   s    rW   r  _AssociationDict.copy  s    DJJL!!rY   c                D    [        S[        U 5      R                  -  5      er  r  r   s    rW   r  _AssociationDict.__hash__  r  rY   r^   )rz   rA   rt   Optional[_VT]rl   r   )r"  r   rl   rB   )r"  r   rz   rA   rt   rB   rl   rv   )rz   rA   rl   rB   )rz   rA   rt   rB   rl   rv   )rz   rA   rl   rv   )rz   r  rl   r   )rl   zIterator[_KT]r  r  r  )r  rA   rl   r  )r  rA   rL   Union[_VT, _T]rl   r  rg   )rz   rA   rL   zOptional[Union[_VT, _T]]rl   zUnion[_VT, _T, None])rz   rA   rL   r  rl   rB   )rl   zKeysView[_KT])rl   zItemsView[_KT, _VT])rl   zValuesView[_VT])r  rA   rl   rB   ).)r  rA   r  r   r  r   rl   r  )rl   zTuple[_KT, _VT])r  z SupportsKeysAndGetItem[_KT, _VT]r  rB   rl   rv   )r  zIterable[tuple[_KT, _VT]]r  rB   rl   rv   )r  rB   rl   rv   )r  r   r  r   rl   rv   )r'  r   r   zMapping[_KT, _VT]rl   rv   )rl   zDict[_KT, _VT]r  ))r_   r`   ra   rb   r   r   r  r#  r  r1  r:  rK  rS  rW  r  r  r  r  r   r   r  r  r  r   r  r  r  r~  r  r  r  r  r  r  r  r  r  r8  r  r7  rc   r^   rY   rW   r  r  m  s   2$$%%	++($0(5%##  3 3M M =A!9	
  ) )47#1	 !- 3?B	  ,8;	  0 02 " 
	&"K #FHNN$45OItMMY.D),,&tY7??  6 t  rY   r  c                     \ rS rSr% SrS\S'   S-S jrS.S jrS/S jrS0S jr	S1S	 jr
S1S
 jrS1S jrS2S jrS3S jrS4S jr    S5S jrS6S jrS7S jrS8S jrS9S jrS:S jrS;S jrS<S jrS9S jrS:S jrS;S jrS<S jrS=S jrS>S jrS?S jrS5S jrS@S jr S@S  jr!SAS! jr"SBS" jr#SCS# jr$SCS$ jr%SDS% jr&SDS& jr'SDS' jr(SDS( jr)SES) jr*SFS* jr+\,RZ                  (       d  \." \/" 5       Ra                  5       5       Hb  u  r1r2\3" \25      (       d  M  \2R                   \1:X  d  M'  \2R                  (       a  M:  \4" \5\15      (       d  MJ  \6" \5\15      R                  \2l        Md     C1C2S+r7g,S+r7g,)Gr  i  z&Generic, converting, set-to-set proxy.MutableSet[_T]r   c                ,    [        U R                  5      $ rg   r  r   s    rW   r  _AssociationSet.__len__  r	  rY   c                (    U R                   (       a  ggrQ  rO  r   s    rW   r  _AssociationSet.__bool__  s    88rY   c                X    U R                    H  nU R                  U5      U:X  d  M    g   grQ  rR  )rh   _AssociationSet__or7  s      rW   rS  _AssociationSet.__contains__  s)    hhFyy C'  rY   c              #  X   #    U R                    H  nU R                  U5      v   M     g7f)zIterate over proxied values.

For the actual domain objects, iterate over .col instead or just use
the underlying collection directly from its property on the parent.

NrR  rV  s     rW   rW  _AssociationSet.__iter__  s'      hhF))F## rY  c                d    X;  a+  U R                   R                  U R                  U5      5        g g rg   )r   addr  )rh   _AssociationSet__elements     rW   r  _AssociationSet.add&  s&     HHLLi01 !rY   c                    U R                    H5  nU R                  U5      U:X  d  M  U R                   R                  U5          g    g rg   )r   r#  discardrh   r  r7  s      rW   r  _AssociationSet.discard,  s6    hhFyy I-  ( rY   c                    U R                    H5  nU R                  U5      U:X  d  M  U R                   R                  U5          g    [        U5      erg   )r   r#  r  r   r  s      rW   rj  _AssociationSet.remove2  sC    hhFyy I-  (  y!!rY   c                    U R                   (       d  [        S5      eU R                   R                  5       nU R                  U5      $ )Nzpop from an empty set)r   r   r  r#  rV  s     rW   r  _AssociationSet.pop9  s3    xx233yy  rY   c                J    U H  nU H  nU R                  U5        M     M     g rg   )r  )rh   sr  rt   s       rW   r  _AssociationSet.update?  s!    H! " rY   c                h   [        U 5      nUR                  U=(       d    S5      n[        U=(       d    S5      R                  U5      nUR                  U5      nU R                  nU R                  nU=(       d    S H!  n	X;   a
  U" U	5        M  X;   d  M  U" U	5        M#     U H  n	U" U	5        M     g r  )r   r   r  r  rj  )
rh   r'  r   r  r  r  r  appenderremoverr7  s
             rW   r~  _AssociationSet._bulk_replaceD  s    t9))&,B7	"%00;	&&y188++llF" $ 	 # FFO rY   c                    [         R                  " X5      (       d
  [        5       eU H  nU R                  U5        M     U $ rg   )r%   _set_binops_check_strictr'  r  )rh   r  rt   s      rW   __ior___AssociationSet.__ior__V  s8     33D@@%''EHHUO rY   c                *    [        [        U 5      5      $ rg   )r   r  r   s    rW   r  _AssociationSet._set_  s    4:rY   c                2    [        U 5      R                  " U6 $ rg   )r   unionrh   r%  s     rW   r2  _AssociationSet.unionb  s    4y""rY   c                $    U R                  U5      $ rg   )r2  rh   _AssociationSet__ss     rW   __or___AssociationSet.__or__e  s    zz#rY   c                2    [        U 5      R                  " U6 $ rg   )r   r  r3  s     rW   r  _AssociationSet.differenceh  s    4y##Q''rY   c                $    U R                  U5      $ rg   )r  r3  s     rW   __sub___AssociationSet.__sub__k  s    q!!rY   c                J    U H  nU H  nU R                  U5        M     M     g rg   )r  )rh   r%  r  rt   s       rW   difference_update!_AssociationSet.difference_updaten  s"    EU#  rY   c                    [         R                  " X5      (       d
  [        5       eU H  nU R                  U5        M     U $ rg   )r%   r,  r'  r  )rh   r%  rt   s      rW   __isub___AssociationSet.__isub__s  s7    33D<<%''ELL rY   c                2    [        U 5      R                  " U6 $ rg   )r   r   r3  s     rW   r   _AssociationSet.intersectionz  s    4y%%q))rY   c                $    U R                  U5      $ rg   )r   r3  s     rW   __and___AssociationSet.__and__}  s      ##rY   c                    U HY  nU R                  U5      [        U 5      pCXC-
  X4-
  peU H  nU R                  U5        M     U H  nU R                  U5        M     M[     g rg   )r   r   rj  r  )rh   r%  r  wanthaverj  r  rt   s           rW   intersection_update#_AssociationSet.intersection_update  sX    E**513t9$+t{CE"    rY   c                    [         R                  " X5      (       d
  [        5       eU R                  U5      n[	        U 5      nX2-
  X#-
  pTU H  nU R                  U5        M     U H  nU R                  U5        M     U $ rg   )r%   r,  r'  r   r   rj  r  )rh   r%  rK  rL  rj  r  rt   s          rW   __iand___AssociationSet.__iand__  sp    33D<<%''  #D	k4;EKK EHHUO rY   c                6    [        U 5      R                  U5      $ rg   )r   symmetric_differencer6  s     rW   rS  $_AssociationSet.symmetric_difference  s    4y--c22rY   c                $    U R                  U5      $ rg   )rS  r3  s     rW   __xor___AssociationSet.__xor__  s    ((++rY   c                    U R                  U5      [        U 5      p2X2-
  X#-
  pTU H  nU R                  U5        M     U H  nU R                  U5        M     g rg   )rS  r   rj  r  )rh   r  rK  rL  rj  r  rt   s          rW   symmetric_difference_update+_AssociationSet.symmetric_difference_update  sN    ..u5s4ydk4;EKK EHHUO rY   c                r    [         R                  " X5      (       d
  [        5       eU R                  U5        U $ rg   )r%   r,  r'  rY  rw  s     rW   __ixor___AssociationSet.__ixor__  s/    33D@@%''((/rY   c                6    [        U 5      R                  U5      $ rg   )r   issubsetr6  s     rW   r_  _AssociationSet.issubset  s    4y!!#&&rY   c                6    [        U 5      R                  U5      $ rg   )r   
issupersetr6  s     rW   rb  _AssociationSet.issuperset  s    4y##C((rY   c                8    U R                   R                  5         g rg   r  r   s    rW   r  _AssociationSet.clear  r  rY   c                    [        U 5      $ rg   r   r   s    rW   r  _AssociationSet.copy  s    4yrY   c                    [        U 5      U:H  $ rg   rg  rw  s     rW   r  _AssociationSet.__eq__      4yE!!rY   c                    [        U 5      U:g  $ rg   rg  rw  s     rW   r  _AssociationSet.__ne__  rk  rY   c                    [        U 5      U:  $ rg   rg  rw  s     rW   r}  _AssociationSet.__lt__      4y5  rY   c                    [        U 5      U:*  $ rg   rg  rw  s     rW   r  _AssociationSet.__le__  rk  rY   c                    [        U 5      U:  $ rg   rg  rw  s     rW   r  _AssociationSet.__gt__  rp  rY   c                    [        U 5      U:  $ rg   rg  rw  s     rW   r  _AssociationSet.__ge__  rk  rY   c                *    [        [        U 5      5      $ rg   )rK   r   r   s    rW   r  _AssociationSet.__repr__  s    CIrY   c                D    [        S[        U 5      R                  -  5      er  r  r   s    rW   r  _AssociationSet.__hash__  r  rY   r^   Nr  r  )r  r  rl   r   r  )r  r:   rl   rv   )rl   r:   )r%  r  rl   rv   )r'  r   r   r  rl   rv   )r  AbstractSet[_S]rl   MutableSet[Union[_T, _S]])rl   zSet[_T])r%  zIterable[_S]rl   r|  )r7  r{  rl   r|  )r%  r   rl   r  )r%  AbstractSet[Any]rl   r  )r%  r   rl   rv   )r%  r}  rl   r2   )r7  r  rl   r  )r%  r{  rl   r|  )r  r   rl   rv   )r7  r   rl   r   r  )rl   zAbstractSet[_T]r  )r  r}  rl   r   r  r  )8r_   r`   ra   rb   r   r   r  r  rS  rW  r  r  rj  r  r  r~  r-  r  r2  r8  r  r=  r@  rC  r   rH  rM  rP  rS  rV  rY  r\  r_  rb  r  r  r  r  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r8  r   r7  rc   r^   rY   rW   r  r    sL   0		2"! 
$$	"#("$
*$	 3,')""!"!"K #FHNN$45OItMMY.C++&sI6>>  6 t  rY   r  )"rU   r   rV   r   rC   r   rD   r   rE   r   rF   r   rG   r  rH   r   rI   r   rJ   Union[_NoArg, bool]rK   r~  rL   r	  rM   zUnion[_NoArg, Callable[[], _T]]rN   r~  rO   r~  rP   zUnion[_NoArg, bool, None]rl   zAssociationProxy[Any])dr   
__future__r   r  r  r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r    r!   r"   r#   r$   r%   r&   r'   r(   orm.baser)   orm.interfacesr*   r+   r,   sqlr-   r.   sql.baser/   util.typingr0   r1   r2   r3   r4   r  r5   r6   
orm.mapperr7   sql._typingr8   r9   r:   r<   r>   r@   rA   rB   NO_ARGrX   r[   re   ro   rr   rx   r}   r   r   r   r   r   r   r   InspectionAttrInforT   r  r   r+  r6  r:  rx  r  r  r  r  r  r  r^   rY   rW   <module>r     s   #                ! "                 -   ' . 0 7    ! "  ' 0	//#7' Tsd3	D	9Te3e3 +/7;596: $#(&+ & &#]]7=}}#)==#)==&,mm#ff
f (	f
 5f 3f 4f f !f  $f f f f 5f !f  !!f" $#f$ %fR$? 4huo 4
 %h $B?HV,< BL/8F+; L
 &x %2,hv.> 2F*HV,< Fhrl ;X ;H H ; ;4O
!!"b!	O
j 	>?fA/3 fARe(@(D eP8
%=b%A 8
v
%=b%A 
4&.r2 &$ e5!?$WS\ ?$D'3B7 '"_-b1?23F _DW-c2N384L WtV,R0*R. VrY   