ó
    Ñ]j9Ì  ã            
      ó|  • % S r SSKJr  SSK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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!  \R$                  (       a*  SSK"J#r#  SSK"J$r$  SSK%J&q&  SSK%J'q'  SSK%J(q(  SS K%J)q)  SS!K*J+r+  / S"Qr,\RZ                  " 5       r.\/ S#4   r/\" S$\S%9r0\" S&\S%9r1\" S'\S%9r2\" S(S)S%9r3\" S*S+S%9r4 " S, S-\!5      r5 " S. S#\!5      r6 " S/ S05      r7\(       a  SXS2 jr8O\Rr                  " S35      r8 " S4 S15      r:SYS5 jr;    SZS6 jr<S7 r=S8 r>S9 r?S: r@S; rAS< rBSYS= jrCS> rDS? rESYS@ jrFS[SA jrGS[SB jrH\I\J4rKS\SC jrLS\SD jrMS[SE jrN " SF SG\\0   5      rO " SH SI\\0   5      rP " SJ SK\
\1\24   5      rQ\R¤                  " \S\O\I\P\T\Q05      rUSL\VSM'   \R¤                  " \SSNSOSPSQ.\G" 5       4\ISRSOSPSQ.\N" 5       4\TSSST0\H" 5       405      rWSU\VSV'   SW rX\X" \Y" 5       5        g)]aL  Support for collections of mapped entities.

The collections package supplies the machinery used to inform the ORM of
collection membership changes.  An instrumentation via decoration approach is
used, allowing arbitrary types (including built-ins) to be used as entity
collections without requiring inheritance from a base class.

Instrumentation decoration relays membership change events to the
:class:`.CollectionAttributeImpl` that is currently managing the collection.
The decorators observe function call arguments and return values, tracking
entities entering or leaving the collection.  Two decorator approaches are
provided.  One is a bundle of generic decorators that map function arguments
and return values to events::

  from sqlalchemy.orm.collections import collection


  class MyClass:
      # ...

      @collection.adds(1)
      def store(self, item):
          self.data.append(item)

      @collection.removes_return()
      def pop(self):
          return self.data.pop()

The second approach is a bundle of targeted decorators that wrap appropriate
append and remove notifiers around the mutation methods present in the
standard Python ``list``, ``set`` and ``dict`` interfaces.  These could be
specified in terms of generic decorator recipes, but are instead hand-tooled
for increased efficiency.  The targeted decorators occasionally implement
adapter-like behavior, such as mapping bulk-set methods (``extend``,
``update``, ``__setslice__``, etc.) into the series of atomic mutation events
that the ORM requires.

The targeted decorators are used internally for automatic instrumentation of
entity collection classes.  Every collection class goes through a
transformation process roughly like so:

1. If the class is a built-in, substitute a trivial sub-class
2. Is this class already instrumented?
3. Add in generic decorators
4. Sniff out the collection interface through duck-typing
5. Add targeted decoration to any undecorated interface method

This process modifies the class at runtime, decorating methods and adding some
bookkeeping properties.  This isn't possible (or desirable) for built-in
classes like ``list``, so trivial sub-classes are substituted to hold
decoration::

  class InstrumentedList(list):
      pass

Collection classes can be specified in ``relationship(collection_class=)`` as
types or a function that returns an instance.  Collection classes are
inspected and instrumented during the mapper compilation phase.  The
collection_class callable will be executed once to produce a specimen
instance, and the type of that specimen will be instrumented.  Functions that
return built-in types like ``lists`` will be adapted to produce instrumented
instances.

When extending a known type like ``list``, additional decorations are not
generally not needed.  Odds are, the extension method will delegate to a
method that's already instrumented.  For example::

  class QueueIsh(list):
      def push(self, item):
          self.append(item)

      def shift(self):
          return self.pop(0)

There's no need to decorate these methods.  ``append`` and ``pop`` are already
instrumented as part of the ``list`` interface.  Decorating them would fire
duplicate events, which should be avoided.

The targeted decoration tries not to rely on other methods in the underlying
collection class, but some are unavoidable.  Many depend on 'read' methods
being present to properly instrument a 'write', for example, ``__setitem__``
needs ``__getitem__``.  "Bulk" methods like ``update`` and ``extend`` may also
reimplemented in terms of atomic appends and removes, so the ``extend``
decoration will actually perform many ``append`` operations and not call the
underlying method at all.

Tight control over bulk operation and the firing of events is also possible by
implementing the instrumentation internally in your methods.  The basic
instrumentation package works under the general assumption that collection
mutation will not raise unusual exceptions.  If you want to closely
orchestrate append and remove events with exception management, internal
instrumentation may be the answer.  Within your method,
``collection_adapter(self)`` will retrieve an object that you can use for
explicit control over triggering append and remove events.

The owning object and :class:`.CollectionAttributeImpl` are also reachable
through the adapter, allowing for some very sophisticated behavior.

é    )ÚannotationsN)ÚAny)ÚCallable)Úcast)Ú
Collection)ÚDict)ÚIterable)ÚList)ÚNoReturn)ÚOptional)ÚSet)ÚTuple)ÚType)ÚTYPE_CHECKING)ÚTypeVar)ÚUnioné   )ÚNO_KEYé   )Úexc)Úutil©ÚNO_ARG)Úinspect_getfullargspec)ÚProtocol)ÚAttributeEventToken)ÚCollectionAttributeImpl©Úattribute_keyed_dict©Úcolumn_keyed_dict©Úkeyfunc_mapping©ÚKeyFuncDict)ÚInstanceState)
Ú
collectionÚcollection_adapterr#   r!   r   r%   Úmapped_collectionÚcolumn_mapped_collectionÚattribute_mapped_collectionÚMappedCollectionÚ_AdaptedCollectionProtocolÚ_T)ÚboundÚ_KTÚ_VTÚ_COLúCollection[Any]Ú_FNúCallable[..., Any]c                  ó   • \ rS rSrSS jrSrg)Ú_CollectionConverterProtocolé­   c                ó   • g ©N© )Úselfr'   s     ÚW/home/mande/repo/quber/.venv/lib/python3.13/site-packages/sqlalchemy/orm/collections.pyÚ__call__Ú%_CollectionConverterProtocol.__call__®   s   € °#ó    r;   N)r'   r2   Úreturnr2   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r>   Ú__static_attributes__r;   r@   r=   r7   r7   ­   s   † ß5r@   r7   c                  óH   • \ rS rSr% S\S'   S\S'   S\S'   S\S'   S	\S
'   Srg)r-   é±   ÚCollectionAdapterÚ_sa_adapterr5   Ú_sa_appenderÚ_sa_removerzCallable[..., Iterable[Any]]Ú_sa_iteratorr7   Ú_sa_converterr;   N)rB   rC   rD   rE   Ú__annotations__rF   r;   r@   r=   r-   r-   ±   s    ‡ Ø"Ó"Ø$Ó$Ø#Ó#Ø.Ó.Ø/Ö/r@   c                  óØ   • \ rS rSrSr\S 5       r\S 5       r\S 5       r\S 5       r	\\
R                  " SS5      S	 5       5       r\SS
 j5       r\S 5       r\S 5       r\S 5       rSrg)r'   é¹   aB  Decorators for entity collection classes.

The decorators fall into two groups: annotations and interception recipes.

The annotating decorators (appender, remover, iterator, converter,
internally_instrumented) indicate the method's purpose and take no
arguments.  They are not written with parens::

    @collection.appender
    def append(self, append): ...

The recipe decorators all require parens, even those that take no
arguments::

    @collection.adds("entity")
    def insert(self, position, entity): ...


    @collection.removes_return()
    def popitem(self): ...

c                ó   • SU l         U $ )a  Tag the method as the collection appender.

The appender method is called with one positional argument: the value
to append. The method will be automatically decorated with 'adds(1)'
if not already decorated::

    @collection.appender
    def add(self, append): ...


    # or, equivalently
    @collection.appender
    @collection.adds(1)
    def add(self, append): ...


    # for mapping type, an 'append' may kick out a previous value
    # that occupies that slot.  consider d['a'] = 'foo'- any previous
    # value in d['a'] is discarded.
    @collection.appender
    @collection.replaces(1)
    def add(self, entity):
        key = some_key_func(entity)
        previous = None
        if key in self:
            previous = self[key]
        self[key] = entity
        return previous

If the value to append is not allowed in the collection, you may
raise an exception.  Something to remember is that the appender
will be called for each object mapped by a database query.  If the
database contains rows that violate your collection semantics, you
will need to get creative to fix the problem, as access via the
collection will not work.

If the appender method is internally instrumented, you must also
receive the keyword argument '_sa_initiator' and ensure its
promulgation to collection events.

Úappender©Ú_sa_instrument_role©Úfns    r=   rS   Úcollection.appenderÔ   s   € ðV ",ˆÔØˆ	r@   c                ó   • SU l         U $ )a—  Tag the method as the collection remover.

