§
    ø¦¹bº&  ã                   óî   —  e ¦   «         Z G d „ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z G d„ de¦  «        Z G d„ d	e¦  «        Z G d
„ d¦  «        Z G d„ d¦  «        Z G d„ d¦  «        Z	dS )c                   ó   — e Zd Zdd„Zd„ ZdS )ÚLimité    c                 ó"   — || _         || _        d S ©N)ÚoffsetÚcount)Úselfr   r   s      úC/usr/lib/python3/dist-packages/redis/commands/search/aggregation.pyÚ__init__zLimit.__init__   s   € ØˆŒØˆŒ
ˆ
ˆ
ó    c                 óf   — | j         r)dt          | j        ¦  «        t          | j         ¦  «        gS g S )NÚLIMIT)r   Ústrr   ©r	   s    r
   Ú
build_argszLimit.build_args	   s0   € ØŒ:ð 	Ø�S ¤Ñ-Ô-­s°4´:©¬Ð?Ð?àˆIr   N)r   r   ©Ú__name__Ú
__module__Ú__qualname__r   r   © r   r
   r   r      s7   € € € € € ðð ð ð ðð ð ð ð r   r   c                   ó8   — e Zd ZdZdZd„ Zd„ Zed„ ¦   «         ZdS )ÚReducerzr
    Base reducer object for all reducers.

    See the `redisearch.reducers` module for the actual reducers.
    Nc                 ó0   — || _         d | _        d | _        d S r   )Ú_argsÚ_fieldÚ_alias©r	   Úargss     r
   r   zReducer.__init__   s   € ØˆŒ
ØˆŒØˆŒˆˆr   c                 óp   — |t           u r%| j        st          d¦  «        ‚| j        dd…         }|| _        | S )a  
        Set the alias for this reducer.

        ### Parameters

        - **alias**: The value of the alias for this reducer. If this is the
            special value `aggregation.FIELDNAME` then this reducer will be
            aliased using the same name as the field upon which it operates.
            Note that using `FIELDNAME` is only possible on reducers which
            operate on a single field value.

        This method returns the `Reducer` object making it suitable for
        chaining.
        z(Cannot use FIELDNAME alias with no fieldé   N)Ú	FIELDNAMEr   Ú
ValueErrorr   )r	   Úaliass     r
   r#   zReducer.alias   sD   € ð •IÐÐØ”;ð MÝ Ð!KÑLÔLÐLà”K   ”OˆEØˆŒØˆr   c                 ó   — | j         S r   )r   r   s    r
   r   zReducer.args5   s
   € àŒzÐr   )	r   r   r   Ú__doc__ÚNAMEr   r#   Úpropertyr   r   r   r
   r   r      s^   € € € € € ðð ð €Dðð ð ð
ð ð ð. ðð ñ „Xðð ð r   r   c                   ó   — e Zd ZdZdZd„ ZdS )ÚSortDirectionz@
    This special class is used to indicate sort direction.
    Nc                 ó   — || _         d S r   )Úfield)r	   r+   s     r
   r   zSortDirection.__init__A   s   € ØˆŒ
ˆ
ˆ
r   )r   r   r   r%   Ú	DIRSTRINGr   r   r   r
   r)   r)   :   s4   € € € € € ðð ð €Iðð ð ð ð r   r)   c                   ó   — e Zd ZdZdZdS )ÚAsczK
    Indicate that the given field should be sorted in ascending order
    ÚASCN©r   r   r   r%   r,   r   r   r
   r.   r.   E   s   € € € € € ðð ð €I€I€Ir   r.   c                   ó   — e Zd ZdZdZdS )ÚDesczL
    Indicate that the given field should be sorted in descending order
    ÚDESCNr0   r   r   r
   r2   r2   M   s   € € € € € ðð ð €I€I€Ir   r2   c                   óX   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zdd„Zd„ ZdS )ÚAggregateRequestzH
    Aggregation request which can be passed to `Client.aggregate`.
    Ú*c                 óœ   — || _         g | _        g | _        d| _        t	          ¦   «         | _        d| _        d| _        d| _        g | _	        dS )a}  
        Create an aggregation request. This request may then be passed to
        `client.aggregate()`.

        In order for the request to be usable, it must contain at least one
        group.

        - **query** Query string for filtering records.

        All member methods (except `build_args()`)
        return the object itself, making them useful for chaining.
        Fr   N)
