Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
binop.cpython-313.pyc50 linesDownload Raw Back to __pycache__
1�

2��jw�	���SSKrSSKJrJr SSKJrJr SSKJrJ	r	J3r4 SSKJr SSK
Jr SSKJrJr SSKJrJrJrJr SS	KJr S5rSrS\S
\\\44SjrS\S\S
\4Sjr"SS\\\\\\45rg)�N)�Callable�Sequence)�Any�Generic)�NotRequired�Required�Self)�	OVERWRITE)�MISSING)�BaseChannel�Value)�EmptyChannelError�	ErrorCode�InvalidUpdateError�create_error_message)�	Overwrite)�BinaryOperatorAggregatec��[US5(aGUR[[4;a[	UR6S5$[	UR5$U$)z=Strips Annotated, Required and NotRequired from a given type.�7__origin__r)�hasattrrrr�
_strip_extras�__args__)�ts �^D:\code\apps\devtools\python\user_packages\Python313\site-packages\langgraph/channels/binop.pyrrsG���q�,����<�<�H�k�2�2� ����A��/�/��Q�\�\�*�*��H��value�returnc��[U[5(aSUR4$[U[5(a$[	U5S:Xa[8U;aSU[94$g)zEInspects the given value and returns (is_overwrite, overwrite_value).T�)FN)�10isinstancerr�dict�lenr11�rs r�_get_overwriter$sO���%��#�#��U�[�[� � ��%����3�u�:��?�y�E�7I��U�9�%�%�%�r�a�bc�J�URS:XdURS:XagXL$)z�Return True if two reducer operators should be considered equal.12 13Lambdas all share the name '<lambda>' so identity comparison is14unreliable; treat any pairing that includes a lambda as equal.15z<lambda>T)�__name__)r%r&s  r�_operators_equalr)(s%��	�z�z�Z��1�:�:��#;���6�Mrc�^�\rSrSrSrSrS\\S\\\/\44U4Sjjr	S\16S\4S	jr\
S\\4S17j5r\
S\\4Sj5rS\4SjrS
\S\4SjrS\\S\4SjrS\4SjrS\4SjrS\4SjrSrU=r$)r�3z�Stores the result of applying a binary operator to the current value and each new value.18 19```python20import operator21 22total = Channels.BinaryOperatorAggregate(int, operator.add)23```24)r�operator�typr,c�25>�[TU]U5 X l[U5nU[R26R[R27R4;a[nU[R28R[R29R4;a[nU[R30R[R31R4;a[nU"5Ulg![ a ["Ulgf=f�N)�super�__init__r,r�collections�abcr�MutableSequence�list�Set�32MutableSet�set�Mapping�MutableMappingr!r�	Exceptionr)�selfr-r,�	__class__s   �rr1� BinaryOperatorAggregate.__init__?s����
����� �
��C� ���;�?�?�+�+�[�_�_�-L�-L�M�M��C��;�?�?�&�&����(B�(B�C�C��C��;�?�?�*�*�K�O�O�,J�,J�K�K��C�	!���D�J���	!� �D�J�	!�s�C*�*D�Drrc�p�[U[5=(a  [URUR5$r/)r rr)r,)r<rs  r�__eq__�BinaryOperatorAggregate.__eq__Ps,���%�!8�9�33�>N��M�M�5�>�>�?34�	35rc��UR$)z,The type of the value stored in the channel.�r-�r<s r�	ValueType�!BinaryOperatorAggregate.ValueTypeU�
���x�x�rc��UR$)z/The type of the update received by the channel.rCrDs r�36UpdateType�"BinaryOperatorAggregate.UpdateTypeZrGrc��URURUR5nURUlURUlU$)zReturn a copy of the channel.)r=r-r,�keyr)r<�emptys  r�copy�BinaryOperatorAggregate.copy_s5�����t�x�x����7���H�H��	��j�j����r�37checkpointc��URURUR5nURUlU[LaXlU$r/)r=r-r,rLrr)r<rPrMs   r�from_checkpoint�'BinaryOperatorAggregate.from_checkpointfs7�����t�x�x����7���H�H��	��W�$�$�K��r�valuesc�R�U(dgUR[LaUSUlUSSnSnUHun[U5upEU(a4U(a#[S[R38S9n[
U5eXPlSnMKU(aMTURURU5UlMw g)NFrrz4Can receive only one Overwrite value per super-step.)�message�39error_codeT)rrr$rr�INVALID_CONCURRENT_GRAPH_UPDATErr,)r<rT�seen_overwriter�is_overwrite�overwrite_value�msgs       r�update�BinaryOperatorAggregate.updatems������:�:�� ����D�J��A�B�Z�F�$���E�,:�5�,A�)�L��!�.� V�#,�#L�#L��C�-�S�1�1�,�40�!%���!�>�!�]�]�4�:�:�u�=��41��rc�T�UR[La42[5eUR$r/)rrrrDs r�get�BinaryOperatorAggregate.get�s!���:�:�� �#�%�%��z�z�rc�&�UR[L$r/)rrrDs r�is_available�$BinaryOperatorAggregate.is_available�s���z�z��(�(rc��UR$r/r#rDs rrP�"BinaryOperatorAggregate.checkpoint�s���z�z�r)r,r)r(�43__module__�__qualname__�__firstlineno__�__doc__�	__slots__�typer
rr1�object�boolr@�propertyrErIr	rNrRrr]r`rcrP�__static_attributes__�
__classcell__)r=s@rrr3s�����&�I�!�D��K�!�8�U�E�N�E�<Q�3R�!�"44�F�45�t�46�47��4��;������D��K�����d���%��D���X�e�_����.�U��48)�d�)��E��rr) �collections.abcr2rr�typingrr�typing_extensionsrrr	�langgraph._internal._constantsr49�langgraph._internal._typingr�langgraph.channels.baserr
�langgraph.errorsrrrr�langgraph.typesr�__all__r�tuplernr$r)r�rr�<module>r}s����.��9�9�4�/�6���&�50&��
��#��%��c�	�"2�����X��$��Z�g�e�n�k�%���:M�.N�Zr
codekingpro/portable-devtools · Team Ai