Ë
    V.jgÒ  ã            
      ór  — U d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z! ej$                  r*ddl"m#Z# ddl"m$Z$ ddl%m&a& ddl%m'a' ddl%m(a( dd l%m)a) dd!l*m+Z+ g d"¢Z, ejZ                  «       Z.eg d#f   Z/ ed$e¬%«      Z0 ed&e¬%«      Z1 ed'e¬%«      Z2 ed(d)¬%«      Z3 ed*d+¬%«      Z4 G d,„ d-e!«      Z5 G d.„ d#e!«      Z6 G d/„ d0«      Z7erdXd2„Z8n ejr                  d3«      Z8 G d4„ d1«      Z:dYd5„Z;	 	 	 	 dZd6„Z<d7„ Z=d8„ Z>d9„ Z?d:„ Z@d;„ ZAd<„ ZBdYd=„ZCd>„ ZDd?„ ZEdYd@„ZFd[dA„ZGd[dB„ZHeIeJfZKd\dC„ZLd\dD„ZMd[dE„ZN G dF„ dGee0   «      ZO G dH„ dIee0   «      ZP G dJ„ dKe
e1e2f   «      ZQ ej¤                  eSeOeIePeTeQi«      ZUdLeVdM<    ej¤                  eSdNdOdPdQœ eG«       feIdRdOdPdQœ eN«       feTdSdTi eH«       fi«      ZWdUeVdV<   dW„ ZX eX eY«       «       y)]aF  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                  ó   — e Zd Zdd„Zy)Ú_CollectionConverterProtocolc                 ó   — y ©N© )Úselfr'   s     ú\C:\xampp\htdocs\tradingbinance\backend\.venv\Lib\site-packages\sqlalchemy/orm/collections.pyÚ__call__z%_CollectionConverterProtocol.__call__¬   s   € °#ó    N)r'   r2   Úreturnr2   )Ú__name__Ú
__module__Ú__qualname__r=   r:   r>   r<   r7   r7   «   s   „ Ü5r>   r7   c                  ó@   — e Zd ZU ded<   ded<   ded<   ded<   ded	<   y
)r-   ÚCollectionAdapterÚ_sa_adapterr5   Ú_sa_appenderÚ_sa_removerzCallable[..., Iterable[Any]]Ú_sa_iteratorr7   Ú_sa_converterN)r@   rA   rB   Ú__annotations__r:   r>   r<   r-   r-   ¯   s    … Ø"Ó"Ø$Ó$Ø#Ó#Ø.Ó.Ø/Ô/r>   c                  óÌ   — e Zd ZdZed„ «       Zed„ «       Zed„ «       Zed„ «       Ze e	j                  dd«      d„ «       «       Zed	„ «       Zed
„ «       Zed„ «       Zed„ «       Zy)r'   au  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                ó   — d| _         | S )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<   rM   zcollection.appenderÑ   s   € ðR ",ˆÔØˆ	r>   c                ó   — d| _         | S )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.

        ÚremoverrN   rP   s    r<   rS   zcollection.removerý   s   € ð0 "+ˆÔØˆ	r>   c                ó   — d| _         | S )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): ...

        ÚiteratorrN   rP   s    r<   rU   zcollection.iterator  s   € ð ",ˆÔØˆ	r>   c                ó   — d| _         | S )aÈ  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_instrumentedrP   s    r<   Úinternally_instrumentedz"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                ó   — d| _         | S )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.

        Ú	converterrN   rP   s    r<   rZ   zcollection.converter;  s   € ðJ "-ˆÔØˆ	r>   c                ó   ‡ — ˆ fd„}|S )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                ó   •— d‰f| _         | S )NÚfire_append_event©Ú_sa_instrument_before©rQ   Úargs    €r<   Ú	decoratorz"collection.adds.<locals>.decoratort  ó   ø€ Ø(;¸SÐ'AˆBÔ$ØˆIr>   r:   ©ra   rb   s   ` r<   Úaddszcollection.addsc  ó   ø€ ô"	ð Ðr>   c                ó   ‡ — ˆ fd„}|S )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                ó(   •— d‰f| _         d| _        | S )Nr]   Úfire_remove_event)r_   Ú_sa_instrument_afterr`   s    €r<   rb   z&collection.replaces.<locals>.decoratorŠ  s   ø€ Ø(;¸SÐ'AˆBÔ$Ø&9ˆBÔ#ØˆIr>   r:   rd   s   ` r<   Úreplaceszcollection.replacesz  s   ø€ ô 	ð
 Ðr>   c                ó   ‡ — ˆ fd„}|S )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                ó   •— d‰f| _         | S ©Nri   r^   r`   s    €r<   rb   z%collection.removes.<locals>.decorator¢  rc   r>   r:   rd   s   ` r<   Úremoveszcollection.removes‘  rf   r>   c                 ó   — d„ } | S )aµ  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                ó   — d| _         | S rn   )rj   rP   s    r<   rb   z,collection.removes_return.<locals>.decorator¸  s   € Ø&9ˆBÔ#ØˆIr>   r:   )rb   s    r<   Úremoves_returnzcollection.removes_return¨  s   € ò 	ð Ðr>   N)r@   rA   rB   Ú__doc__ÚstaticmethodrM   rS   rU   rX   r   Ú