The remover method is called with one positional argument: the value
to remove. The method will be automatically decorated with
:meth:`removes_return` if not already decorated::

    @collection.remover
    def zap(self, entity): ...


    # or, equivalently
    @collection.remover
    @collection.removes_return()
    def zap(self): ...

If the value to remove is not present in the collection, you may
raise an exception or return None to ignore the error.

If the remove method is internally instrumented, you must also
receive the keyword argument '_sa_initiator' and ensure its
promulgation to collection events.

ÚremoverrT   rV   s    r=   rZ   Úcollection.remover  s   € ð2 "+ˆÔØˆ	r@   c                ó   • SU l         U $ )z×Tag the method as the collection remover.

The iterator method is called with no arguments.  It is expected to
return an iterator over all collection members::

    @collection.iterator
    def __iter__(self): ...

ÚiteratorrT   rV   s    r=   r]   Úcollection.iterator  s   € ð ",ˆÔØˆ	r@   c                ó   • SU l         U $ )ah  Tag the method as instrumented.

This tag will prevent any decoration from being applied to the
method. Use this if you are orchestrating your own calls to
:func:`.collection_adapter` in one of the basic SQLAlchemy
interface methods, or to prevent an automatic ABC method
decoration from wrapping your implementation::

    # normally an 'extend' method on a list-like class would be
    # automatically intercepted and re-implemented in terms of
    # SQLAlchemy events and append().  your implementation will
    # never be called, unless:
    @collection.internally_instrumented
    def extend(self, items): ...

T)Ú_sa_instrumentedrV   s    r=   Úinternally_instrumentedÚ"collection.internally_instrumented,  s   € ð$ #ˆÔØˆ	r@   z1.3zçThe :meth:`.collection.converter` handler is deprecated and will be removed in a future release.  Please refer to the :class:`.AttributeEvents.bulk_replace` listener interface in conjunction with the :func:`.event.listen` function.c                ó   • SU l         U $ )a	  Tag the method as the collection converter.

This optional method will be called when a collection is being
replaced entirely, as in::

    myobj.acollection = [newvalue1, newvalue2]

The converter method will receive the object being assigned and should
return an iterable of values suitable for use by the ``appender``
method.  A converter must not assign values or mutate the collection,
its sole job is to adapt the value the user provides into an iterable
of values for the ORM's use.

The default converter implementation will use duck-typing to do the
conversion.  A dict-like collection will be convert into an iterable
of dictionary values, and other types will simply be iterated::

    @collection.converter
    def convert(self, other): ...

If the duck-typing of the object does not match the type of this
collection, a TypeError is raised.

Supply an implementation of this method if you want to expand the
range of possible types that can be assigned in bulk or perform
validation on the values about to be assigned.

Ú	converterrT   rV   s    r=   rd   Úcollection.converterA  s   € ðJ "-ˆÔØˆ	r@   c                ó   ^ • U 4S jnU$ )a”  Mark the method as adding an entity to the collection.

Adds "add to collection" handling to the method.  The decorator
argument indicates which method argument holds the SQLAlchemy-relevant
value.  Arguments can be specified positionally (i.e. integer) or by
name::

    @collection.adds(1)
    def push(self, item): ...


    @collection.adds("entity")
    def do_stuff(self, thing, entity=None): ...

c                ó   >• ST4U l         U $ )NÚfire_append_event©Ú_sa_instrument_before©rW   Úargs    €r=   Ú	decoratorÚ"collection.adds.<locals>.decorator{  ó   ø€ Ø(;¸SÐ'AˆBÔ$ØˆIr@   r;   ©rl   rm   s   ` r=   ÚaddsÚcollection.addsi  s   ø€ õ$	ð Ðr@   c                ó   ^ • U 4S jnU$ )aÂ  Mark the method as replacing an entity in the collection.

Adds "add to collection" and "remove from collection" handling to
the method.  The decorator argument indicates which method argument
holds the SQLAlchemy-relevant value to be added, and return value, if
any will be considered the value to remove.

Arguments can be specified positionally (i.e. integer) or by name::

    @collection.replaces(2)
    def __setitem__(self, index, item): ...

c                ó(   >• ST4U l         SU l        U $ )Nrh   Úfire_remove_event)rj   Ú_sa_instrument_afterrk   s    €r=   rm   Ú&collection.replaces.<locals>.decorator‘  s   ø€ Ø(;¸SÐ'AˆBÔ$Ø&9ˆBÔ#ØˆIr@   r;   rp   s   ` r=   ÚreplacesÚcollection.replaces�  s   ø€ õ 	ð
 Ðr@   c                ó   ^ • U 4S jnU$ )aº  Mark the method as removing an entity in the collection.

Adds "remove from collection" handling to the method.  The decorator
argument indicates which method argument holds the SQLAlchemy-relevant
value to be removed. Arguments can be specified positionally (i.e.
integer) or by name::

    @collection.removes(1)
    def zap(self, item): ...

For methods where the value to remove is not known at call-time, use
collection.removes_return.

