hyb
2025-12-23 7e5db3a16b423ec4a43459805e277979bcac7db5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Ë
 
çúh|ãóF—ddlmZddlmZmZmZmZGd„de«ZGd„de«ZGd„d    e«Z    Gd
„d e«Z
Gd „d e«Z Gd„de«Z Gd„de«Z Gd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«ZGd„de«Zy)é)ÚUnioné)ÚAscÚDescÚReducerÚ SortDirectioncó,‡—eZdZdZdeddfˆfd„ ZˆxZS)ÚFieldOnlyReducerzHSee https://redis.io/docs/interact/search-and-query/search/aggregations/ÚfieldÚreturnNcó2•—t‰||«||_y©N)ÚsuperÚ__init__Ú_field©Úselfr Ú    __class__s  €õqH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\redis/commands/search/reducers.pyrzFieldOnlyReducer.__init__    sø€Ü ‰Ñ˜Ô؈ ó)Ú__name__Ú
__module__Ú __qualname__Ú__doc__ÚstrrÚ __classcell__©rs@rr
r
sø„ÙRð˜cð d÷ñrr
có(‡—eZdZdZdZdˆfd„ ZˆxZS)Úcountz3
    Counts the number of results in the group
    ÚCOUNTcó"•—t‰|«yr©rr)rrs €rrzcount.__init__sø€Ü ‰ÑÕr)r N)rrrrÚNAMErrrs@rrrsø„ñð €D÷ñrrcó0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)ÚsumzS
    Calculates the sum of all the values in the given fields within the group
    ÚSUMr r Ncó$•—t‰||«yrr"rs  €rrz sum.__init__ óø€Ü ‰Ñ˜Õr©rrrrr#rrrrs@rr%r%ó'ø„ñð €Dð ˜cð  d÷ ñ rr%có0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)ÚminzK
    Calculates the smallest value in the given field within the group
    ÚMINr r Ncó$•—t‰||«yrr"rs  €rrz min.__init__+r(rr)rs@rr,r,$r*rr,có0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)ÚmaxzJ
    Calculates the largest value in the given field within the group
    ÚMAXr r Ncó$•—t‰||«yrr"rs  €rrz max.__init__6r(rr)rs@rr0r0/r*rr0có0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)ÚavgzG
    Calculates the mean value in the given field within the group
    ÚAVGr r Ncó$•—t‰||«yrr"rs  €rrz avg.__init__Ar(rr)rs@rr4r4:r*rr4có0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)Útolistz6
    Returns all the matched properties in a list
    ÚTOLISTr r Ncó$•—t‰||«yrr"rs  €rrztolist.__init__Lr(rr)rs@rr8r8Eó'ø„ñð €Dð ˜cð  d÷ ñ rr8có0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)Úcount_distinctzs
    Calculate the number of distinct values contained in all the results in
    the group for the given field
    ÚCOUNT_DISTINCTr r Ncó$•—t‰||«yrr"rs  €rrzcount_distinct.__init__Xr(rr)rs@rr=r=Ps'ø„ñð
€Dð ˜cð  d÷ ñ rr=có—eZdZdZdZy)Ú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
    ÚCOUNT_DISTINCTISHN)rrrrr#©rrrArA\s„ñð DrrAcó4‡—eZdZdZdZdededdfˆfd„ ZˆxZS)Úquantilezp
    Return the value for the nth percentile within the range of values for the
    field within the group.
    ÚQUANTILEr Úpctr NcóF•—t‰||t|««||_yr)rrrr)rr rGrs   €rrzquantile.__init__nsø€Ü ‰Ñ˜¤ C£Ô)؈ r)    rrrrr#rÚfloatrrrs@rrErEfs.ø„ñð
€Dð˜cð¨ð°$÷ñrrEcó0‡—eZdZdZdZdeddfˆfd„ ZˆxZS)ÚstddevzG
    Return the standard deviation for the values within the group
    ÚSTDDEVr r Ncó$•—t‰||«yrr"rs  €rrzstddev.__init__zr(rr)rs@rrKrKsr;rrKcó>‡—eZdZdZdZdedeeefddfˆfd„ Z    ˆxZ
S)Ú first_valuezR
    Selects the first value within the group according to sorting parameters
    Ú FIRST_VALUEr Úbyfieldsr Ncó•—g}t|«dk(r2t|dt«rt|dt«r |d|«g}|D]}||j
|j gz }Œ|g}|r    |dg|zz }t‰| |Ž||_    y)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
        rrÚBYN)
ÚlenÚ
isinstanceÚtypeÚ
issubclassrr Ú    DIRSTRINGrrr)rr rQÚ    fieldstrsÚfÚargsrs      €rrzfirst_value.__init__…sœø€ðˆ    ä ‹M˜QÒ Ü˜8 A™;¬Ô-ܘ8 A™;¬ Ô6à#˜ ™  EÓ*Ð+ˆHàò    0ˆAØ ˜!Ÿ'™' 1§;¡;Ð/Ñ /‰Ið    0ðˆwˆÙ Ø TF˜YÑ&Ñ &ˆDÜ ‰Ñ˜$ÑØˆ r) rrrrr#rrrrrrrs@rrOrO~s7ø„ñð €Dð˜cð¨e°C¸°IÑ.>ðÀ4÷ñrrOcó4‡—eZdZdZdZdededdfˆfd„ ZˆxZS)Ú random_samplezT
    Returns a random sample of items from the dataset, from the given property
    Ú RANDOM_SAMPLEr Úsizer NcóF•—|t|«g}t‰||Ž||_y)z
        ### Parameter
 
        **field**: Field to sample from
        **size**: Return this many items (can be less)
        N)rrrr)rr r_r[rs    €rrzrandom_sample.__init__­s'ø€ð”s˜4“yÐ!ˆÜ ‰Ñ˜$ÑØˆ r)    rrrrr#rÚintrrrs@rr]r]¦s.ø„ñð €Dð    ˜cð    ¨ð    °÷    ñ    rr]N)ÚtypingrÚ aggregationrrrrr
rr%r,r0r4r8r=rArErKrOr]rCrrú<module>rds³ðÝç:Ó:ôwôôˆGôô Ð
ô ô Ð
ô ô Ð
ô ô Ð
ô ô Ð ô ô     Ð%ô     ôÐ(ôô
ˆwô
ô Ð ô ô%'ô%ôPGõr