deprecatedrZ   re   rk   ro   rr   r:   r>   r<   r'   r'   ·   sØ   „ ñð2 ñ)ó ð)ðV ñó ðð4 ñó ðð ñó ðð( Ø€T‡_�_Øð	?óñóó ðð@ ñó ðð, ñó ðð, ñó ðð, ñó ñr>   r'   rD   c                 ó   — y)z7Fetch the :class:`.CollectionAdapter` for a collection.Nr:   )r'   s    r<   r(   r(   Á  s   � r>   rE   c                  ó‚  — e Zd ZU dZdZded<   ded<   ded<   d	ed
<   ded<   ded<   ded<   	 	 	 	 	 	 d,d„Zd-d„Zed.d„«       Z	ed/d„«       Z
d„ Z	 d0	 	 	 	 	 d1d„Zd„ Zd-d„Zd2d„Zd3d„Zd4d„Zd„ Z	 d0	 	 	 	 	 d1d„Zd3d„Z	 d0	 	 	 d5d„Zd-d „Zd!„ Zd"„ Zd#„ Zdefd$„Zdefd%„Zdefd&„Zdefd'„Zdefd(„Zdefd)„Z d*„ Z!d+„ Z"y)6rD   ai  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   rx   Ústrry   z)Callable[..., _AdaptedCollectionProtocol]rz   úInstanceState[Any]r{   r7   r|   Úboolr}   r~   c                óÂ   — || _         |j                  | _        t        j                  |«      | _        || _        | |_        |j                  | _	        d| _
        d| _        y ©NF)rx   Úkeyry   ÚweakrefÚrefrz   r{   rE   rI   r|   r}   r~   )r;   rx   r{   Údatas       r<   Ú__init__zCollectionAdapter.__init__ê  sT   € ð ˆŒ	Ø—H‘HˆŒ	ô —[‘[ Ó&ˆŒ
à&ˆÔØˆÔØ×,Ñ,ˆŒØ ˆÔØˆ�
r>   c                ó.   — t        j                  d«       y )Nz%This collection has been invalidated.)r   Úwarn©r;   s    r<   Ú_warn_invalidatedz#CollectionAdapter._warn_invalidated   s   € Ü�	‰	Ð9Õ:r>   c                ó"   — | j                  «       S )z$The entity collection being adapted.)rz   r‹   s    r<   r‡   zCollectionAdapter.data  s   € ð �z‰z‹|Ðr>   c                óh   — | j                   j                  | j                     | j                  «       u S )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{   Údictry   rz   r‹   s    r<   Ú_referenced_by_ownerz&CollectionAdapter._referenced_by_owner  s*   € ð ×Ñ×$Ñ$ T§Y¡YÑ/°4·:±:³<Ð?Ð?r>   c                ó6   — | j                  «       j                  S r9   ©rz   rF   r‹   s    r<   Úbulk_appenderzCollectionAdapter.bulk_appender  s   € Ø�z‰z‹|×(Ñ(Ð(r>   Nc                óF   — | j                  «       j                  ||¬«       y)z8Add an entity to the collection, firing mutation events.©Ú_sa_initiatorNr’   ©r;   ÚitemÚ	initiators      r<   Úappend_with_eventz#CollectionAdapter.append_with_event  s   € ð
 	�
‰
‹×!Ñ! $°iÐ!Õ@r>   c                ó~   — | j                   rJ d«       ‚d| _         || j                  j                  | j                  <   y )Nz7This collection adapter is already in the 'empty' stateT)r~   r{   Ú_empty_collectionsry   )r;   Ú	user_datas     r<   Ú
_set_emptyzCollectionAdapter._set_empty  s<   € à—
’
ð	EàDó	EØàˆŒ
Ø9Bˆ×Ñ×+Ñ+¨D¯I©IÒ6r>   c                óØ   — | j                   sJ d«       ‚d| _         | j                  j                  j                  | j                  «      | j                  j
                  | j                  <   y )Nz3This collection adapter is not in the 'empty' stateF)r~   r{   rœ   Úpopry   r�   r‹   s    r<   Ú_reset_emptyzCollectionAdapter._reset_empty#  sZ   € à�JŠJð	Aà@ó	AØàˆŒ
à×Ñ×/Ñ/×3Ñ3°D·I±IÓ>ð 	×Ñ×Ñ˜dŸi™iÒ(r>   c                ó,   — t        j                  d«      ‚)NzZThis is a special 'empty' collection which cannot accommodate internal mutation operations)Úsa_excÚInvalidRequestErrorr‹   s    r<   Ú_refuse_emptyzCollectionAdapter._refuse_empty,  s   € Ü×(Ñ(ð+ó
ð 	
r>   c                ó~   — | j                   r| j                  «        | j                  «       j                  |d¬«       y©z=Add or restore an entity to the collection, firing no events.Fr•   N©r~   r¥   rz   rF   ©r;   r˜   s     r<   Úappend_without_eventz&CollectionAdapter.append_without_event2  s0   € ð �:Š:Ø×ÑÔ Ø�
‰
‹×!Ñ! $°eÐ!Õ<r>   c                ó’   — | j                   r| j                  «        | j                  «       j                  }|D ]  } ||d¬«       Œ yr§   r¨   )r;   ÚitemsrM   r˜   s       r<   Úappend_multiple_without_eventz/CollectionAdapter.append_multiple_without_event9  s:   € à�:Š:Ø×ÑÔ Ø—:‘:“<×,Ñ,ˆÛˆDÙ�T¨Ö/ñ r>   c                ó6   — | j                  «       j                  S r9   ©rz   rG   r‹   s    r<   Úbulk_removerzCollectionAdapter.bulk_removerA  s   € Ø�z‰z‹|×'Ñ'Ð'r>   c                óF   — | j                  «       j                  ||¬«       y)z=Remove an entity from the collection, firing mutation events.r•   Nr¯   r—   s      r<   Úremove_with_eventz#CollectionAdapter.remove_with_eventD  s   € ð 	�
‰
‹× Ñ  °YÐ Õ?r>   c                ó~   — | j                   r| j                  «        | j                  «       j                  |d¬«       y)z7Remove an entity from the collection, firing no events.Fr•   N)r~   r¥   rz   rG   r©   s     r<   Úremove_without_eventz&CollectionAdapter.remove_without_eventJ  s.   € à�:Š:Ø×ÑÔ Ø�
‰
‹× Ñ  °UÐ Õ;r>   c                ó¤   — | j                   r| j                  «        | j                  «       j                  }t	        | «      D ]  } |||¬«       Œ y)z>Empty the collection, firing a mutation event for each entity.r•   N©r~   r¥   rz   rG   Úlist)r;   r™   rS   r˜   s       r<   Úclear_with_eventz"CollectionAdapter.clear_with_eventP  s@   € ð
 �:Š:Ø×ÑÔ Ø—*‘*“,×*Ñ*ˆÜ˜–JˆDÙ�D¨	Ö2ñ r>   c                ó¤   — | j                   r| j                  «        | j                  «       j                  }t	        | «      D ]  } ||d¬«       Œ y)z'Empty the collection, firing no events.Fr•   Nr¶   )r;   rS   r˜   s      r<   Úclear_without_eventz%CollectionAdapter.clear_without_event[  s@   € ð �:Š:Ø×ÑÔ Ø—*‘*“,×*Ñ*ˆÜ˜–JˆDÙ�D¨Ö.ñ r>   c                óP   — t        | j                  «       j                  «       «      S )z(Iterate over entities in the collection.)Úiterrz   rH   r‹   s    r<   Ú__iter__zCollectionAdapter.__iter__d  s   € ô �D—J‘J“L×-Ñ-Ó/Ó0Ð0r>   c                ób   — t        t        | j                  «       j                  «       «      «      S )z!Count entities in the collection.)Úlenr·   rz   rH   r‹   s    r<   Ú__len__zCollectionAdapter.__len__i  s!   € ä”4˜Ÿ