Ú_queryÚ_aggregateplanÚ_loadfieldsÚ_loadallr   Ú_limitÚ_maxÚ_with_schemaÚ	_verbatimÚ_cursor)r	   Úquerys     r
   r   zAggregateRequest.__init__Z   sN   € ð ˆŒØ ˆÔØˆÔØˆŒÝ‘g”gˆŒØˆŒ	Ø!ˆÔØˆŒØˆŒˆˆr   c                 óN   — |r| j                              |¦  «         nd| _        | S )aC  
        Indicate the fields to be returned in the response. These fields are
        returned in addition to any others implicitly specified.

        ### Parameters

        - **fields**: If fields not specified, all the fields will be loaded.
        Otherwise, fields should be given in the format of `@field`.
        T)r:   Úextendr;   )r	   Úfieldss     r
   ÚloadzAggregateRequest.loadq   s2   € ð ð 	!ØÔ×#Ò# FÑ+Ô+Ð+Ð+à ˆDŒMØˆr   c           	      óž  — t          |t          ¦  «        r|gn|}t          |t          ¦  «        r|gn|}dt          t          |¦  «        ¦  «        g|¢}|D ][}|d|j        t          t          |j        ¦  «        ¦  «        gz  }|                     |j        ¦  «         |j        �|d|j        gz  }Œ\| j                             |¦  «         | S )a|  
        Specify by which fields to group the aggregation.

        ### Parameters

        - **fields**: Fields to group by. This can either be a single string,
            or a list of strings. both cases, the field should be specified as
            `@field`.
        - **reducers**: One or more reducers. Reducers may be found in the
            `aggregation` module.
        ÚGROUPBYÚREDUCENÚAS)	Ú