c                ó   >• ST4U l         U $ ©Nru   ri   rk   s    €r=   rm   Ú%collection.removes.<locals>.decorator©  ro   r@   r;   rp   s   ` r=   ÚremovesÚcollection.removes˜  s   ø€ õ"	ð Ðr@   c                 ó   • S n U $ )au  Mark the method as removing an entity in the collection.

Adds "remove from collection" handling to the method.  The return
value of the method, if any, is considered the value to remove.  The
method arguments are not inspected::

    @collection.removes_return()
    def pop(self): ...

For methods where the value to remove is known at call-time, use
collection.remove.

c                ó   • SU l         U $ r|   )rv   rV   s    r=   rm   Ú,collection.removes_return.<locals>.decorator¿  s   € Ø&9ˆBÔ#ØˆIr@   r;   )rm   s    r=   Úremoves_returnÚcollection.removes_return¯  s   € ò 	ð Ðr@   r;   N)rl   ÚintrA   zCallable[[_FN], _FN])rB   rC   rD   rE   Ú__doc__ÚstaticmethodrS   rZ   r]   ra   r   Ú
deprecatedrd   rq   rx   r~   rƒ   rF   r;   r@   r=   r'   r'   ¹   sÖ   † ñð4 ñ+ó ð+ðZ ñó ðð6 ñó ðð ñó ðð( Ø	‡_‚_Øð	?óñóó ðð@ óó ðð. ñó ðð, ñó ðð, ñó ór@   r'   rI   c                ó   • g)z7Fetch the :class:`.CollectionAdapter` for a collection.Nr;   )r'   s    r=   r(   r(   È  s   � r@   rJ   c                  ó¶  • \ rS rSr% SrSrS\S'   S\S'   S\S	'   S
\S'   S\S'   S\S'   S\S'         S.S jrS/S jr\	S0S j5       r
\	S1S j5       rS r S2     S3S jjrS rS/S jrS4S jrS5S jrS6S jrS r S2     S3S jjrS5S jr S2   S7S  jjrS/S! jrS" rS# rS$ rS\4S% jrS\4S& jrS\4S' jrS\4S( jrS\4S) jr S\4S* jr!S+ r"S, r#S-r$g)8rI   iÏ  aQ  Bridges between the ORM and arbitrary Python collections.

Proxies base-level collection operations (append, remove, iterate)
to the underlying Python collection, and emits add/remove events for
entities entering or leaving the collection.

The ORM uses :class:`.CollectionAdapter` exclusively for interaction with
entity collections.


)ÚattrÚ_keyÚ_dataÚowner_stateÚ
_converterÚinvalidatedÚemptyr   r‹   ÚstrrŒ   z)Callable[..., _AdaptedCollectionProtocol]r�   úInstanceState[Any]rŽ   r7   r�   Úboolr�   r‘   c                ó¾   • Xl         UR                  U l        [        R                  " U5      U l        X l        Xl        UR                  U l	        SU l
        SU l        g ©NF)r‹   ÚkeyrŒ   ÚweakrefÚrefr�   rŽ   rJ   rN   r�   r�   r‘   )r<   r‹   rŽ   Údatas       r=   Ú__init__ÚCollectionAdapter.__init__ñ  sN   € ð Œ	Ø—H‘HˆŒ	ô —[’[ Ó&ˆŒ
à&ÔØÔØ×,Ñ,ˆŒØ ˆÔØˆ�
r@   c                ó0   • [         R                  " S5        g )Nz%This collection has been invalidated.)r   Úwarn©r<   s    r=   Ú_warn_invalidatedÚ#CollectionAdapter._warn_invalidated  s   € Ü�	Š	Ð9Õ:r@   c                ó"   • U R                  5       $ )z$The entity collection being adapted.)r�   rŸ   s    r=   rš   ÚCollectionAdapter.data
  s   € ð �z‰z‹|Ðr@   c                óh   • U R                   R                  U R                     U R                  5       L $ )z«return True if the owner state still refers to this collection.

This will return False within a bulk replace operation,
where this collection is the one being replaced.

)rŽ   ÚdictrŒ   r�   rŸ   s    r=   Ú_referenced_by_ownerÚ&CollectionAdapter._referenced_by_owner  s*   € ð ×Ñ×$Ñ$ T§Y¡YÑ/°4·:±:³<Ð?Ð?r@   c                ó6   • U R                  5       R                  $ r:   ©r�   rK   rŸ   s    r=   Úbulk_appenderÚCollectionAdapter.bulk_appender  s   € Ø�z‰z‹|×(Ñ(Ð(r@   Nc                ó>   • U R                  5       R                  XS9  g)z8Add an entity to the collection, firing mutation events.©Ú_sa_initiatorNr©   ©r<   ÚitemÚ	initiators      r=   Úappend_with_eventÚ#CollectionAdapter.append_with_event  s   € ð
 	�
‰
‹×!Ñ! $Ð!Ò@r@   c                ó†   • U R                   (       a   S5       eSU l         XR                  R                  U R                  '   g )Nz7This collection adapter is already in the 'empty' stateT)r‘   rŽ   Ú_empty_collectionsrŒ   )r<   Ú	user_datas     r=   Ú
_set_emptyÚCollectionAdapter._set_empty#  s:   € à—
—
ð	EàDó	EØàˆŒ
Ø9B×Ñ×+Ñ+¨D¯I©IÒ6r@   c                óâ   • U R                   (       d   S5       eSU l         U R                  R                  R                  U R                  5      U R                  R
                  U R                  '   g )Nz3This collection adapter is not in the 'empty' stateF)r‘   rŽ   rµ   ÚpoprŒ   r¥   rŸ   s    r=   Ú_reset_emptyÚCollectionAdapter._reset_empty*  sZ   € à�J�Jð	Aà@ó	AØàˆŒ
à×Ñ×/Ñ/×3Ñ3°D·I±IÓ>ð 	×Ñ×Ñ˜dŸi™iÒ(r@   c                ó.   • [         R                  " S5      e)NzZThis is a special 'empty' collection which cannot accommodate internal mutation operations)Úsa_excÚInvalidRequestErrorrŸ   s    r=   Ú_refuse_emptyÚCollectionAdapter._refuse_empty3  s   € Ü×(Ò(ð+ó
ð 	
r@   c                ó‚   • U R                   (       a  U R                  5         U R                  5       R                  USS9  g©z=Add or restore an entity to the collection, firing no events.Fr­   N©r‘   rÀ   r�   rK   ©r<   r°   s     r=   Úappend_without_eventÚ&CollectionAdapter.append_without_event9  s0   € ð �:�:Ø×ÑÔ Ø�
‰
‹×!Ñ! $°eÐ!Ò<r@   c                óš   • U R                   (       a  U R                  5         U R                  5       R                  nU H
  nU" USS9  M     grÃ   rÄ   )r<   ÚitemsrS   r°   s       r=   Úappend_multiple_without_eventÚ/CollectionAdapter.append_multiple_without_event@  s:   € à�:�:Ø×ÑÔ Ø—:‘:“<×,Ñ,ˆÛˆDÙ�T¨Ô/ò r@   c                ó6   • U R                  5       R                  $ r:   ©r�   rL   rŸ   s    r=   Úbulk_removerÚCollectionAdapter.bulk_removerH  s   € Ø�z‰z‹|×'Ñ'Ð'r@   c                ó>   • U R                  5       R                  XS9  g)z=Remove an entity from the collection, firing mutation events.r­   NrÍ   r¯   s      r=   Úremove_with_eventÚ#CollectionAdapter.remove_with_eventK  s   € ð 	�
‰
‹× Ñ  Ð Ò?r@   c                ó‚   • U R                   (       a  U R                  5         U R                  5       R                  USS9  g)z7Remove an entity from the collection, firing no events.Fr­   N)r‘   rÀ   r�   rL   rÅ   s     r=   Úremove_without_eventÚ&CollectionAdapter.remove_without_eventQ  s.   € à�:�:Ø×ÑÔ Ø�
‰
‹× Ñ  °UÐ Ò;r@   c                óª   • U R                   (       a  U R                  5         U R                  5       R                  n[	        U 5       H	  nU" X1S9  M     g)z>Empty the collection, firing a mutation event for each entity.r­   N©r‘   rÀ   r�   rL   Úlist)r<   r±   rZ   r°   s       r=   Úclear_with_eventÚ"CollectionAdapter.clear_with_eventW  s>   € ð
 �:�:Ø×ÑÔ Ø—*‘*“,×*Ñ*ˆÜ˜–JˆDÙ�DÔ2ò r@   c                ó¬   • U R                   (       a  U R                  5         U R                  5       R                  n[	        U 5       H
  nU" USS9  M     g)z'Empty the collection, firing no events.Fr­   Nr×   )r<   rZ   r°   s      r=   Úclear_without_eventÚ%CollectionAdapter.clear_without_eventb  s@   € ð �:�:Ø×ÑÔ Ø—*‘*“,×*Ñ*ˆÜ˜–JˆDÙ�D¨Ô.ò r@   c                óP   • [        U R                  5       R                  5       5      $ )z(Iterate over entities in the collection.)Úiterr�   rM   rŸ   s    r=   Ú__iter__ÚCollectionAdapter.__iter__k  s   € ô �D—J‘J“L×-Ñ-Ó/Ó0Ð0r@   c                ób   • [        [        U R                  5       R                  5       5      5      $ )z!Count entities in the collection.)ÚlenrØ   r�   rM   rŸ   s    r=   Ú__len__ÚCollectionAdapter.__len__p  s!   € ä”4˜Ÿ
™
›×1Ñ1Ó3Ó4Ó5Ð5r@   c                ó   • g©NTr;   rŸ   s    r=   Ú__bool__ÚCollectionAdapter.__bool__t  s   € Ør@   c                ó0  • U(       d  g USLa‰  U R                   (       a  U R                  5         U R                  (       a  U R                  5         U H@  nU R                  R                  U R                  U R                  R                  UUU5        MB     g g r–   ©r�   r    r‘   r»   r‹   Úfire_append_wo_mutation_eventrŽ   r¥   ©r<   rÉ   r±   r—   r°   s        r=   Ú#_fire_append_wo_mutation_event_bulkÚ5CollectionAdapter._fire_append_wo_mutation_event_bulkw  s|   € ö Øà˜EÒ!Ø××Ø×&Ñ&Ô(à�z�zØ×!Ñ!Ô#ã�Ø—	‘	×7Ñ7Ø×$Ñ$Ø×$Ñ$×)Ñ)ØØØöò ð "r@   c                ó  • USLa~  U R                   (       a  U R                  5         U R                  (       a  U R                  5         U R                  R                  U R                  U R                  R                  XU5      $ U$ )a*  Notify that a entity is entering the collection but is already
present.


Initiator is a token owned by the InstrumentedAttribute that
initiated the membership mutation, and should be left as None
unless you are passing along an initiator value from a chained
operation.

.. versionadded:: 1.4.15

Frë   ©r<   r°   r±   r—   s       r=   rì   Ú/CollectionAdapter.fire_append_wo_mutation_event�  sm   € ð ˜EÒ!Ø××Ø×&Ñ&Ô(à�z�zØ×!Ñ!Ô#à—9‘9×:Ñ:Ø× Ñ  $×"2Ñ"2×"7Ñ"7¸È#óð ð ˆKr@   c                ó  • USLa~  U R                   (       a  U R                  5         U R                  (       a  U R                  5         U R                  R                  U R                  U R                  R                  XU5      $ U$ )zøNotify that a entity has entered the collection.

Initiator is a token owned by the InstrumentedAttribute that
initiated the membership mutation, and should be left as None
unless you are passing along an initiator value from a chained
operation.

F)r�   r    r‘   r»   r‹   rh   rŽ   r¥   rñ   s       r=   rh   Ú#CollectionAdapter.fire_append_event§  sm   € ð ˜EÒ!Ø××Ø×&Ñ&Ô(à�z�zØ×!Ñ!Ô#à—9‘9×.Ñ.Ø× Ñ  $×"2Ñ"2×"7Ñ"7¸È#óð ð ˆKr@   c                ó0  • U(       d  g USLa‰  U R                   (       a  U R                  5         U R                  (       a  U R                  5         U H@  nU R                  R                  U R                  U R                  R                  UUU5        MB     g g r–   ©r�   r    r‘   r»   r‹   ru   rŽ   r¥   rí   s        r=   Ú_fire_remove_event_bulkÚ)CollectionAdapter._fire_remove_event_bulk½  sz   € ÞØà˜EÒ!Ø××Ø×&Ñ&Ô(à�z�zØ×!Ñ!Ô#ã�Ø—	‘	×+Ñ+Ø×$Ñ$Ø×$Ñ$×)Ñ)ØØØöò ð "r@   c                ó  • USLa  U R                   (       a  U R                  5         U R                  (       a  U R                  5         U R                  R                  U R                  U R                  R                  XU5        gg)zñNotify that a entity has been removed from the collection.

Initiator is the InstrumentedAttribute that initiated the membership
mutation, and should be left as None unless you are passing along
an initiator value from a chained operation.

FNrö   rñ   s       r=   ru   Ú#CollectionAdapter.fire_remove_eventÑ  sf   € ð ˜EÒ!Ø××Ø×&Ñ&Ô(à�z�zØ×!Ñ!Ô#à�I‰I×'Ñ'Ø× Ñ  $×"2Ñ"2×"7Ñ"7¸È#õð "r@   c                óº   • U R                   (       a  U R                  5         U R                  R                  U R                  U R                  R
                  UUS9  g)z“Notify that an entity is about to be removed from the collection.

Only called if the entity cannot be removed after calling
fire_remove_event().

)r±   r—   N)r�   r    r‹   Úfire_pre_remove_eventrŽ   r¥   )r<   r±   r—   s      r=   rü   Ú'CollectionAdapter.fire_pre_remove_eventä  sN   € ð ××Ø×"Ñ"Ô$Ø�	‰	×'Ñ'Ø×ÑØ×Ñ×!Ñ!ØØð	 	(ò 	
r@   c                ó    • U R                   U R                  U R                  R                  U R                  U R                  U R
                  S.$ )N)r—   rŽ   Ú	owner_clsrš   r�   r‘   )rŒ   rŽ   Úclass_rš   r�   r‘   rŸ   s    r=   Ú__getstate__ÚCollectionAdapter.__getstate__ô  sB   € à—9‘9Ø×+Ñ+Ø×)Ñ)×0Ñ0Ø—I‘IØ×+Ñ+Ø—Z‘Zñ
ð 	
r@   c                ó4  • US   U l         US   U l        [        R                  " US   5      U l        US   R
                  U l        XS   l        US   U l        [        US   U R                   5      R                  U l        UR                  SS5      U l        g )Nr—   rŽ   rš   r�   rÿ   r‘   F)rŒ   rŽ   r˜   r™   r�   rN   r�   rJ   r�   ÚgetattrÚimplr‹   Úgetr‘   )r<   Úds     r=   Ú__setstate__ÚCollectionAdapter.__setstate__þ  s†   € Ø�e‘HˆŒ	Ø˜]Ñ+ˆÔô —[’[  6¡Ó+ˆŒ
à˜F™)×1Ñ1ˆŒØ $ˆ&‰	ÔØ˜]Ñ+ˆÔÜ˜A˜k™N¨D¯I©IÓ6×;Ñ;ˆŒ	Ø—U‘U˜7 EÓ*ˆ�
r@   )r�   r�   rŒ   r‹   r‘   r�   rŽ   )r‹   r   rŽ   r“   rš   r-   )rA   ÚNone)rA   r-   )rA   r”   r:   )r°   r   r±   úOptional[AttributeEventToken]rA   r
  )rA   r   )r°   r   rA   r
  )rÉ   zIterable[Any]rA   r
  )r±   r  rA   r
  )%rB   rC   rD   rE   r†   Ú	__slots__rO   r›   r    Úpropertyrš   r¦   rª   r²   r·   r»   rÀ   rÆ   rÊ   rÎ   rÑ   rÔ   rÙ   rÜ   rà   rä   rè   r   rî   rì   rh   r÷   ru   rü   r  r  rF   r;   r@   r=   rI   rI   Ï  s„  ‡ ñ
ð€Ið "Ó!Ø
ƒIð 5Ó4à#Ó#Ø,Ó,ØÓØƒKðà%ðð (ðð )ô	ô,;ð óó ðð ó@ó ð@ò)ð EIðAØðAØ$AðAà	õAòCô
ô
ô=ô0ò(ð EIð@Øð@Ø$Að@à	õ@ô<ð :>ð	3Ø6ð	3à	õ	3ô/ò1ò
6òð  $¨ôð, =AÀfô ð4 15¸&ô ð, 8<Àô ð( 15¸&ô ð& /3¸ô 
ò 
õ+r@   c                óÐ  • [        U [        5      (       d   e[        R                  nU" U=(       d    S5      nUR	                  U =(       d    S5      nU" U =(       d    S5      R                  U5      nUR                  U5      nUR                  5       n	U =(       d    S H  n
X§;   a  U	" X£S9  M  X¦;   d  M  U	" U
SS9  M      U(       a  UR                  XcS9  UR                  XƒS9  gg)a  Load a new collection, firing events based on prior like membership.

Appends instances in ``values`` onto the ``new_adapter``. Events will be
fired for any instance not present in the ``existing_adapter``.  Any
instances in ``existing_adapter`` not present in ``values`` will have
remove events fired upon them.

:param values: An iterable of collection member instances

:param existing_adapter: A :class:`.CollectionAdapter` of
 instances to be replaced

:param new_adapter: An empty :class:`.CollectionAdapter`
 to load with ``values``


r;   r­   F)r±   N)	Ú
isinstancerØ   r   ÚIdentitySetÚintersectionÚ
differencerª   rî   r÷   )ÚvaluesÚexisting_adapterÚnew_adapterr±   ÚidsetÚexisting_idsetÚ	constantsÚ	additionsÚremovalsrS   Úmembers              r=   Úbulk_replacer    sÞ   € ô& �fœd×#Ñ#Ð#Ð#ä×Ñ€EÙÐ+×1¨rÓ2€NØ×+Ñ+¨F¯L°bÓ9€IÙ�f—l Ó#×.Ñ.¨yÓ9€IØ×(Ñ(¨Ó3€Hà×(Ñ(Ó*€Hà—,˜B’,ˆØÓÙ�VÔ5ØÕ Ù�V¨5Ô1ñ	 ö Ø×<Ñ<Øð 	=ñ 	
ð 	×0Ñ0°Ð0ÒOð	 r@   c                ó�  • U [         ;   a
  [         U    nO[        [        U 5      n[        U" 5       5      nU[         ;   a  [         U   n[        U" 5       5      n[        R                  5       (       a<   [        USS5      [        U5      :w  a  [        U5        [        R                  5         U$ U$ ! [        R                  5         f = f)aW  Prepare a callable for future use as a collection class factory.

Given a collection class factory (either a type or no-arg callable),
return another factory that will produce compatible instances when
called.

This function is responsible for converting collection_class=list
into the run-time behavior of collection_class=InstrumentedList.

r`   N)
Ú__canned_instrumentationr   Ú_CollectionFactoryTypeÚtypeÚ__instrumentation_mutexÚacquirer  ÚidÚ_instrument_classÚrelease)ÚfactoryÚimpl_factoryÚclss      r=   Úprepare_instrumentationr)  6  s°   € ð" Ô*Ó*Ü/°Ñ8‰äÔ2°GÓ<ˆô
 ‰|‹~Ó