™
›×1Ñ1Ó3Ó4Ó5Ð5r>   c                 ó   — y©NTr:   r‹   s    r<   Ú__bool__zCollectionAdapter.__bool__m  s   € Ør>   c                ó  — |sy |dur}| j                   r| j                  «        | j                  r| j                  «        |D ]?  }| j                  j                  | j                  | j                  j                  |||«       ŒA y y rƒ   ©r}   rŒ   r~   r¡   rx   Úfire_append_wo_mutation_eventr{   r�   ©r;   r¬   r™   r„   r˜   s        r<   Ú#_fire_append_wo_mutation_event_bulkz5CollectionAdapter._fire_append_wo_mutation_event_bulkp  s|   € ñ Øà˜EÑ!Ø×ÒØ×&Ñ&Ô(à�zŠzØ×!Ñ!Ô#ã�Ø—	‘	×7Ñ7Ø×$Ñ$Ø×$Ñ$×)Ñ)ØØØõñ ð "r>   c                óø   — |duru| j                   r| j                  «        | j                  r| j                  «        | j                  j                  | j                  | j                  j                  |||«      S |S )ab  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Æ   z/CollectionAdapter.fire_append_wo_mutation_event†  so   € ð ˜EÑ!Ø×ÒØ×&Ñ&Ô(à�zŠzØ×!Ñ!Ô#à—9‘9×:Ñ:Ø× Ñ  $×"2Ñ"2×"7Ñ"7¸¸yÈ#óð ð ˆKr>   c                óø   — |duru| j                   r| j                  «        | j                  r| j                  «        | j                  j                  | j                  | j                  j                  |||«      S |S )a   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¡   rx   r]   r{   r�   rÊ   s       r<   r]   z#CollectionAdapter.fire_append_event   so   € ð ˜EÑ!Ø×ÒØ×&Ñ&Ô(à�zŠzØ×!Ñ!Ô#à—9‘9×.Ñ.Ø× Ñ  $×"2Ñ"2×"7Ñ"7¸¸yÈ#óð ð ˆKr>   c                ó  — |sy |dur}| j                   r| j                  «        | j                  r| j                  «        |D ]?  }| j                  j                  | j                  | j                  j                  |||«       ŒA y y rƒ   ©r}   rŒ   r~   r¡   rx   ri   r{   r�   rÇ   s        r<   Ú_fire_remove_event_bulkz)CollectionAdapter._fire_remove_event_bulk¶  sz   € ÙØà˜EÑ!Ø×ÒØ×&Ñ&Ô(à�zŠzØ×!Ñ!Ô#ã�Ø—	‘	×+Ñ+Ø×$Ñ$Ø×$Ñ$×)Ñ)ØØØõñ ð "r>   c                óø   — |durv| j                   r| j                  «        | j                  r| j                  «        | j                  j                  | j                  | j                  j                  |||«       yy)a  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<   ri   z#CollectionAdapter.fire_remove_eventÊ  sh   € ð ˜EÑ!Ø×ÒØ×&Ñ&Ô(à�zŠzØ×!Ñ!Ô#à�I‰I×'Ñ'Ø× Ñ  $×"2Ñ"2×"7Ñ"7¸¸yÈ#õð "r>   c                ó¶   — | j                   r| j                  «        | j                  j                  | j                  | j                  j
                  ||¬«       y)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Œ   rx   Úfire_pre_remove_eventr{   r�   )r;   r™   r„   s      r<   rÑ   z'CollectionAdapter.fire_pre_remove_eventÝ  sN   € ð ×ÒØ×"Ñ"Ô$Ø�	‰	×'Ñ'Ø×ÑØ×Ñ×!Ñ!ØØð	 	(õ 	
r>   c                ó    — | j                   | j                  | j                  j                  | j                  | j                  | j
                  dœS )N)r„   r{   Ú	owner_clsr‡   r}   r~   )ry   r{   Úclass_r‡   r}   r~   r‹   s    r<   Ú__getstate__zCollectionAdapter.__getstate__í  sB   € à—9‘9Ø×+Ñ+Ø×)Ñ)×0Ñ0Ø—I‘IØ×+Ñ+Ø—Z‘Zñ
ð 	
r>   c                ó4  — |d   | _         |d   | _        t        j                  |d   «      | _        |d   j
                  | _        | |d   _        |d   | _        t        |d   | j                   «      j                  | _        |j                  dd«      | _        y )Nr„   r{   r‡   r}   rÓ   r~   F)ry   r{   r…   r†   rz   rI   r|   rE   r}   ÚgetattrÚimplrx   Úgetr~   )r;   Úds     r<   Ú__setstate__zCollectionAdapter.__setstate__÷  sˆ   € Ø�e‘HˆŒ	Ø˜]Ñ+ˆÔô —[‘[  6¡Ó+ˆŒ
à˜F™)×1Ñ1ˆŒØ $ˆˆ&‰	ÔØ˜]Ñ+ˆÔÜ˜A˜k™N¨D¯I©IÓ6×;Ñ;ˆŒ	Ø—U‘U˜7 EÓ*ˆ�
r>   )rx   r   r{   r€   r‡   r-   )r?   ÚNone)r?   r-   )r?   r�   r9   )r˜   r   r™   úOptional[AttributeEventToken]r?   rÜ   )r?   r   )r˜   r   r?   rÜ   )r¬   zIterable[Any]r?   rÜ   )r™   rÝ   r?   rÜ   )#r@   rA   rB   rs   Ú	__slots__rJ   rˆ   rŒ   Úpropertyr‡   r�   r“   rš   rž   r¡   r¥   rª   r­   r°   r²   r´   r¸   rº   r½   rÀ   rÃ   r   rÈ   rÆ   r]   rÎ   ri   rÑ   rÕ   rÛ   r:   r>   r<   rD   rD   È  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                ó¦  — t        | t        «      sJ ‚t        j                  } ||xs d«      }|j	                  | xs d«      } || xs d«      j                  |«      }|j                  |«      }|j                  «       }	| xs dD ]   }
|
|v r |	|
|¬«       Œ|
|v sŒ |	|
d¬«       Œ" |r'|j                  ||¬«       |j                  ||¬«       yy)aF  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ÚremovalsrM   Ú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’,ˆØ�YÑÙ�V¨9Ö5Ø�yÒ Ù�V¨5Ö1ð	 ñ Ø×<Ñ<Ø ð 	=ô 	
ð 	×0Ñ0°ÀYÐ0ÕOð	 r>   c                ó|  — | t         v r
t         |    }nt        t        | «      }t         |«       «      }|t         v rt         |   }t         |«       «      }t        j                  «       r;	 t        |dd«      t        |«      k7  rt        |«       t        j                  «        |S |S # t        j                  «        w xY w)ao  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.

    rW   N)
Ú__canned_instrumentationr   Ú_CollectionFactoryTypeÚtypeÚ__instrumentation_mutexÚacquirer×   ÚidÚ_instrument_classÚrelease)ÚfactoryÚimpl_factoryÚclss      r<   Úprepare_instrumentationrû   /  s­   € ð" Ô*Ñ*Ü/°Ñ8‰äÔ2°GÓ<ˆô
 ‰|‹~Ó