isinstancer   r   Úlenr&   r   rC   r   r9   )r	   rD   ÚreducersÚretÚreducers        r
   Úgroup_byzAggregateRequest.group_by�   sÓ   € õ (¨µÑ4Ô4Ð@�&��¸&ˆÝ!+¨HµgÑ!>Ô!>ÐL�H�:�:ÀHˆà�#�c &™kœkÑ*Ô*Ð4¨VÐ4ˆØð 	.ð 	.ˆGØ�H˜gœl­Cµ°G´LÑ0AÔ0AÑ,BÔ,BÐCÑCˆCØ�JŠJ�w”|Ñ$Ô$Ð$ØŒ~Ð)Ø˜˜gœnÐ-Ñ-�øàÔ×"Ò" 3Ñ'Ô'Ð'Øˆr   c                 óˆ   — |                      ¦   «         D ],\  }}d|g}|�|d|gz  }| j                             |¦  «         Œ-| S )aQ  
        Specify one or more projection expressions to add to each result

        ### Parameters

        - **kwexpr**: One or more key-value pairs for a projection. The key is
            the alias for the projection, and the value is the projection
            expression itself, for example `apply(square_root="sqrt(@foo)")`
        ÚAPPLYNrI   )Úitemsr9   rC   )r	   Úkwexprr#   ÚexprrM   s        r
   ÚapplyzAggregateRequest.applyš   s[   € ð "Ÿ<š<™>œ>ð 	,ð 	,‰KˆE�4Ø˜D�/ˆCØÐ Ø˜˜e�}Ñ$�ØÔ×&Ò& sÑ+Ô+Ð+Ð+àˆr   c                 ó0   — t          ||¦  «        | _        | S )a  
        Sets the limit for the most recent group or query.

        If no group has been defined yet (via `group_by()`) then this sets
        the limit for the initial pool of results from the query. Otherwise,
        this limits the number of items operated on from the previous group.

        Setting a limit on the initial search results may be useful when
        attempting to execute an aggregation on a sample of a large data set.

        ### Parameters

        - **offset**: Result offset from which to begin paging
        - **num**: Number of results to return


        Example of sorting the initial results:

        ```
        AggregateRequest("@sale_amount:[10000, inf]")            .limit(0, 10)            .group_by("@state", r.count())
        ```

        Will only group by the states found in the first 10 results of the
        query `@sale_amount:[10000, inf]`. On the other hand,

        ```
        AggregateRequest("@sale_amount:[10000, inf]")            .limit(0, 1000)            .group_by("@state", r.count()            .limit(0, 10)
        ```

        Will group all the results matching the query, but only return the
        first 10 groups.

        If you only wish to return a *top-N* style query, consider using
        `sort_by()` instead.

        )r   r<   )r	   r   Únums      r
   ÚlimitzAggregateRequest.limit¬   s   € õT ˜F CÑ(Ô(ˆŒØˆr   c                 ó¦  — t          |t          t          f¦  «        r|g}g }|D ]/}t          |t          ¦  «        r||j        |j        gz  }Œ)||gz  }Œ0dt          t          |¦  «        ¦  «        g}|                     |¦  «         |                     dd¦  «        }|dk    r|dt          |¦  «        gz  }| j                             |¦  «         | S )a,  
        Indicate how the results should be sorted. This can also be used for
        *top-N* style queries

        ### Parameters

        - **fields**: The fields by which to sort. This can be either a single
            field or a list of fields. If you wish to specify order, you can
            use the `Asc` or `Desc` wrapper classes.
        - **max**: Maximum number of results to return. This can be
            used instead of `LIMIT` and is also faster.


        Example of sorting by `foo` ascending and `bar` descending:

        ```
        sort_by(Asc("@foo"), Desc("@bar"))
        ```

        Return the top 10 customers:

        ```
        AggregateRequest()            .group_by("@customer", r.sum("@paid").alias(FIELDNAME))            .sort_by(Desc("@paid"), max=10)
        ```
        ÚSORTBYÚmaxr   ÚMAX)	rJ   r   r)   r+   r,   rK   rC   Úgetr9   )r	   rD   ÚkwargsÚfields_argsÚfrM   r[   s          r
   Úsort_byzAggregateRequest.sort_byÙ   sä   € õ8 �f�s¥MÐ2Ñ3Ô3ð 	Ø�XˆFàˆØð 	#ð 	#ˆAÝ˜!�]Ñ+Ô+ð #Ø ¤¨¬Ð5Ñ5��à ˜sÑ"��à��S Ñ-Ô-Ñ.Ô.Ð/ˆØ�
Š
�;ÑÔÐØ�jŠj˜ Ñ"Ô"ˆØ�Š7ˆ7Ø�E�3˜s™8œ8Ð$Ñ$ˆCàÔ×"Ò" 3Ñ'Ô'Ð'Øˆr   c                 óx   — t          |t          ¦  «        r|g}|D ]}| j                             d|g¦  «         Œ| S )zÿ
        Specify filter for post-query results using predicates relating to
        values in the result set.

        ### Parameters

        - **fields**: Fields to group by. This can either be a single string,
            or a list of strings.
        ÚFILTER)rJ   r   r9   rC   )r	   ÚexpressionsÚ
expressions      r
   ÚfilterzAggregateRequest.filter  sP   € õ �k¥3Ñ'Ô'ð 	(Ø&˜-ˆKà%ð 	?ð 	?ˆJØÔ×&Ò&¨°*Ð'=Ñ>Ô>Ð>Ð>àˆr   c                 ó   — d| _         | S )z|
        If set, the `schema` property will contain a list of `[field, type]`
        entries in the result object.
        T)r>   r   s    r
   Úwith_schemazAggregateRequest.with_schema  s   € ð
 !ˆÔØˆr   c                 ó   — d| _         | S )NT)r?   r   s    r
   ÚverbatimzAggregateRequest.verbatim"  s   € ØˆŒØˆr   r   ç        c                 óx   — dg}|r|dt          |¦  «        gz  }|r|dt          |dz  ¦  «        gz  }|| _        | S )NÚ
WITHCURSORÚCOUNTÚMAXIDLEiè  )r   r@   )r	   r   Úmax_idler   s       r
   ÚcursorzAggregateRequest.cursor&  sU   € Øˆ~ˆØð 	*Ø�W�c %™jœjÐ)Ñ)ˆDØð 	6Ø�Y¥ H¨t¡OÑ 4Ô 4Ð5Ñ5ˆDØˆŒØˆr   c                 óL  — | j         g}| j        r|                     d¦  «         | j        r|                     d¦  «         | j        r
|| j        z  }| j        r+|                     d¦  «         |                     d¦  «         nj| j        rc|                     d¦  «         |                     t          t          | j        ¦  «        ¦  «        ¦  «         | 	                    | j        ¦  «         | 	                    | j
        ¦  «         || j                             ¦   «         z  }|S )NÚ