€Cð Ô&Ó&ô 0°Ñ4ˆÜ‘<“>Ó"ˆô ×&Ñ&×(Ñ(ð	.Ü�sÐ.°Ó5¼¸C»Ó@Ü! #Ô&ä#×+Ñ+Ô-àÐˆ<Ðøô $×+Ñ+Õ-ús   Á2%B/ Â/Cc                ó²   • U R                   S:X  a  [        R                  " S5      e[        U 5      u  p[	        XU5        [        XU5        [        XU5        g)z6Modify methods in a class and install instrumentation.Ú__builtin__zGCan not instrument a built-in type. Use a subclass, even a trivial one.N)rC   r¾   ÚArgumentErrorÚ_locate_roles_and_methodsÚ_setup_canned_rolesÚ_assert_required_rolesÚ_set_collection_attributes©r(  ÚrolesÚmethodss      r=   r$  r$  f  sT   € ð ‡~�~˜Ó&Ü×"Ò"ð,ó
ð 	
ô
 /¨sÓ3�N€Eä˜ GÔ,ä˜3 wÔ/ä˜s¨7Õ3r@   c                óô  • 0 n0 nU R                    Hâ  n[        U5      R                  5        HÂ  u  pE[        U5      (       d  M  [	        US5      (       a%  UR
                  nUS;   d   eUR                  Xd5        SnSn[	        US5      (       a  UR                  u  pšU	S;   d   eXš4n[	        US5      (       a  UR                  n	U	S;   d   eU	nU(       a	  Xx4-   X$'   M²  U(       d  M»  SSU4X$'   MÄ     Mä     X4$ )z_search for _sa_instrument_role-decorated methods in
method resolution order, assign to roles.

rU   )rS   rZ   r]   rd   Nrj   )rh   ru   rv   )	Ú__mro__ÚvarsrÉ   ÚcallableÚhasattrrU   Ú
setdefaultrj   rv   )r(  r2  r3  ÚsuperclsÚnameÚmethodÚroleÚbeforeÚafterÚopÚarguments              r=   r-  r-  {  s  € ð €EØMO€Gà—K”KˆÜ  ›N×0Ñ0Ö2‰LˆDÜ˜F×#Ñ#Ùô �vÐ4×5Ñ5Ø×1Ñ1�Øð  ó ð ð ð × Ñ  Ô,ð 15ˆFØ#'ˆEä�vÐ6×7Ñ7Ø%×;Ñ;‘�ØÐGÓGÐGÐGØ˜�Ü�vÐ5×6Ñ6Ø×0Ñ0�ØÐGÓGÐGÐGØ�ÞØ &¨Ñ 1�“ß�Ø $ d¨EÐ 1�“ó? 3ñ  ðB ˆ>Ðr@   c                ón  • [         R                  " U 5      nU[        ;   a•  Uc   e[        U   u  pEUR                  5        H  u  pgUR	                  Xg5        M     UR                  5        HF  u  p‰[        XS5      n
U
(       d  M  X‚;  d  M!  [        U
S5      (       a  M4  [        XU	" U
5      5        MH     gg)z·see if this class has "canned" roles based on a known
collection type (dict, set, list).  Apply those roles
as needed to the "roles" dictionary, and also
prepare "decorator" methods

Nr`   )r   Úduck_type_collectionÚ__interfacesrÉ   r9  r  r8  Úsetattr)r(  r2  r3  Úcollection_typeÚcanned_rolesÚ
decoratorsr=  r;  r<  rm   rW   s              r=   r.  r.  ¨  s¨   € ô ×/Ò/°Ó4€OØœ,Ó&ØÑ*Ð*Ð*Ü#/°Ñ#@Ñ ˆØ&×,Ñ,Ö.‰JˆDØ×Ñ˜TÖ(ñ /ð ",×!1Ñ!1Ö!3ÑˆFÜ˜ dÓ+ˆBç�ØÕ)Ü Ð$6×7Ó7ä˜¡Y¨r£]Ö3ò "4ð 'r@   c                ó   • SU;  d  [        XS   5      (       d#  [        R                  " SU R                  -  5      eUS   U;  a$  [        [	        XS   5      S5      (       d  SX!S   '   SU;  d  [        XS   5      (       d#  [        R                  " SU R                  -  5      eUS   U;  a$  [        [	        XS   5      S5      (       d  SX!S   '   SU;  d  [        XS   5      (       d#  [        R                  " S	U R                  -  5      eg
)zLensure all roles are present, and apply implicit instrumentation if
needed

rS   z>Type %s must elect an appender method to be a collection classr`   )rh   r   NrZ   z<Type %s must elect a remover method to be a collection class)ru   r   Nr]   z>Type %s must elect an iterator method to be a collection classN)r8  r¾   r,  rB   r  r1  s      r=   r/  r/  Á  s1  € ð
 ˜Ó¤g¨c¸Ñ3D×&EÑ&EÜ×"Ò"ð!Ø#&§<¡<ñ0ó
ð 	
ð 
ˆzÑ	 'Ó	)´'Ü�˜:Ñ&Ó'Ð);÷3ñ 3ð &Dˆ�jÑ!Ñ"à˜Ó¤W¨S¸	Ñ2B×%CÑ%CÜ×"Ò"ð!Ø#&§<¡<ñ0ó
ð 	
ð 
ˆyÑ	 Ó	(´Ü�˜9Ñ%Ó&Ð(:÷2ñ 2ð %Cˆ�iÑ Ñ!à˜Ó¤g¨c¸Ñ3D×&EÑ&EÜ×"Ò"ð!Ø#&§<¡<ñ0ó
ð 	
ð 'Fr@   c                óB  • UR                  5        H*  u  nu  pEn[        U U[        [        X5      XEU5      5        M,     UR                  5        H  u  ps[        U SU-  [        X5      5        M      SU l        [        U S5      (       d  SU l        [        U 5      U l        g)zcapply ad-hoc instrumentation from decorators, class-level defaults
and implicit role declarations

z_sa_%sNrN   )	rÉ   rE  Ú_instrument_membership_mutatorr  rJ   r8  rN   r#  r`   )r(  r2  r3  Úmethod_namer>  rA  r?  r=  s           r=   r0  r0  á  s•   € ð
 3:·-±-¶/Ñ.ˆÑ.�f¨ÜØØÜ*Ü˜Ó)¨6¸Uóö	
ñ 3Bð #Ÿ[™[ž]ÑˆÜ��X ‘_¤g¨cÓ&?Ö@ñ +ð €C„Oä�3˜×(Ñ(Ø ˆÔÜ˜c›7€CÕr@   c                óÒ  ^ ^^^^^• T(       aƒ  [        [        R                  " [        T 5      S   5      5      n[	        T[
        5      (       a&  Tm[        U5      T:„  =(       a    UT   =(       d    SmOTU;   a  UR                  T5      mOSmTmAUUUU UU4S jnSUl        [        T S5      (       a  T R                  Ul
        T R                  Ul        T R                  Ul        U$ )zERoute method args and/or return value through the collection
adapter.r   Nc                 óÔ  >• T(       ab  Tc%  T
U;  a  [         R                  " ST-  5      eUT
   nO:[        U 5      T:”  a  U T   nO%T
U;   a  UT
   nO[         R                  " ST-  5      eUR                  SS 5      nUSL a  S nOU S   R                  nT(       a  U(       a  [        UT5      " WU5        T(       a  U(       d  T	" U 0 UD6$ T	" U 0 UD6nUb  [        UT5      " XS5        U$ )NzMissing argument %sr®   Fr   )r¾   r,  rã   rº   rJ   r  )ÚargsÚkwÚvaluer±   ÚexecutorÚresr?  rA  r>  r<  Ú	named_argÚpos_args         €€€€€€r=   ÚwrapperÚ/_instrument_membership_mutator.<locals>.wrapper  sú   ø€ ÞØ‰Ø BÓ&Ü ×.Ò.Ø-°Ñ8óð ð ˜9™‘ä�t“9˜wÓ&Ø  ™M‘EØ "“_Ø˜y™M‘Eä ×.Ò.Ø-°Ñ8óð ð —F‘F˜?¨DÓ1ˆ	Ø˜ÒØ‰Hà˜A‘w×*Ñ*ˆHæ–hÜ�H˜fÔ% e¨YÔ7æžHÙ˜4Ð& 2Ñ&Ð&á˜$Ð% "Ñ%ˆCØ‰Ü˜ %Ô(¨Ô8ØˆJr@   TrU   )rØ   r   Úflatten_iteratorr   r  r…   rã   Úindexr`   r8  rU   rB   r†   )r<  r>  rA  r?  Úfn_argsrV  rT  rU  s   ````  @@r=   rK  rK  ù  sÌ   ý€ ö ÜÜ×!Ò!Ô"8¸Ó"@ÀÑ"CÓDó
ˆô �h¤×$Ñ$ØˆGÜ˜G› xÑ/×E°G¸HÑ4E×MÈ‰Ià˜7Ó"Ø!Ÿ-™-¨Ó1‘à�Ø ˆIØ÷!ò !ðF  $€GÔÜˆvÐ,×-Ñ-Ø&,×&@Ñ&@ˆÔ#Ø—‘€GÔØ—n‘n€G„OØ€Nr@   c                óX   • USLa%  U R                   nU(       a  UR                  XSS9  ggg)z=Run set wo mutation events.

The collection is not mutated.

FN©r—   )rJ   rì   )r'   r°   r®   rR  s       r=   Ú__set_wo_mutationr]  7  s<   € ð ˜EÒ!Ø×)Ñ)ˆÞØ×2Ñ2Ø¨ð 3ò ð ð "r@   c                óV   • USLa#  U R                   nU(       a  UR                  XUS9nU$ )zVRun set events.

This event always occurs before the collection is actually mutated.

Fr\  )rJ   rh   ©r'   r°   r®   r—   rR  s        r=   Ú__setr`  E  s4   € ð ˜EÒ!Ø×)Ñ)ˆÞØ×-Ñ-¨dÀsÐ-ÐKˆDØ€Kr@   c                óX   • USLa%  U R                   nU(       a  UR                  XUS9  ggg)zíRun del events.

This event occurs before the collection is actually mutated, *except*
in the case of a pop operation, in which case it occurs afterwards.
For pop operations, the __before_pop hook is called before the
operation occurs.

Fr\  N)rJ   ru   r_  s        r=   Ú__delrb  S  s7   € ð ˜EÒ!Ø×)Ñ)ˆÞØ×&Ñ& tÀÐ&ÒDð ð "r@   c                óN   • U R                   nU(       a  UR                  U5        gg)z;An event which occurs on a before a pop() operation occurs.N)rJ   rü   )r'   r®   rR  s      r=   Ú__before_poprd  b  s#   € à×%Ñ%€HÞØ×&Ñ& }Õ5ð r@   c                 óÌ   ^
• S m
U
4S jn U
4S jnU
4S jnU
4S jnU
4S jnU
4S jnU
4S jnU
4S	 jnU
4S
 jn[        5       R                  5       n	U	R                  S5        U	$ )z:Tailored instrumentation wrappers for any list-like class.c                ód   • SU l         [        [        U R                  5      R                  U l        g rç   )r`   r  rØ   rB   r†   rV   s    r=   Ú_tidyÚ_list_decorators.<locals>._tidyl  ó"   € Ø"ˆÔÜœT 2§;¡;Ó/×7Ñ7ˆ�
r@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                ó8   >• [        XU[        5      nT" X5        g r:   )r`  r   )r<   r°   r®   rW   s      €r=   ÚappendÚ0_list_decorators.<locals>.append.<locals>.appendq  s   ø€ Ü˜ ]´FÓ;ˆDÙˆt�Nr@   r:   r;   )rW   rl  rg  s   ` €r=   rl  Ú _list_decorators.<locals>.appendp  s   ù€ ÷	ñ 	ˆfŒØˆr@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                ó8   >• [        XU[        5        T" X5        g r:   ©rb  r   ©r<   rQ  r®   rW   s      €r=   ÚremoveÚ0_list_decorators.<locals>.remove.<locals>.removey  s   ø€ Ü�$˜}¬fÔ5áˆt�Or@   r:   r;   ©rW   rs  rg  s   ` €r=   rs  Ú _list_decorators.<locals>.removex  s   ù€ ÷	ñ
 	ˆfŒØˆr@   c                ó&   >^ • U 4S jnT" U5        U$ )Nc                ó2   >• [        XS U5      nT" XU5        g r:   )r`  )r<   rY  rQ  rW   s      €r=   ÚinsertÚ0_list_decorators.<locals>.insert.<locals>.insert‚  s   ø€ Ü˜$ t¨UÓ3ˆEÙˆt˜EÕ"r@   r;   )rW   ry  rg  s   ` €r=   ry  Ú _list_decorators.<locals>.insert�  s   ù€ õ	#ñ 	ˆfŒØˆr@   c                ó&   >^ • U 4S jnT" U5        U$ )Nc                ó  >• [        U[        5      (       d+  X   nUb  [        XS U5        [        XS U5      nT
" XU5        g UR                  =(       d    SnUR
                  =(       d    SnUS:  a  U[        U 5      -  nUR                  b  UR                  nO[        U 5      nUS:  a  U[        U 5      -  nUS:X  aT  X L a  g [        XVU5       H  n[        U 5      U:”  d  M  X	 M     [        U5       H  u  pxU R                  Xu-   U5        M     g [        [        XVU5      5      n	[        U5      [        U	5      :w  a%  [        S[        U5      < S[        U	5      < 35      e[        X’5       H  u  pxU R                  Xx5        M     g )Nr   r   z#attempt to assign sequence of size z to extended slice of size )r  Úslicerb  r`  ÚstepÚstartrã   ÚstopÚrangeÚ	enumeratery  rØ   Ú
ValueErrorÚzipÚ__setitem__)r<   rY  rQ  Úexistingr  r€  r�  Úir°   ÚrngrW   s             €r=   r†  Ú:_list_decorators.<locals>.__setitem__.<locals>.__setitem__Š  s\  ø€ Ü˜e¤U×+Ñ+Ø™;�ØÑ'Ü˜$¨$°Ô6Ü˜d¨4°Ó7�Ù�4 Õ&ð —z‘z— Q�ØŸ™×( q�Ø˜1“9ØœS ›YÑ&�EØ—:‘:Ñ)Ø Ÿ:™:‘Dä˜t›9�DØ˜!“8ØœC ›IÑ%�Dà˜1“9Ø’}ØÜ" 5°Ö5˜Ü˜t›9 uÕ,Ø $¢ñ 6ô $-¨UÖ#3™˜ØŸ™ A¡I¨tÖ4ò $4ô œu U°$Ó7Ó8�CÜ˜5“z¤S¨£XÓ-Ý(ô  # 5žz¬3¨s­8ð5óð ô
 $' s¦?™˜Ø×(Ñ(¨Ö1ò $3r@   r;   ©rW   r†  rg  s   ` €r=   r†  Ú%_list_decorators.<locals>.__setitem__‰  s   ù€ õ&	2ñP 	ˆkÔØÐr@   c                ó&   >^ • U 4S jnT" U5        U$ )Nc                ó¤   >• [        U[        5      (       d  X   n[        XS U5        T" X5        g X    H  n[        XS U5        M     T" X5        g r:   )r  r~  rb  ©r<   rY  r°   rW   s      €r=   Ú__delitem__Ú:_list_decorators.<locals>.__delitem__.<locals>.__delitem__¶  sK   ø€ Ü˜e¤U×+Ñ+Ø‘{�Ü�d $¨Ô.Ù�4•ð
 !œK�DÜ˜$ d¨EÖ2ñ (á�4•r@   r;   ©rW   r�  rg  s   ` €r=   r�  Ú%_list_decorators.<locals>.__delitem__µ  s   ù€ õ	 ñ 	ˆkÔØÐr@   c                ó   >• S nT" U5        U$ )Nc                óJ   • [        U5       H  nU R                  U5        M     g r:   ©rØ   rl  ©r<   ÚiterablerQ  s      r=   ÚextendÚ0_list_decorators.<locals>.extend.<locals>.extendÇ  s   € Ü˜hž�Ø—‘˜EÖ"ò (r@   r;   )rW   r™  rg  s     €r=   r™  Ú _list_decorators.<locals>.extendÆ  s   ø€ ò	#ñ 	ˆfŒØˆr@   c                ó   >• S nT" U5        U$ )Nc                óL   • [        U5       H  nU R                  U5        M     U $ r:   r–  r—  s      r=   Ú__iadd__Ú4_list_decorators.<locals>.__iadd__.<locals>.__iadd__Ï  s#   € ô ˜hž�Ø—‘˜EÖ"ñ (àˆKr@   r;   )rW   rž  rg  s     €r=   rž  Ú"_list_decorators.<locals>.__iadd__Î  ó   ø€ ò	ñ 	ˆhŒØˆr@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                óH   >• [        U 5        T" X5      n[        XS U5        U$ r:   ©rd  rb  r�  s      €r=   rº   Ú*_list_decorators.<locals>.pop.<locals>.popÚ  s%   ø€ Ü˜ÔÙ�d“?ˆDÜ�$˜d EÔ*ØˆKr@   ©éÿÿÿÿr;   ©rW   rº   rg  s   ` €r=   rº   Ú_list_decorators.<locals>.popÙ  s   ù€ ÷	ñ 	ˆcŒ
Øˆ
r@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                óB   >• U  H  n[        XS U5        M     T" U 5        g r:   ©rb  r�  s      €r=   ÚclearÚ._list_decorators.<locals>.clear.<locals>.clearä  s    ø€ Û�Ü�d $¨Ö.ñ áˆt�Hr@   r¦  r;   ©rW   r­  rg  s   ` €r=   r­  Ú_list_decorators.<locals>.clearã  s   ù€ ÷	ñ
 	ˆeŒØˆr@   rg  ©ÚlocalsÚcopyrº   )rl  rs  ry  r†  r�  r™  rž  rº   r­  Úlrg  s             @r=   Ú_list_decoratorsrµ  i  sU   ø€ ò8õõõõ*õXõ"õ	õõô 	‹�‰‹€AØ‡E�Eˆ'„NØ€Hr@   c                 ó´   ^• S mU4S jn U4S jnU4S jnU4S jnU4S jnU4S jnU4S jn[        5       R                  5       nUR                  S	5        U$ )
zBTailored instrumentation wrappers for any dict-like mapping class.c                ód   • SU l         [        [        U R                  5      R                  U l        g rç   )r`   r  r¥   rB   r†   rV   s    r=   rg  Ú_dict_decorators.<locals>._tidyù  ri  r@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                óX   >• X;   a  [        X U   X15        [        XX15      nT" XU5        g r:   )rb  r`  )r<   r—   rQ  r®   rW   s       €r=   r†  Ú:_dict_decorators.<locals>.__setitem__.<locals>.__setitem__þ  s,   ø€ Ø‹{Ü�d ™I }Ô:Ü˜$ }Ó:ˆEÙˆt˜%Õ r@   r:   r;   r‹  s   ` €r=   r†  Ú%_dict_decorators.<locals>.__setitem__ý  s   ù€ ÷	!ñ 	ˆkÔØÐr@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                ó>   >• X;   a  [        X U   X!5        T" X5        g r:   r¬  )r<   r—   r®   rW   s      €r=   r�  Ú:_dict_decorators.<locals>.__delitem__.<locals>.__delitem__  s   ø€ Ø‹{Ü�d ™I }Ô:Ùˆt�Mr@   r:   r;   r’  s   ` €r=   r�  Ú%_dict_decorators.<locals>.__delitem__  s   ù€ ÷	ñ
 	ˆkÔØÐr@   c                ó&   >^ • U 4S jnT" U5        U$ )Nc                óH   >• U  H  n[        X U   S U5        M     T" U 5        g r:   r¬  )r<   r—   rW   s     €r=   r­  Ú._dict_decorators.<locals>.clear.<locals>.clear  s$   ø€ Û�Ü�d ™I t¨SÖ1ñ áˆt�Hr@   r;   r¯  s   ` €r=   r­  Ú_dict_decorators.<locals>.clear  s   ù€ õ	ñ
 	ˆeŒØˆr@   c                ó4   >^ • [         4U 4S jjnT" U5        U$ )Nc                ó„   >• [        U 5        X;   nU[        L a	  T" X5      nO	T" XU5      nU(       a  [        XS U5        U$ r:   )rd  r   rb  )r<   r—   ÚdefaultÚ_to_delr°   rW   s        €r=   rº   Ú*_dict_decorators.<locals>.pop.<locals>.pop  sC   ø€ Ü˜ÔØ‘kˆGØœ&Ò Ù˜$“}‘á˜$ WÓ-�ÞÜ�d $¨Ô,ØˆKr@   r   r¨  s   ` €r=   rº   Ú_dict_decorators.<locals>.pop  s   ù€ Ü#)÷ 		ñ 	ˆcŒ
Øˆ
r@   c                ó&   >^ • U 4S jnT" U5        U$ )Nc                óN   >• [        U 5        T" U 5      n[        XS   S S5        U$ )Nr   r¤  ©r<   r°   rW   s     €r=   ÚpopitemÚ2_dict_decorators.<locals>.popitem.<locals>.popitem)  s)   ø€ Ü˜ÔÙ�d“8ˆDÜ�$˜Q™  qÔ)ØˆKr@   r;   )rW   rÎ  rg  s   ` €r=   rÎ  Ú!_dict_decorators.<locals>.popitem(  s   ù€ õ	ñ 	ˆgŒØˆr@   c                ó"   >• SS jnT" U5        U$ )Nc                óx   • X;  a  U R                  X5        U$ U R                  U5      nX2L a  [        XS 5        U$ r:   )r†  Ú__getitem__r]  )r<   r—   rÇ  rQ  s       r=   r9  Ú8_dict_decorators.<locals>.setdefault.<locals>.setdefault3  s?   € Ø‹Ø× Ñ  Ô.Ø�à×(Ñ(¨Ó-�ØÒ#Ü% d°4Ô8à�r@   r:   r;   )rW   r9  rg  s     €r=   r9  Ú$_dict_decorators.<locals>.setdefault2  s   ø€ ô		ñ 	ˆjÔØÐr@   c                ó,   >• [         4S jnT" U5        U$ )Nc                óV  • U[         Lar  [        US5      (       a8  [        U5       H(  nX0;  d	  X   X   La  X   X'   M  [        XU   S 5        M*     O)U H#  u  p4X0;  d  X   ULa  X@U'   M  [        XS 5        M%     U H(  nX0;  d	  X   X#   La  X#   X'   M  [        XU   S 5        M*     g )NÚkeys)r   r8  rØ   r]  )r<   Ú__otherrP  r—   rQ  s        r=   ÚupdateÚ0_dict_decorators.<locals>.update.<locals>.updateB  s¬   € ØœfÒ$Ü˜7 F×+Ñ+Ü# Gž}˜Ø›?¨d©i¸w¹|Ò.KØ(/©˜D›Iä-¨d¸C±LÀ$ÖGò	  -ó '.™
˜Ø›?¨d©i¸uÒ.DØ(- ›Iä-¨d¸4Ö@ñ	 '.ó
 �Ø“? d¡i°r±wÒ&>Ø "¡�D“Iä% d¨s©G°TÖ:ò	 r@   r   ©rW   rÚ  rg  s     €r=   rÚ  Ú _dict_decorators.<locals>.updateA  s   ø€ Ü!'ô 	;ñ( 	ˆfŒØˆr@   rg  r±  )	r†  r�  r­  rº   rÎ  r9  rÚ  r´  rg  s	           @r=   Ú_dict_decoratorsrÞ  ö  sJ   ø€ ò8õõõõõõõô0 	‹�‰‹€AØ‡E�Eˆ'„NØ€Hr@   c                ó>   • [        U[        U R                  4-   5      $ )zGAllow only set, frozenset and self.__class__-derived
objects in binops.)r  Ú_set_binop_basesÚ	__class__©r<   Úobjs     r=   Ú_set_binops_check_stricträ  a  s   € ô �cÔ+¨t¯~©~Ð.?Ñ?Ó@Ð@r@   c                ó†   • [        U[        U R                  4-   5      =(       d    [        R                  " U5      [
        :H  $ )z5Allow anything set-like to participate in set binops.)r  rà  rá  r   rC  Úsetrâ  s     r=   Ú_set_binops_check_looserç  g  s8   € ô 	�3Ô(¨D¯N©NÐ+<Ñ<Ó=÷ 	1Ü×$Ò$ SÓ)¬SÑ0ðr@   c                 óü   ^• S mU4S jn U4S jnU4S jnU4S jnU4S jnU4S jnU4S jnU4S	 jnU4S
 jnU4S jn	U4S jn
U4S jnU4S jn[        5       R                  5       nUR                  S5        U$ )z9Tailored instrumentation wrappers for any set-like class.c                ód   • SU l         [        [        U R                  5      R                  U l        g rç   )r`   r  ræ  rB   r†   rV   s    r=   rg  Ú_set_decorators.<locals>._tidyr  s"   € Ø"ˆÔÜœS "§+¡+Ó.×6Ñ6ˆ�
r@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                ó\   >• X;  a  [        XU[        5      nO[        XU5        T" X5        g r:   )r`  r   r]  rr  s      €r=   ÚaddÚ)_set_decorators.<locals>.add.<locals>.addw  s(   ø€ ØÓ Ü˜d¨=¼&ÓA‘ä! $¨}Ô=áˆt�Or@   r:   r;   )rW   rí  rg  s   ` €r=   rí  Ú_set_decorators.<locals>.addv  s   ù€ ÷	ñ 	ˆcŒ
Øˆ
r@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                óB   >• X;   a  [        XU[        5        T" X5        g r:   rq  rr  s      €r=   ÚdiscardÚ1_set_decorators.<locals>.discard.<locals>.discardƒ  ó   ø€ à‹}Ü�d =´&Ô9áˆt�Or@   r:   r;   )rW   rò  rg  s   ` €r=   rò  Ú _set_decorators.<locals>.discard‚  s   ù€ ÷	ñ 	ˆgŒØˆr@   c                ó*   >^ • SU 4S jjnT" U5        U$ )Nc                óB   >• X;   a  [        XU[        5        T" X5        g r:   rq  rr  s      €r=   rs  Ú/_set_decorators.<locals>.remove.<locals>.removeŽ  rô  r@   r:   r;   ru  s   ` €r=   rs  Ú_set_decorators.<locals>.remove�  s   ù€ ÷	ñ 	ˆfŒØˆr@   c                ó&   >^ • U 4S jnT" U5        U$ )Nc                óP   >• [        U 5        T" U 5      n[        XS [        5        U$ r:   )rd  rb  r   rÍ  s     €r=   rº   Ú)_set_decorators.<locals>.pop.<locals>.pop™  s'   ø€ Ü˜ÔÙ�d“8ˆDô �$˜d¤FÔ+ØˆKr@   r;   r¨  s   ` €r=   rº   Ú_set_decorators.<locals>.pop˜  s   ù€ õ	ñ 	ˆcŒ
Øˆ
r@   c                ó   >• S nT" U5        U$ )Nc                óJ   • [        U 5       H  nU R                  U5        M     g r:   )rØ   rs  rÅ   s     r=   r­  Ú-_set_decorators.<locals>.clear.<locals>.clear¥  s   € Ü˜Tž
�Ø—‘˜DÖ!ò #r@   r;   r¯  s     €r=   r­  Ú_set_decorators.<locals>.clear¤  s   ø€ ò	"ñ 	ˆeŒØˆr@   c                ó   >• S nT" U5        U$ )Nc                ó8   • U H  nU R                  U5        M     g r:   )rí  ©r<   rQ  r°   s      r=   rÚ  Ú/_set_decorators.<locals>.update.<locals>.update­  s   € Û�Ø—‘˜–ò r@   r;   rÜ  s     €r=   rÚ  Ú_set_decorators.<locals>.update¬  s   ø€ ò	ñ 	ˆfŒØˆr@   c                ó   >• S nT" U5        U$ )Nc                óf   • [        X5      (       d  [        $ U H  nU R                  U5        M     U $ r:   )rä  ÚNotImplementedrí  r  s      r=   Ú__ior__Ú1_set_decorators.<locals>.__ior__.<locals>.__ior__µ  s-   € Ü+¨D×8Ñ8Ü%Ð%Û�Ø—‘˜–ñ àˆKr@   r;   )rW   r
  rg  s     €r=   r
  Ú _set_decorators.<locals>.__ior__´  s   ø€ ò	ñ 	ˆgŒØˆr@   c                ó   >• S nT" U5        U$ )Nc                ó8   • U H  nU R                  U5        M     g r:   )rò  r  s      r=   Údifference_updateÚE_set_decorators.<locals>.difference_update.<locals>.difference_updateÀ  s   € Û�Ø—‘˜TÖ"ò r@   r;   )rW   r  rg  s     €r=   r  Ú*_set_decorators.<locals>.difference_update¿  s   ø€ ò	#ñ 	ÐÔ Ø Ð r@   c                ó   >• S nT" U5        U$ )Nc                óf   • [        X5      (       d  [        $ U H  nU R                  U5        M     U $ r:   )rä  r	  rò  r  s      r=   Ú__isub__Ú3_set_decorators.<locals>.__isub__.<locals>.__isub__È  s.   € Ü+¨D×8Ñ8Ü%Ð%Û�Ø—‘˜TÖ"ñ àˆKr@   r;   )rW   r  rg  s     €r=   r  Ú!_set_decorators.<locals>.__isub__Ç  r¡  r@   c                ó   >• S nT" U5        U$ )Nc                ó°   • 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 r:   )r  ræ  rs  rí  ©r<   ÚotherÚwantÚhavers  rí  r°   s          r=   Úintersection_updateÚI_set_decorators.<locals>.intersection_update.<locals>.intersection_updateÓ  sN   € Ø×*Ñ*¨5Ó1´3°t³9�$Ø™+ t¡{�Cã�Ø—‘˜DÖ!ñ ã�Ø—‘˜–ò r@   r;   )rW   r  rg  s     €r=   r  Ú,_set_decorators.<locals>.intersection_updateÒ  s   ø€ ò	ñ 	Ð!Ô"Ø"Ð"r@   c                ó   >• S nT" U5        U$ )Nc                óÞ   • [        X5      (       d  [        $ U R                  U5      [        U 5      p2X2-
  X#-
  pTU H  nU R	                  U5        M     U H  nU R                  U5        M     U $ r:   )rä  r	  r  ræ  rs  rí  r  s          r=   Ú__iand__Ú3_set_decorators.<locals>.__iand__.<locals>.__iand__à  sd   € Ü+¨D×8Ñ8Ü%Ð%Ø×*Ñ*¨5Ó1´3°t³9�$Ø™+ t¡{�Cã�Ø—‘˜DÖ!ñ ã�Ø—‘˜–ñ àˆKr@   r;   )rW   r"  rg  s     €r=   r"  Ú!_set_decorators.<locals>.__iand__ß  ó   ø€ ò
	ñ 	ˆhŒØˆr@   c                ó   >• S nT" U5        U$ )Nc                ó°   • 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 r:   )Úsymmetric_differenceræ  rs  rí  r  s          r=   Úsymmetric_difference_updateÚY_set_decorators.<locals>.symmetric_difference_update.<locals>.symmetric_difference_updateð  sN   € Ø×2Ñ2°5Ó9¼3¸t»9�$Ø™+ t¡{�Cã�Ø—‘˜DÖ!ñ ã�Ø—‘˜–ò r@   r;   )rW   r)  rg  s     €r=   r)  Ú4_set_decorators.<locals>.symmetric_difference_updateï  s   ø€ ò	ñ 	Ð)Ô*Ø*Ð*r@   c                ó   >• S nT" U5        U$ )Nc                óÞ   • [        X5      (       d  [        $ U R                  U5      [        U 5      p2X2-
  X#-
  pTU H  nU R	                  U5        M     U H  nU R                  U5        M     U $ r:   )rä  r	  r(  ræ  rs  rí  r  s          r=   Ú__ixor__Ú3_set_decorators.<locals>.__ixor__.<locals>.__ixor__ý  sd   € Ü+¨D×8Ñ8Ü%Ð%Ø×2Ñ2°5Ó9¼3¸t»9�$Ø™+ t¡{�Cã�Ø—‘˜DÖ!ñ ã�Ø—‘˜–ñ àˆKr@   r;   )rW   r.  rg  s     €r=   r.  Ú!_set_decorators.<locals>.__ixor__ü  r%  r@   rg  r±  )rí  rò  rs  rº   r­  rÚ  r
  r  r  r  r"  r)  r.  r´  rg  s                 @r=   Ú_set_decoratorsr1  o  sh   ø€ ò7õ
õ	õ	õ
õõõ	õ!õ	õ#õõ +õô  	‹�‰‹€AØ‡E�Eˆ'„NØ€Hr@   c                  ó   • \ rS rSrSrSrg)ÚInstrumentedListi  z-An instrumented version of the built-in list.r;   N©rB   rC   rD   rE   r†   rF   r;   r@   r=   r3  r3    ó   † Ü7r@   r3  c                  ó   • \ rS rSrSrSrg)ÚInstrumentedSeti  z,An instrumented version of the built-in set.r;   Nr4  r;   r@   r=   r7  r7    s   † Ü6r@   r7  c                  ó   • \ rS rSrSrSrg)ÚInstrumentedDicti  z-An instrumented version of the built-in dict.r;   Nr4  r;   r@   r=   r9  r9    r5  r@   r9  z/util.immutabledict[Any, _CollectionFactoryType]r  rl  rs  rà   )rS   rZ   r]   rí  r]   r  zMutil.immutabledict[Any, Tuple[Dict[str, str], Dict[str, Callable[..., Any]]]]rD  c                ó¾   • SSK Jq  SSK Jq  SSK Jq  SSK Jq  SSK J q   SSK Jq  SSK Jq  SS	K Jq  [        [        5        [        [        5        [        [        5        g )
Nr   r"   r    r   r$   )r)   )r*   )r+   )r,   )r)   r#   r!   r   r%   r*   r+   r,   r$  r3  r7  )Úlclss    r=   Ú__gor<  A  s7   € õ 3Ý4Ý7Ý.å4Ý;Ý>Ý3ô Ô&Ô'Ü”oÔ&Ü”kÕ"r@   )r'   r3   rA   rI   r:   )r&  z4Union[Type[Collection[Any]], _CollectionFactoryType]rA   r  )rA   zDict[str, Callable[[_FN], _FN]])r<   r   rã  r   rA   r”   )Zr†   Ú
__future__r   ÚoperatorÚ	threadingÚtypingr   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r˜   Úbaser   Ú r   r¾   r   Úsql.baser   Úutil.compatr   Úutil.typingr   Ú
attributesr   r   r)   r   r!   r#   r%   Ústater&   Ú__all__ÚLockr!  r  r.   r0   r1   r2   r4   r7   r-   r'   r(   Ú
attrgetterrI   r  r)  r$  r-  r.  r/  r0  rK  r]  r`  rb  rd  rµ  rÞ  ræ  Ú	frozensetrà  rä  rç  r1  r3  r7  r9  ÚimmutabledictrØ   r¥   r  rO   rD  r<  r²  r;   r@   r=   Ú<module>rM     s™  ðòbõF #ã Û Û Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý  Ý Ý Û å Ý Ý Ý Ý 0Ý "à	××Ý/Ý3Ý7Ý4Ý2Ý.Ý$ò€ð $Ÿ.š.Ó*Ð ð " "Ð&BÐ"BÑCÐ áˆT˜Ñ€Ùˆe˜3Ñ€Ùˆe˜3Ñ€ÙˆvÐ.Ñ/€ÙˆeÐ/Ñ0€ô6 8ô 6ô0 ô 0÷Jñ JöZ õFð "×,Ò,¨]Ó;Ð÷z+ñ z+ôz	'PðT-ØAð-àô-ò`4ò**òZ4ò2
ò@#ò0;ô|òòEô6ôJôZeðP ˜Ð#Ð ôAôô_ôD8�t˜B‘xô 8ô7�c˜"‘gô 7ô8�t˜C ˜H‘~ô 8ð
 	×ÒàÐ"Ø�ØÐ"ð	
óð ÐIó ð  	×Òàà$Ø#Ø&ññ
 Óð
ð 	Ø¨8ÀÑLÙÓð
ð
 	�
˜HÐ%Ñ'7Ó'9Ð:ðóð ð ó ò4#ñ4 �VƒX…r@   