€Cð Ô&Ñ&ô 0°Ñ4ˆÜ‘<“>Ó"ˆô ×&Ñ&Ô(ð	.Ü�sÐ.°Ó5¼¸C»Ò@Ü! #Ô&ä#×+Ñ+Ô-àÐˆ<Ðøô $×+Ñ+Õ-ús   Á)$B% Â%B;c                ó¶   — | j                   dk(  rt        j                  d«      ‚t        | «      \  }}t	        | ||«       t        | ||«       t        | ||«       y)z6Modify methods in a class and install instrumentation.Ú__builtin__zGCan not instrument a built-in type. Use a subclass, even a trivial one.N)rA   r£   ÚArgumentErrorÚ_locate_roles_and_methodsÚ_setup_canned_rolesÚ_assert_required_rolesÚ_set_collection_attributes©rú   ÚrolesÚmethodss      r<   rö   rö   _  s\   € ð ‡~�~˜Ò&Ü×"Ñ"ð,ó
ð 	
ô
 /¨sÓ3�N€Eˆ7ä˜˜U GÔ,ä˜3  wÔ/ä˜s E¨7Õ3r>   c                ó®  — i }i }| j                   D ]¿  }t        |«      j                  «       D ]¡  \  }}t        |«      sŒt	        |d«      r$|j
                  }|dv sJ ‚|j                  ||«       d}d}t	        |d«      r|j                  \  }	}
|	dv sJ ‚|	|
f}t	        |d«      r|j                  }	|	dv sJ ‚|	}|r
||fz   ||<   Œ—|sŒšdd|f||<   Œ£ ŒÁ ||fS )zgsearch for _sa_instrument_role-decorated methods in
    method resolution order, assign to roles.

    rO   )rM   rS   rU   rZ   Nr_   )r]   ri   rj   )	Ú__mro__Úvarsr¬   ÚcallableÚhasattrrO   Ú
setdefaultr_   rj   )rú   r  r  ÚsuperclsÚnameÚmethodÚroleÚbeforeÚafterÚopÚarguments              r<   rÿ   rÿ   t  s  € ð €EØMO€Gà—K”KˆÜ  ›N×0Ñ0Ö2‰LˆD�&Ü˜FÔ#Øô �vÐ4Ô5Ø×1Ñ1�Øð  ñ ð ð ð × Ñ   tÔ,ð 15ˆFØ#'ˆEä�vÐ6Ô7Ø%×;Ñ;‘��HØÐGÑGÐGÐGØ˜X˜�Ü�vÐ5Ô6Ø×0Ñ0�ØÐGÑGÐGÐGØ�ÙØ &¨%¨Ñ 1�˜’ÚØ $ d¨EÐ 1�˜’ñ? 3ð  ðB �'ˆ>Ðr>   c                óN  — t        j                  | «      }|t        v rˆ|€J ‚t        |   \  }}|j                  «       D ]  \  }}|j	                  ||«       Œ |j                  «       D ]:  \  }}	t        | |d«      }
|
sŒ||vsŒt        |
d«      rŒ(t        | | |	|
«      «       Œ< yy)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

    NrW   )r   Úduck_type_collectionÚ__interfacesr¬   r  r×   r
  Úsetattr)rú   r  r  Úcollection_typeÚcanned_rolesÚ
decoratorsr  r  r  rb   rQ   s              r<   r   r   ¡  s±   € ô ×/Ñ/°Ó4€OØœ,Ñ&ØÐ*Ð*Ð*Ü#/°Ñ#@Ñ ˆ�jØ&×,Ñ,Ö.‰JˆD�$Ø×Ñ˜T 4Õ(ð /ð ",×!1Ñ!1Ö!3ÑˆF�IÜ˜˜f dÓ+ˆBâØ 'Ò)Ü Ð$6Õ7ä˜˜V¡Y¨r£]Õ3ñ "4ð 'r>   c                óâ  — d|vst        | |d   «      s"t        j                  d| j                  z  «      ‚|d   |vr!t        t	        | |d   «      d«      sd||d   <   d|vst        | |d   «      s"t        j                  d| j                  z  «      ‚|d   |vr!t        t	        | |d   «      d«      sd||d   <   d|vst        | |d   «      s"t        j                  d	| j                  z  «      ‚y
)zTensure all roles are present, and apply implicit instrumentation if
    needed

    rM   z>Type %s must elect an appender method to be a collection classrW   )r]   r   NrS   z<Type %s must elect a remover method to be a collection class)ri   r   NrU   z>Type %s must elect an iterator method to be a collection classN)r
  r£   rþ   r@   r×   r  s      r<   r  r  º  s,  € ð
 ˜Ñ¤g¨c°5¸Ñ3DÔ&EÜ×"Ñ"ð!Ø#&§<¡<ñ0ó
ð 	
ð 
ˆzÑ	 'Ñ	)´'Ü��U˜:Ñ&Ó'Ð);ô3ð &Dˆ��jÑ!Ñ"à˜Ñ¤W¨S°%¸	Ñ2BÔ%CÜ×"Ñ"ð!Ø#&§<¡<ñ0ó
ð 	
ð 
ˆyÑ	 Ñ	(´Ü��U˜9Ñ%Ó&Ð(:ô2ð %Cˆ��iÑ Ñ!à˜Ñ¤g¨c°5¸Ñ3DÔ&EÜ×"Ñ"ð!Ø#&§<¡<ñ0ó
ð 	
ð 'Fr>   c                ó:  — |j                  «       D ],  \  }\  }}}t        | |t        t        | |«      |||«      «       Œ. |j                  «       D ]  \  }}t        | d|z  t        | |«      «       Œ! d| _        t        | d«      sd| _        t        | «      | _        y)zkapply ad-hoc instrumentation from decorators, class-level defaults
    and implicit role declarations

    z_sa_%sNrI   )	r¬   r  Ú_instrument_membership_mutatorr×   rE   r
  rI   rõ   rW   )rú   r  r  Úmethod_namer  r  r  r  s           r<   r  r  Ú  sœ   € ð
 3:·-±-¶/Ñ.ˆÑ.�f˜h¨ÜØØÜ*Ü˜˜[Ó)¨6°8¸Uóõ	
ð 3Bð #Ÿ[™[ž]ÑˆˆkÜ��X ‘_¤g¨c°;Ó&?Õ@ð +ð €C„Oä�3˜Ô(Ø ˆÔÜ˜c›7€CÕr>   c                ó˜  ‡ ‡‡‡‡‡— ‰rqt        t        j                  t        ‰ «      d   «      «      }t	        ‰t
        «      r‰Št        |«      ‰kD  xr |‰   xs dŠn‰|v r|j                  ‰«      ŠndŠ‰Š~ˆˆˆˆ ˆˆfd„}d|_        t        ‰ d«      r‰ j                  |_
        ‰ j                  |_        ‰ j                  |_        |S )zIRoute method args and/or return value through the collection
    adapter.r   Nc                 ó�  •— ‰rZ‰€"‰
|vrt        j                  d‰z  «      ‚|‰
   }n6t        | «      ‰kD  r| ‰   }n"‰
