� L�g �� �dZddlmZddlZddlmZddlmZddl m Z ddl m Z dd l m Z dd l mZdd l mZdd l mZdd l mZddl mZddl mZGd�deeefeeef��ZGd�deeef��ZdS)z3Provide :class:`MutableBidict` and :class:`bidict`.�)� annotationsN�)�MutableBidirectionalMapping)� BidictBase)�ON_DUP_DROP_OLD)� ON_DUP_RAISE)�OnDup)�DT)�KT)�MISSING)�ODT)�VT)� MapOrItemsc��eZdZdZejred*d���Zed*d���Zd+d �Z d,d �Z d-d �Z e fd.d�Z d-d�Zd/d�Zejd+d���Zejd0d1d���Zefd2d�Zd3d�Zd4d5d!�Zd4d5d"�Ze fd6d$�Zd7d(�Zd)S)8� MutableBidictz.Base class for mutable bidirectional mappings.�return�MutableBidict[VT, KT]c��dS�N���selfs �^/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/bidict/_bidict.py�inversezMutableBidict.inverse's��47�C�c��dSrrrs r�invzMutableBidict.inv*s��03�r�keyr rc�J�|j�|��}|j|=|Sr)�_fwdm�pop�_invm�rr�vals r�_popzMutableBidict._pop-s#���j�n�n�S�!�!�� �J�s�O�� r�Nonec�0�|�|��dS)u#*x.__delitem__(y) ⟺ del x[y]*N)r%�rrs r� __delitem__zMutableBidict.__delitem__2s�� � � �#�����rr$c�@�|�|||j���dS)a*Set the value for *key* to *val*. If *key* is already associated with *val*, this is a no-op. If *key* is already associated with a different value, the old value will be replaced with *val*, as with dict's :meth:`__setitem__`. If *val* is already associated with a different key, an exception is raised to protect against accidental removal of the key that's currently associated with *val*. Use :meth:`put` instead if you want to specify different behavior in the case that the provided key or value duplicates an existing one. Or use :meth:`forceput` to unconditionally associate *key* with *val*, replacing any existing items as necessary to preserve uniqueness. :raises bidict.ValueDuplicationError: if *val* duplicates that of an existing item. :raises bidict.KeyAndValueDuplicationError: if *key* duplicates the key of an existing item and *val* duplicates the value of a different existing item. ��on_dupN)�putr,r#s r� __setitem__zMutableBidict.__setitem__6s$��4 ����c�$�+��.�.�.�.�.rr,r c�:�|�||ff|���dS)aMAssociate *key* with *val*, honoring the :class:`OnDup` given in *on_dup*. For example, if *on_dup* is :attr:`~bidict.ON_DUP_RAISE`, then *key* will be associated with *val* if and only if *key* is not already associated with an existing value and *val* is not already associated with an existing key, otherwise an exception will be raised. If *key* is already associated with *val*, this is a no-op. :raises bidict.KeyDuplicationError: if attempting to insert an item whose key only duplicates an existing item's, and *on_dup.key* is :attr:`~bidict.RAISE`. :raises bidict.ValueDuplicationError: if attempting to insert an item whose value only duplicates an existing item's, and *on_dup.val* is :attr:`~bidict.RAISE`. :raises bidict.KeyAndValueDuplicationError: if attempting to insert an item whose key duplicates one existing item's, and whose value duplicates another existing item's, and *on_dup.val* is :attr:`~bidict.RAISE`. r+N��_update)rrr$r,s rr-zMutableBidict.putRs&��0 � � �s�C�j�]�6� �2�2�2�2�2rc�@�|�||t���dS)z�Associate *key* with *val* unconditionally. Replace any existing mappings containing key *key* or value *val* as necessary to preserve uniqueness. r+N)r-rr#s r�forceputzMutableBidict.forceputls"�� ����c�/��2�2�2�2�2rc�j�|j���|j���dS)zRemove all items.N)r �clearr"rs rr5zMutableBidict.clearts0�� � ������ � �������rc��dSrrr(s rr!zMutableBidict.popys��%(�Sr.�defaultr �VT | DTc��dSrr�rrr7s rr!zMutableBidict.pop{s��=@�Sr�ODT[DT]c�f� |�|��S#t$r|tur�|cYSwxYw)u�*x.pop(k[, d]) → v* Remove specified key and return the corresponding value. :raises KeyError: if *key* is not found and no *default* is provided. )r%�KeyErrorr r:s rr!zMutableBidict.pop~sI�� ��9�9�S�>�>� !��� � � ��'�!�!���N�N�N� ���s ��0�0� tuple[KT, VT]c�R�|j���\}}|j|=||fS)u�*x.popitem() → (k, v)* Remove and return some item as a (key, value) pair. :raises KeyError: if *x* is empty. )r �popitemr"r#s rr@zMutableBidict.popitem�s-���:�%�%�'�'���S� �J�s�O��C�x�rr�arg�MapOrItems[KT, VT]�kwc �4�|�||���dS)zCLike calling :meth:`putall` with *self.on_dup* passed for *on_dup*.)rCNr0�rrArCs r�updatezMutableBidict.update�s�� � � �S�R� � � � � � rc �@�|�||t���dS)zLike a bulk :meth:`forceput`.)rCr,N)r1rrEs r� forceupdatezMutableBidict.forceupdate�s �� � � �S�R�� �8�8�8�8�8r�itemsc�4�|�||���dS)z�Like a bulk :meth:`put`. If one of the given items causes an exception to be raised, none of the items is inserted. r+Nr0)rrIr,s r�putallzMutableBidict.putall�s �� � � �U�6� �*�*�*�*�*r�other�t.Mapping[KT, VT]�MutableBidict[KT, VT]c�0�|�|��|S)zReturn self|=other.)rF)rrLs r�__ior__zMutableBidict.__ior__�s�� � � �E����� rN)rr)rr rr)rr rr&)rr r$rrr&)rr r$rr,r rr&)rr&).)rr r7r rr8)rr r7r;rr8)rr>)r)rArBrCrrr&)rIrBr,r rr&)rLrMrrN)�__name__� __module__� __qualname__�__doc__�t� TYPE_CHECKING�propertyrrr%r)r.rr-r3r5�overloadr!r r@rFrHrKrPrrrrr"s�������8�8���4� �7�7�7� ��7� �3�3�3� ��3����� ����/�/�/�/�85A�3�3�3�3�3�43�3�3�3����� �Z�(�(�(��Z�(��Z�@�@�@�@��Z�@�.5� � � � � � � � � �!�!�!�!�!�9�9�9�9�9�AM�+�+�+�+�+������rrc�T�eZdZdZejredd���Zedd���ZdSdS)�bidictz�The main bidirectional mapping type. See :ref:`intro:Introduction` and :ref:`basic-usage:Basic Usage` to get started (also available at https://bidict.rtfd.io). r�bidict[VT, KT]c��dSrrrs rrzbidict.inverse�s��-0�Src��dSrrrs rrz bidict.inv�s��),�rN)rr[) rQrRrSrTrUrVrWrrrrrrZrZ�s\��������  ��-� �0�0�0� ��0� �,�,�,� ��,�,�,� -�-rrZ)rT� __future__r�typingrU�_abcr�_baser�_duprrr �_typingr r r r rrrrZrrr�<module>rdsv��:�9�"�"�"�"�"�"�����-�-�-�-�-�-�������!�!�!�!�!�!�������������������������������������������������J�J�J�J�J�J�r�2�v�&�(C�B��F�(K�J�J�J�Z -� -� -� -� -�]�2�r�6� "� -� -� -� -� -r
Memory