WITHSCHEMAÚVERBATIMÚLOADr6   )r8   r>   Úappendr?   r@   r;   r:   r   rK   rC   r9   r<   r   )r	   rM   s     r
   r   zAggregateRequest.build_args/  s  € àŒ{ˆmˆàÔð 	%Ø�JŠJ�|Ñ$Ô$Ð$àŒ>ð 	#Ø�JŠJ�zÑ"Ô"Ð"àŒ<ð 	 Ø�4”<ÑˆCàŒ=ð 	)Ø�JŠJ�vÑÔÐØ�JŠJ�s‰OŒOˆOˆOØÔð 	)Ø�JŠJ�vÑÔÐØ�JŠJ•s�3˜tÔ/Ñ0Ô0Ñ1Ô1Ñ2Ô2Ð2Ø�JŠJ�tÔ'Ñ(Ô(Ð(à�
Š
�4Ô&Ñ'Ô'Ð'àˆtŒ{×%Ò%Ñ'Ô'Ñ'ˆàˆ
r   N)r6   )r   rk   )r   r   r   r%   r   rE   rO   rU   rX   ra   rf   rh   rj   rq   r   r   r   r
   r5   r5   U   sÏ   € € € € € ðð ðð ð ð ð.ð ð ð ð ð ð2ð ð ð$+ð +ð +ðZ-ð -ð -ð^ð ð ð$ð ð ðð ð ðð ð ð ðð ð ð ð r   r5   c                   ó   — e Zd Zd„ Zd„ ZdS )ÚCursorc                 ó0   — || _         d| _        d| _        d S )Nr   )Úcidrp   r   ©r	   rz   s     r
   r   zCursor.__init__L  s   € ØˆŒØˆŒØˆŒ
ˆ
ˆ
r   c                 ó°   — t          | j        ¦  «        g}| j        r|dt          | j        ¦  «        gz  }| j        r|dt          | j        ¦  «        gz  }|S )Nro   rn   )r   rz   rp   r   r   s     r
   r   zCursor.build_argsQ  sZ   € Ý�D”H‘”ˆˆØŒ=ð 	4Ø�Y¥ D¤MÑ 2Ô 2Ð3Ñ3ˆDØŒ:ð 	/Ø�W�c $¤*™oœoÐ.Ñ.ˆDØˆr   Nr   r   r   r
   rx   rx   K  s2   € € € € € ðð ð ð
ð ð ð ð r   rx   c                   ó   — e Zd Zd„ Zd„ ZdS )ÚAggregateResultc                 ó0   — || _         || _        || _        d S r   )Úrowsrq   Úschema)r	   r€   rq   r�   s       r
   r   zAggregateResult.__init__[  s   € ØˆŒ	ØˆŒØˆŒˆˆr   c           	      óž   — | j         r| j         j        nd}d| j        j        › dt	          | ¦  «        d›dt          | j        ¦  «        › d|› d�	S )Néÿÿÿÿú<z at 0xÚxz Rows=z	, Cursor=ú>)rq   rz   Ú	__class__r   ÚidrK   r€   r{   s     r
   Ú__repr__zAggregateResult.__repr__`  sm   € Ø!%¤Ð4ˆdŒkŒoˆo°"ˆð4�”Ô'ð 4ð 4­r°$©x¬xÐ<ð 4ð 4Ý˜œ	‘N”Nð4ð 4Ø-0ð4ð 4ð 4ð	
r   N)r   r   r   r   r‰   r   r   r
   r~   r~   Z  s2   € € € € € ðð ð ð

ð 
ð 
ð 
ð 
r   r~   N)
Úobjectr!   r   r   r)   r.   r2   r5   rx   r~   r   r   r
   ú<module>r‹      sh  ðØˆF‰HŒH€	ð	ð 	ð 	ð 	ð 	ñ 	ô 	ð 	ð'ð 'ð 'ð 'ð 'ñ 'ô 'ð 'ðTð ð ð ð ñ ô ð ðð ð ð ð ˆ-ñ ô ð ðð ð ð ð ˆ=ñ ô ð ðsð sð sð sð sñ sô sð sðlð ð ð ð ñ ô ð ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r   