|v r|‰
   }nt        j                  d‰z  «      ‚|j                  dd «      }|du rd }n| d   j                  }‰r|r t        |‰«      |«       ‰r|s ‰	| i |¤ŽS  ‰	| i |¤Ž}|� t        |‰«      ||«       |S )NzMissing argument %sr–   Fr   )r£   rþ   r¿   r    rE   r×   )ÚargsÚkwÚvaluer™   ÚexecutorÚresr  r  r  r  Ú	named_argÚpos_args         €€€€€€r<   Úwrapperz/_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Ø%ŒG�H˜fÓ% e¨YÔ7á™HÙ˜4Ð& 2Ñ&Ð&á˜$Ð% "Ñ%ˆCØˆØ(”˜ %Ó(¨¨iÔ8ØˆJr>   TrO   )r·   r   Úflatten_iteratorr   rá   Úintr¿   ÚindexrW   r
  rO   r@   rs   )r  r  r  r  Úfn_argsr(  r&  r'  s   ````  @@r<   r  r  ò  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                óT   — |dur$| j                   }|r|j                  ||d¬«       yyy)zERun set wo mutation events.

    The collection is not mutated.

    FN©r„   )rE   rÆ   )r'   r˜   r–   r$  s       r<   Ú__set_wo_mutationr/  0  s>   € ð ˜EÑ!Ø×)Ñ)ˆÙØ×2Ñ2Ø�m¨ð 3õ ð ð "r>   c                óR   — |dur"| j                   }|r|j                  |||¬«      }|S )z^Run set events.

    This event always occurs before the collection is actually mutated.

    Fr.  )rE   r]   ©r'   r˜   r–   r„   r$  s        r<   Ú__setr2  >  s6   € ð ˜EÑ!Ø×)Ñ)ˆÙØ×-Ñ-¨d°MÀsÐ-ÓKˆDØ€Kr>   c                óT   — |dur$| j                   }|r|j                  |||¬«       yyy)a  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)rE   ri   r1  s        r<   Ú__delr4  L  s9   € ð ˜EÑ!Ø×)Ñ)ˆÙØ×&Ñ& t¨]ÀÐ&ÕDð ð "r>   c                óD   — | j                   }|r|j                  |«       yy)z;An event which occurs on a before a pop() operation occurs.N)rE   rÑ   )r'   r–   r$  s      r<   Ú__before_popr6  [  s#   € à×%Ñ%€HÙØ×&Ñ& }Õ5ð r>   c                 óº   ‡
— d„ Š
ˆ
fd„} ˆ
fd„}ˆ
fd„}ˆ
fd„}ˆ
fd„}ˆ
fd„}ˆ
fd„}ˆ
fd	„}ˆ
fd
„}t        «       j                  «       }	|	j                  d«       |	S )z:Tailored instrumentation wrappers for any list-like class.c                ód   — d| _         t        t        | j                  «      j                  | _        y rÂ   )rW   r×   r·   r@   rs   rP   s    r<   Ú_tidyz_list_decorators.<locals>._tidye  ó"   € Ø"ˆÔÜœT 2§;¡;Ó/×7Ñ7ˆ�
r>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                ó<   •— t        | ||t        «      } ‰| |«       y r9   )r2  r   )r;   r˜   r–   rQ   s      €r<   Úappendz0_list_decorators.<locals>.append.<locals>.appendj  s   ø€ Ü˜˜t ]´FÓ;ˆDÙˆt�T�Nr>   r9   r:   )rQ   r=  r9  s   ` €r<   r=  z _list_decorators.<locals>.appendi  s   ù€ õ	ñ 	ˆfŒØˆr>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                ó<   •— t        | ||t        «        ‰| |«       y r9   ©r4  r   ©r;   r#  r–   rQ   s      €r<   Úremovez0_list_decorators.<locals>.remove.<locals>.remover  s   ø€ Ü�$˜˜}¬fÔ5áˆt�U�Or>   r9   r:   ©rQ   rB  r9  s   ` €r<   rB  z _list_decorators.<locals>.removeq  s   ù€ õ	ñ
 	ˆfŒØˆr>   c                ó$   •‡ — ˆ fd„} ‰|«       |S )Nc                ó6   •— t        | |d |«      } ‰| ||«       y r9   )r2  )r;   r+  r#  rQ   s      €r<   Úinsertz0_list_decorators.<locals>.insert.<locals>.insert{  s   ø€ Ü˜$  t¨UÓ3ˆEÙˆt�U˜EÕ"r>   r:   )rQ   rF  r9  s   ` €r<   rF  z _list_decorators.<locals>.insertz  s   ù€ ô	#ñ 	ˆfŒØˆr>   c                ó$   •‡ — ˆ fd„} ‰|«       |S )Nc                óð  •— t        |t        «      s.| |   }|�t        | |d |«       t        | |d |«      } ‰
| ||«       y |j                  xs d}|j
                  xs d}|dk  r|t        | «      z  }|j                  �|j                  }nt        | «      }|dk  r|t        | «      z  }|dk(  rR|| u ry t        |||«      D ]  }t        | «      |kD  sŒ| |= Œ t        |«      D ]  \  }}| j                  ||z   |«       Œ y t        t        |||«      «      }	t        |«      t        |	«      k7  r#t        dt        |«      ›dt        |	«      ›�«      ‚t        |	|«      D ]  \  }}| j                  ||«       Œ y )Nr   r   z#attempt to assign sequence of size z to extended slice of size )rá   Úslicer4  r2  ÚstepÚstartr¿   ÚstopÚrangeÚ	enumeraterF  r·   Ú
