HEX
Server: Apache
System: Linux pdx1-shared-a1-29 6.18.39-grsec-noble+ #4 SMP Thu Jul 23 07:53:29 UTC 2026 x86_64
User: dh_bj99yp (22285841)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/boto/dynamodb2/__pycache__/results.cpython-312.pyc
�

ckF[���0�Gd�de�ZGd�de�Zy)c�V��eZdZdZd	�fd�	Zed��Zd�Zd�Zd�Z	e	Z
d�Zd�Z�xZ
S)
�	ResultSeta�
    A class used to lazily handle page-to-page navigation through a set of
    results.

    It presents a transparent iterator interface, so that all the user has
    to do is use it in a typical ``for`` loop (or list comprehension, etc.)
    to fetch results, even if they weren't present in the current page of
    results.

    This is used by the ``Table.query`` & ``Table.scan`` methods.

    Example::

        >>> users = Table('users')
        >>> results = ResultSet()
        >>> results.to_call(users.query, username__gte='johndoe')
        # Now iterate. When it runs out of results, it'll fetch the next page.
        >>> for res in results:
        ...     print res['username']

    c���tt|��d|_g|_i|_g|_d|_d|_d|_	d|_
||_d|_y)N���T�)
�superr�__init__�the_callable�	call_args�call_kwargs�_results�_offset�
_results_left�_last_key_seen�_fetches�_max_page_size�_limit)�self�
max_page_size�	__class__s  ��8/usr/lib/python3/dist-packages/boto/dynamodb2/results.pyrzResultSet.__init__s[���
�i��'�)� �����������
����!���"�����
�+������c��y)N�exclusive_start_key��rs r�	first_keyzResultSet.first_key$s��$rc� �g|_d|_y)z�
        Resets the internal state of the ``ResultSet``.

        This prevents results from being cached long-term & consuming
        excess memory.

        Largely internal.
        rN)rr
rs r�_resetzResultSet._reset(s����
���rc��|S�Nrrs r�__iter__zResultSet.__iter__4s���rc�d�|xjdz
c_|jt|j�k\r{|jdur
t	��|j�t|j�s>|jr2|j�t|j�s
|jr�2|jt|j�krS|j�.|xjdzc_|jdkr
t	��|j|jSt	��)N�Fr)r
�lenrr�
StopIteration�
fetch_morerrs r�__next__zResultSet.__next__7s����������<�<�3�t�}�}�-�-��!�!�U�*�#�o�%��O�O��
�$�-�-�(�T�-?�-?����!��$�-�-�(�T�-?�-?��<�<�#�d�m�m�,�,��{�{�&����q� ���;�;��?�'�/�)��=�=����.�.��/�!rc���t|�std��|jdd�|_|j�|jdkrd|_||_||_||_y)a�
        Sets up the callable & any arguments to run it with.

        This is stored for subsequent calls so that those queries can be
        run without requiring user intervention.

        Example::

            # Just an example callable.
            >>> def squares_to(y):
            ...     for x in range(1, y):
            ...         yield x**2
            >>> rs = ResultSet()
            # Set up what to call & arguments.
            >>> rs.to_call(squares_to, y=3)

        z3You must supply an object or function to be called.�limitNr)�callable�
ValueError�poprr	r
r)rr	�args�kwargss    r�to_callzResultSet.to_callSsb��$��%��E��
��j�j��$�/����;�;�"�t�{�{�Q���D�K�(������!��rc�T�|j�|jdd}|jj�}|j�|j||j
<|jr6|jr*|j|jkDr|j|_|j�|j|d<n|j�|j|d<|j|i|��}|xjdz
c_	|jdg�}|jdd�|_t|�r|jj|d�|j�8|jdk\r)|j}|t|d�z}|dkrd|_|j�d|_yy)z�
        When the iterator runs out of results, this method is run to re-execute
        the callable (& arguments) to fetch the next page.

        Largely internal.
        Nr)r#�results�last_keyrF)rr
r�copyrrrrr	r�getr$r�extendr)rr-r.r1�new_resultsr)s      rr&zResultSet.fetch_morevsx��	
���
��~�~�a� ���!�!�&�&�(�����*�%)�%8�%8�F�4�>�>�"��;�;�4�.�.�4�3F�3F����3T�"&�+�+�D�����*�"�1�1�F�7�O�
�[�[�
$�#�k�k�F�7�O�#�$�#�#�T�4�V�4���
�
���
��k�k�)�R�0��%�k�k�*�d�;����{���M�M� � ���!3�4��;�;�"�t�{�{�a�'7��K�K�E��S���+�,�,�E���z�%*��"����&�!&�D��'rr )�__name__�
__module__�__qualname__�__doc__r�propertyrrr!r'�nextr/r&�
__classcell__�rs@rrrsB����*��%��%�
��"�4�D�!"�F.'rrc�$��eZdZ�fd�Zd�Z�xZS)�BatchGetResultSetc���|jdg�|_|jdd�|_tt|�|i|��y)N�keys�
max_batch_get�d)r,�
_keys_left�_max_batch_getrr@r)rr-r.rs   �rrzBatchGetResultSet.__init__�s=��� �*�*�V�R�0���$�j�j��#�>���
���/��@��@rc��|j�|jdd}|jj�}|jd|j
|d<|j|j
d|_t
|j�dkrd|_|j|i|��}t
|jdg��sy|jj|d�t|jdg��D]!\}}|jj||��#t
|j�dkDrd|_|jjd�r$|jdxxt
|d�zcc<yy)NrBrFr1�unprocessed_keysTr))rr
rr3rErFr$rr	r4rr5�	enumerate�insert)rr-r.r1�offset�key_datas      rr&zBatchGetResultSet.fetch_more�sQ�����
��~�~�a� ���!�!�&�&�(�����)=�$�*=�*=�>��v���/�/�$�*=�*=�*>�?����t����1�$�!&�D��#�$�#�#�T�4�V�4���7�;�;�y�"�-�.���
�
���W�Y�/�0� )�'�+�+�6H�"�*M� N�	5��F�H�
�O�O�"�"�6�8�4�		5��t����!�#�!%�D��������(����W�%��W�Y�-?�)@�@�%�)r)r7r8r9rr&r=r>s@rr@r@�s���A�
Arr@N)�objectrr@rrr�<module>rNs"��c'��c'�L%A�	�%Ar