HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //lib/python3.9/site-packages/redis/commands/search/__pycache__/reducers.cpython-39.pyc
a

��bN�@s�ddlmZmZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZdS)�)�Reducer�
SortDirectioncseZdZ�fdd�Z�ZS)�FieldOnlyReducercst��|�||_dS�N)�super�__init__�_field��self�field��	__class__��B/usr/lib/python3.9/site-packages/redis/commands/search/reducers.pyrszFieldOnlyReducer.__init__)�__name__�
__module__�__qualname__r�
__classcell__rrrrrsrcs$eZdZdZdZ�fdd�Z�ZS)�countz3
    Counts the number of results in the group
    ZCOUNTcst���dSr�rr)r
rrrrszcount.__init__�rrr�__doc__�NAMErrrrrrr
srcs$eZdZdZdZ�fdd�Z�ZS)�sumzS
    Calculates the sum of all the values in the given fields within the group
    ZSUMcst��|�dSrrr	rrrrszsum.__init__rrrrrrsrcs$eZdZdZdZ�fdd�Z�ZS)�minzK
    Calculates the smallest value in the given field within the group
    ZMINcst��|�dSrrr	rrrr'szmin.__init__rrrrrr srcs$eZdZdZdZ�fdd�Z�ZS)�maxzJ
    Calculates the largest value in the given field within the group
    �MAXcst��|�dSrrr	rrrr2szmax.__init__rrrrrr+srcs$eZdZdZdZ�fdd�Z�ZS)�avgzG
    Calculates the mean value in the given field within the group
    ZAVGcst��|�dSrrr	rrrr=szavg.__init__rrrrrr6srcs$eZdZdZdZ�fdd�Z�ZS)�tolistz6
    Returns all the matched properties in a list
    ZTOLISTcst��|�dSrrr	rrrrHsztolist.__init__rrrrrrAsrcs$eZdZdZdZ�fdd�Z�ZS)�count_distinctzs
    Calculate the number of distinct values contained in all the results in
    the group for the given field
    ZCOUNT_DISTINCTcst��|�dSrrr	rrrrTszcount_distinct.__init__rrrrrrLsrc@seZdZdZdZdS)�count_distinctishz�
    Calculate the number of distinct values contained in all the results in the
    group for the given field. This uses a faster algorithm than
    `count_distinct` but is less accurate
    ZCOUNT_DISTINCTISHN)rrrrrrrrrr Xsr cs$eZdZdZdZ�fdd�Z�ZS)�quantilezp
    Return the value for the nth percentile within the range of values for the
    field within the group.
    ZQUANTILEcst��|t|��||_dSr)rr�strr)r
rZpctrrrrjszquantile.__init__rrrrrr!bsr!cs$eZdZdZdZ�fdd�Z�ZS)�stddevzG
    Return the standard deviation for the values within the group
    ZSTDDEVcst��|�dSrrr	rrrrvszstddev.__init__rrrrrr#osr#cs$eZdZdZdZ�fdd�Z�ZS)�first_valuezR
    Selects the first value within the group according to sorting parameters
    ZFIRST_VALUEcs�g}t|�dkr:t|dt�r:t|dt�r:|d|�g}|D]}||j|jg7}q>|g}|rl|dg|7}t�j|�||_	dS)a�
        Selects the first value of the given field within the group.

        ### Parameter

        - **field**: Source field used for the value
        - **byfields**: How to sort the results. This can be either the
            *class* of `aggregation.Asc` or `aggregation.Desc` in which
            case the field `field` is also used as the sort input.

            `byfields` can also be one or more *instances* of `Asc` or `Desc`
            indicating the sort order for these fields
        r�ZBYN)
�len�
isinstance�type�
issubclassrrZ	DIRSTRINGrrr)r
rZbyfieldsZ	fieldstrs�f�argsrrrr�s
���zfirst_value.__init__rrrrrr$zsr$cs$eZdZdZdZ�fdd�Z�ZS)�
random_samplezT
    Returns a random sample of items from the dataset, from the given property
    Z
RANDOM_SAMPLEcs"|t|�g}t�j|�||_dS)z
        ### Parameter

        **field**: Field to sample from
        **size**: Return this many items (can be less)
        N)r"rrr)r
r�sizer+rrrr�szrandom_sample.__init__rrrrrr,�sr,N)Zaggregationrrrrrrrrrrr r!r#r$r,rrrr�<module>s

(