ValueErrorÚzipÚ__setitem__)r;   r+  r#  ÚexistingrJ  rK  rL  Úir˜   ÚrngrQ   s             €r<   rQ  z:_list_decorators.<locals>.__setitem__.<locals>.__setitem__ƒ  ss  ø€ Ü˜e¤UÔ+Ø ™;�ØÐ'Ü˜$ ¨$°Ô6Ü˜d E¨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Ó,Ø $ U¡ð 6ô $-¨UÖ#3™˜˜4ØŸ™ A¨¡I¨tÕ4ñ $4ô œu U¨D°$Ó7Ó8�CÜ˜5“z¤S¨£XÒ-Ý(ô  # 5�z¬3¨s¬8ð5óð ô
 $' s¨E¦?™˜˜4Ø×(Ñ(¨¨DÕ1ñ $3r>   r:   ©rQ   rQ  r9  s   ` €r<   rQ  z%_list_decorators.<locals>.__setitem__‚  s   ù€ ô&	2ñP 	ˆkÔØÐr>   c                ó$   •‡ — ˆ fd„} ‰|«       |S )Nc                ó¢   •— t        |t        «      s| |   }t        | |d |«        ‰| |«       y | |   D ]  }t        | |d |«       Œ  ‰| |«       y r9   )rá   rI  r4  ©r;   r+  r˜   rQ   s      €r<   Ú__delitem__z:_list_decorators.<locals>.__delitem__.<locals>.__delitem__¯  sT   ø€ Ü˜e¤UÔ+Ø˜E‘{�Ü�d˜D $¨Ô.Ù�4˜•ð
 ! œK�DÜ˜$  d¨EÕ2ð (á�4˜•r>   r:   ©rQ   rY  r9  s   ` €r<   rY  z%_list_decorators.<locals>.__delitem__®  s   ù€ ô	 ñ 	ˆkÔØÐr>   c                ó   •— d„ } ‰|«       |S )Nc                óF   — t        |«      D ]  }| j                  |«       Œ y r9   ©r·   r=  ©r;   Úiterabler#  s      r<   Úextendz0_list_decorators.<locals>.extend.<locals>.extendÀ  s   € Ü˜hž�Ø—‘˜EÕ"ñ (r>   r:   )rQ   r`  r9  s     €r<   r`  z _list_decorators.<locals>.extend¿  s   ø€ ò	#ñ 	ˆfŒØˆr>   c                ó   •— d„ } ‰|«       |S )Nc                óH   — t        |«      D ]  }| j                  |«       Œ | S r9   r]  r^  s      r<   Ú__iadd__z4_list_decorators.<locals>.__iadd__.<locals>.__iadd__È  s#   € ô ˜hž�Ø—‘˜EÕ"ð (àˆKr>   r:   )rQ   rc  r9  s     €r<   rc  z"_list_decorators.<locals>.__iadd__Ç  ó   ø€ ò	ñ 	ˆhŒØˆr>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                óL   •— t        | «        ‰| |«      }t        | |d |«       |S r9   ©r6  r4  rX  s      €r<   r    z*_list_decorators.<locals>.pop.<locals>.popÓ  s)   ø€ Ü˜ÔÙ�d˜E“?ˆDÜ�$˜˜d EÔ*ØˆKr>   ©éÿÿÿÿr:   ©rQ   r    r9  s   ` €r<   r    z_list_decorators.<locals>.popÒ  s   ù€ õ	ñ 	ˆcŒ
Øˆ
r>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                ó@   •— | D ]  }t        | |d |«       Œ  ‰| «       y r9   ©r4  rX  s      €r<   Úclearz._list_decorators.<locals>.clear.<locals>.clearÝ  s"   ø€ Û�Ü�d˜D $¨Õ.ð áˆt�Hr>   rh  r:   ©rQ   rn  r9  s   ` €r<   rn  z_list_decorators.<locals>.clearÜ  s   ù€ õ	ñ
 	ˆeŒØˆr>   r9  ©ÚlocalsÚcopyr    )r=  rB  rF  rQ  rY  r`  rc  r    rn  Úlr9  s             @r<   Ú_list_decoratorsrt  b  sU   ø€ ò8ôôôô*ôXô"ô	ôôô 	‹�‰‹€AØ‡E�Eˆ'„NØ€Hr>   c                 ó¦   ‡— d„ Šˆfd„} ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„}t        «       j                  «       }|j                  d	«       |S )
zBTailored instrumentation wrappers for any dict-like mapping class.c                ód   — d| _         t        t        | j                  «      j                  | _        y rÂ   )rW   r×   r�   r@   rs   rP   s    r<   r9  z_dict_decorators.<locals>._tidyò  r:  r>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                ó`   •— || v rt        | | |   ||«       t        | |||«      } ‰| ||«       y r9   )r4  r2  )r;   r„   r#  r–   rQ   s       €r<   rQ  z:_dict_decorators.<locals>.__setitem__.<locals>.__setitem__÷  s8   ø€ Ø�d‰{Ü�d˜D ™I }°cÔ:Ü˜$  }°cÓ:ˆEÙˆt�S˜%Õ r>   r9   r:   rU  s   ` €r<   rQ  z%_dict_decorators.<locals>.__setitem__ö  s   ù€ õ	!ñ 	ˆkÔØÐr>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                óB   •— || v rt        | | |   ||«        ‰| |«       y r9   rm  )r;   r„   r–   rQ   s      €r<   rY  z:_dict_decorators.<locals>.__delitem__.<locals>.__delitem__  s%   ø€ Ø�d‰{Ü�d˜D ™I }°cÔ:Ùˆt�S�Mr>   r9   r:   rZ  s   ` €r<   rY  z%_dict_decorators.<locals>.__delitem__   s   ù€ õ	ñ
 	ˆkÔØÐr>   c                ó$   •‡ — ˆ fd„} ‰|«       |S )Nc                óF   •— | D ]  }t        | | |   d |«       Œ  ‰| «       y r9   rm  )r;   r„   rQ   s     €r<   rn  z._dict_decorators.<locals>.clear.<locals>.clear
  s&   ø€ Û�Ü�d˜D ™I t¨SÕ1ð áˆt�Hr>   r:   ro  s   ` €r<   rn  z_dict_decorators.<locals>.clear	  s   ù€ ô	ñ
 	ˆeŒØˆr>   c                ó0   •‡ — t         fˆ fd„	} ‰|«       |S )Nc                ó~   •— t        | «       || v }|t        u r
 ‰| |«      }n
 ‰| ||«      }|rt        | |d |«       |S r9   )r6  r   r4  )r;   r„   ÚdefaultÚ_to_delr˜   rQ   s        €r<   r    z*_dict_decorators.<locals>.pop.<locals>.pop  sK   ø€ Ü˜ÔØ˜T�kˆGØœ&Ñ Ù˜$ “}‘á˜$  WÓ-�ÙÜ�d˜D $¨Ô,ØˆKr>   r   rj  s   ` €r<   r    z_dict_decorators.<locals>.pop  s   ù€ Ü#)õ 		ñ 	ˆcŒ
Øˆ
r>   c                ó$   •‡ — ˆ fd„} ‰|«       |S )Nc                óP   •— t        | «        ‰| «      }t        | |d   d d«       |S )Nr   rg  ©r;   r˜   rQ   s     €r<   Úpopitemz2_dict_decorators.<locals>.popitem.<locals>.popitem"  s+   ø€ Ü˜ÔÙ�d“8ˆDÜ�$˜˜Q™  qÔ)ØˆKr>   r:   )rQ   r„  r9  s   ` €r<   r„  z!_dict_decorators.<locals>.popitem!  s   ù€ ô	ñ 	ˆgŒØˆr>   c                ó    •— dd„} ‰|«       |S )Nc                óz   — || vr| j                  ||«       |S | j                  |«      }||u rt        | |d «       |S r9   )rQ  Ú__getitem__r/  )r;   r„   r  r#  s       r<   r  z8_dict_decorators.<locals>.setdefault.<locals>.setdefault,  sG   € Ø˜$‰Ø× Ñ   gÔ.Ø�à×(Ñ(¨Ó-�Ø˜GÑ#Ü% d¨E°4Ô8à�r>   r9   r:   )rQ   r  r9  s     €r<   r  z$_dict_decorators.<locals>.setdefault+  s   ø€ ó		ñ 	ˆjÔØÐr>   c                ó*   •— t         fd„} ‰|«       |S )Nc                óH  — |t         urlt        |d«      r8t        |«      D ])  }|| vs
| |   ||   ur	||   | |<   Œt        | ||   d «       Œ+ n(|D ]#  \  }}|| vs| |   |ur|| |<   Œt        | |d «       Œ% |D ])  }|| vs
| |   ||   ur	||   | |<   Œt        | ||   d «       Œ+ y )NÚkeys)r   r
  r·   r/  )r;   Ú__otherr"  r„   r#  s        r<   Úupdatez0_dict_decorators.<locals>.update.<locals>.update;  sË   € ØœfÑ$Ü˜7 FÔ+Ü# Gž}˜Ø d™?¨d°3©i¸wÀs¹|Ñ.KØ(/°©˜D šIä-¨d°G¸C±LÀ$ÕGñ	  -ó '.™
˜˜UØ d™?¨d°3©i¸uÑ.DØ(-˜D šIä-¨d°E¸4Õ@ð	 '.ó
 �Ø˜d‘? d¨3¡i°r¸#±wÑ&>Ø " 3¡�D˜’Iä% d¨B¨s©G°TÕ:ñ	 r>   r   ©rQ   rŒ  r9  s     €r<   rŒ  z _dict_decorators.<locals>.update:  s   ø€ Ü!'ó 	;ñ( 	ˆfŒØˆr>   r9  rp  )	rQ  rY  rn  r    r„  r  rŒ  rs  r9  s	           @r<   Ú_dict_decoratorsrŽ  ï  sJ   ø€ ò8ôôôôôôôô0 	‹�‰‹€AØ‡E�Eˆ'„NØ€Hr>   c                ó>   — t        |t        | j                  fz   «      S )zKAllow only set, frozenset and self.__class__-derived
    objects in binops.)rá   Ú_set_binop_basesÚ	__class__©r;   Úobjs     r<   Ú_set_binops_check_strictr”  Z  s   € ô �cÔ+¨t¯~©~Ð.?Ñ?Ó@Ð@r>   c                óz   — t        |t        | j                  fz   «      xs t        j                  |«      t
        k(  S )z5Allow anything set-like to participate in set binops.)rá   r�  r‘  r   r  Úsetr’  s     r<   Ú_set_binops_check_looser—  `  s8   € ô 	�3Ô(¨D¯N©NÐ+<Ñ<Ó=ò 	1Ü×$Ñ$ SÓ)¬SÑ0ðr>   c                 óâ   ‡— d„ Šˆfd„} ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd„}ˆfd	„}ˆfd
„}ˆfd„}	ˆfd„}
ˆfd„}ˆfd„}t        «       j                  «       }|j                  d«       |S )z9Tailored instrumentation wrappers for any set-like class.c                ód   — d| _         t        t        | j                  «      j                  | _        y rÂ   )rW   r×   r–  r@   rs   rP   s    r<   r9  z_set_decorators.<locals>._tidyk  s"   € Ø"ˆÔÜœS "§+¡+Ó.×6Ñ6ˆ�
r>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                ó`   •— || vrt        | ||t        «      }nt        | ||«        ‰| |«       y r9   )r2  r   r/  rA  s      €r<   Úaddz)_set_decorators.<locals>.add.<locals>.addp  s0   ø€ Ø˜DÑ Ü˜d E¨=¼&ÓA‘ä! $¨¨}Ô=áˆt�U�Or>   r9   r:   )rQ   rœ  r9  s   ` €r<   rœ  z_set_decorators.<locals>.addo  s   ù€ õ	ñ 	ˆcŒ
Øˆ
r>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                óD   •— || v rt        | ||t        «        ‰| |«       y r9   r@  rA  s      €r<   Údiscardz1_set_decorators.<locals>.discard.<locals>.discard|  ó!   ø€ à˜‰}Ü�d˜E =´&Ô9áˆt�U�Or>   r9   r:   )rQ   rŸ  r9  s   ` €r<   rŸ  z _set_decorators.<locals>.discard{  s   ù€ õ	ñ 	ˆgŒØˆr>   c                ó&   •‡ — dˆ fd„	} ‰|«       |S )Nc                óD   •— || v rt        | ||t        «        ‰| |«       y r9   r@  rA  s      €r<   rB  z/_set_decorators.<locals>.remove.<locals>.remove‡  r   r>   r9   r:   rC  s   ` €r<   rB  z_set_decorators.<locals>.remove†  s   ù€ õ	ñ 	ˆfŒØˆr>   c                ó$   •‡ — ˆ fd„} ‰|«       |S )Nc                óR   •— t        | «        ‰| «      }t        | |d t        «       |S r9   )r6  r4  r   rƒ  s     €r<   r    z)_set_decorators.<locals>.pop.<locals>.pop’  s)   ø€ Ü˜ÔÙ�d“8ˆDô �$˜˜d¤FÔ+ØˆKr>   r:   rj  s   ` €r<   r    z_set_decorators.<locals>.pop‘  s   ù€ ô	ñ 	ˆcŒ
Øˆ
r>   c                ó   •— d„ } ‰|«       |S )Nc                óF   — t        | «      D ]  }| j                  |«       Œ y r9   )r·   rB  r©   s     r<   rn  z-_set_decorators.<locals>.clear.<locals>.clearž  s   € Ü˜Tž
�Ø—‘˜DÕ!ñ #r>   r:   ro  s     €r<   rn  z_set_decorators.<locals>.clear�  s   ø€ ò	"ñ 	ˆeŒØˆr>   c                ó   •— d„ } ‰|«       |S )Nc                ó4   — |D ]  }| j                  |«       Œ y r9   )rœ  ©r;   r#  r˜   s      r<   rŒ  z/_set_decorators.<locals>.update.<locals>.update¦  s   € Û�Ø—‘˜•ñ r>   r:   r�  s     €r<   rŒ  z_set_decorators.<locals>.update¥  s   ø€ ò	ñ 	ˆfŒØˆr>   c                ó   •— d„ } ‰|«       |S )Nc                óZ   — t        | |«      st        S |D ]  }| j                  |«       Œ | S r9   )r”  ÚNotImplementedrœ  r©  s      r<   Ú__ior__z1_set_decorators.<locals>.__ior__.<locals>.__ior__®  s,   € Ü+¨D°%Ô8Ü%Ð%Û�Ø—‘˜•ð àˆKr>   r:   )rQ   r­  r9  s     €r<   r­  z _set_decorators.<locals>.__ior__­  s   ø€ ò	ñ 	ˆgŒØˆr>   c                ó   •— d„ } ‰|«       |S )Nc                ó4   — |D ]  }| j                  |«       Œ y r9   )rŸ  r©  s      r<   Údifference_updatezE_set_decorators.<locals>.difference_update.<locals>.difference_update¹  s   € Û�Ø—‘˜TÕ"ñ r>   r:   )rQ   r°  r9  s     €r<   r°  z*_set_decorators.<locals>.difference_update¸  s   ø€ ò	#ñ 	ÐÔ Ø Ð r>   c                ó   •— d„ } ‰|«       |S )Nc                óZ   — t        | |«      st        S |D ]  }| j                  |«       Œ | S r9   )r”  r¬  rŸ  r©  s      r<   Ú__isub__z3_set_decorators.<locals>.__isub__.<locals>.__isub__Á  s-   € Ü+¨D°%Ô8Ü%Ð%Û�Ø—‘˜TÕ"ð àˆKr>   r:   )rQ   r³  r9  s     €r<   r³  z!_set_decorators.<locals>.__isub__À  rd  r>   c                ó   •— d„ } ‰|«       |S )Nc                ó°   — | j                  |«      t        | «      }}||z
  ||z
  }}|D ]  }| j                  |«       Œ |D ]  }| j                  |«       Œ y r9   )rã   r–  rB  rœ  ©r;   ÚotherÚwantÚhaverB  rœ  r˜   s          r<   Úintersection_updatezI_set_decorators.<locals>.intersection_update.<locals>.intersection_updateÌ  sV   € Ø×*Ñ*¨5Ó1´3°t³9�$ˆDØ ™+ t¨d¡{�CˆFã�Ø—‘˜DÕ!ð ã�Ø—‘˜•ñ r>   r:   )rQ   rº  r9  s     €r<   rº  z,_set_decorators.<locals>.intersection_updateË  s   ø€ ò	ñ 	Ð!Ô"Ø"Ð"r>   c                ó   •— d„ } ‰|«       |S )Nc                óÖ   — t        | |«      st        S | j                  |«      t        | «      }}||z
  ||z
  }}|D ]  }| j	                  |«       Œ |D ]  }| j                  |«       Œ | S r9   )r”  r¬  rã   r–  rB  rœ  r¶  s          r<   Ú__iand__z3_set_decorators.<locals>.__iand__.<locals>.__iand__Ù  sk   € Ü+¨D°%Ô8Ü%Ð%Ø×*Ñ*¨5Ó1´3°t³9�$ˆDØ ™+ t¨d¡{�CˆFã�Ø—‘˜DÕ!ð ã�Ø—‘˜•ð àˆKr>   r:   )rQ   r½  r9  s     €r<   r½  z!_set_decorators.<locals>.__iand__Ø  ó   ø€ ò
	ñ 	ˆhŒØˆr>   c                ó   •— d„ } ‰|«       |S )Nc                ó°   — | j                  |«      t        | «      }}||z
  ||z
  }}|D ]  }| j                  |«       Œ |D ]  }| j                  |«       Œ y r9   )Úsymmetric_differencer–  rB  rœ  r¶  s          r<   Úsymmetric_difference_updatezY_set_decorators.<locals>.symmetric_difference_update.<locals>.symmetric_difference_updateé  sV   € Ø×2Ñ2°5Ó9¼3¸t»9�$ˆDØ ™+ t¨d¡{�CˆFã�Ø—‘˜DÕ!ð ã�Ø—‘˜•ñ r>   r:   )rQ   rÂ  r9  s     €r<   rÂ  z4_set_decorators.<locals>.symmetric_difference_updateè  s   ø€ ò	ñ 	Ð)Ô*Ø*Ð*r>   c                ó   •— d„ } ‰|«       |S )Nc                óÖ   — t        | |«      st        S | j                  |«      t        | «      }}||z
  ||z
  }}|D ]  }| j	                  |«       Œ |D ]  }| j                  |«       Œ | S r9   )r”  r¬  rÁ  r–  rB  rœ  r¶  s          r<   Ú__ixor__z3_set_decorators.<locals>.__ixor__.<locals>.__ixor__ö  sk   € Ü+¨D°%Ô8Ü%Ð%Ø×2Ñ2°5Ó9¼3¸t»9�$ˆDØ ™+ t¨d¡{�CˆFã�Ø—‘˜DÕ!ð ã�Ø—‘˜•ð àˆKr>   r:   )rQ   rÅ  r9  s     €r<   rÅ  z!_set_decorators.<locals>.__ixor__õ  r¾  r>   r9  rp  )rœ  rŸ  rB  r    rn  rŒ  r­  r°  r³  rº  r½  rÂ  rÅ  rs  r9  s                 @r<   Ú_set_decoratorsrÆ  h  sh   ø€ ò7ô
ô	ô	ô
ôôô	ô!ô	ô#ôô +ôô  	‹�‰‹€AØ‡E�Eˆ'„NØ€Hr>   c                  ó   — e Zd ZdZy)ÚInstrumentedListz-An instrumented version of the built-in list.N©r@   rA   rB   rs   r:   r>   r<   rÈ  rÈ  
  ó   „ Ú7r>   rÈ  c                  ó   — e Zd ZdZy)ÚInstrumentedSetz,An instrumented version of the built-in set.NrÉ  r:   r>   r<   rÌ  rÌ    s   „ Ú6r>   rÌ  c                  ó   — e Zd ZdZy)ÚInstrumentedDictz-An instrumented version of the built-in dict.NrÉ  r:   r>   r<   rÎ  rÎ    rÊ  r>   rÎ  z/util.immutabledict[Any, _CollectionFactoryType]rð   r=  rB  r½   )rM   rS   rU   rœ  rU   rå   zMutil.immutabledict[Any, Tuple[Dict[str, str], Dict[str, Callable[..., Any]]]]r  c                ó¾   — ddl ma ddl ma ddl ma ddl ma ddl m a  ddl ma ddl ma dd	l ma t        t        «       t        t        «       t        t        «       y )
Nr   r"   r    r   r$   )r)   )r*   )r+   )r,   )r)   r#   r!   r   r%   r*   r+   r,   rö   rÈ  rÌ  )Úlclss    r<   Ú__gorÑ  :  s7   € õ 3Ý4Ý7Ý.å4Ý;Ý>Ý3ô Ô&Ô'Ü”oÔ&Ü”kÕ"r>   )r'   r3   r?   rD   r9   )rø   z4Union[Type[Collection[Any]], _CollectionFactoryType]r?   rñ   )r?   zDict[str, Callable[[_FN], _FN]])r;   r   r“  r   r?   r�   )Zrs   Ú
__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(   Ú
attrgetterrD   rî   rû   rö   rÿ   r   r  r  r  r/  r2  r4  r6  rt  rŽ  r–  Ú	frozensetr�  r”  r—  rÆ  rÈ  rÌ  rÎ  Úimmutabledictr·   r�   rð   rJ   r  rÑ  rq  r:   r>   r<   Ú<module>râ     s¡  ðò`õB #ã Û Û Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý  Ý Ý Û å Ý Ý Ý Ý 0Ý "à	×ÒÝ/Ý3Ý7Ý4Ý2Ý.Ý$ò€ð )˜)Ÿ.™.Ó*Ð ð " "Ð&BÐ"BÑCÐ áˆT˜Ô€Ùˆe˜3Ô€Ùˆe˜3Ô€ÙˆvÐ.Ô/€ÙˆeÐ/Ô0€ô6 8ô 6ô0 ô 0÷Eñ EñP ô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ð
 €D×ÑàÐ"Ø�ØÐ"ð	
óð ÐIó ð  €D×Ñàà$Ø#Ø&ññ
 Óð
ð 	Ø¨8ÀÑLÙÓð
ð
 	�
˜HÐ%Ñ'7Ó'9Ð:ðóð ð ó ò4#ñ4 �VƒX…r>   