
    ci             	       H   d dl Zd dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZ d dlmZ ddlmZ ddlmZmZmZmZ ddlmZmZmZ erd d	lmZ dd
l m!Z! ddl"m#Z# ddl$m%Z% 	 ddeee&ef         de&f         deee&df                  deddfdZ' G d dee	e                   Z( G d de	e                   Z) G d de)e         e(e                   Z* G d de(e                   Z+ G d de*e                   Z, G d de*e                   Z- G d  d!e(e                   Z. G d" d#e+e                   Z/ G d$ d%e(e                   Z0 G d& d'e+e                   Z1 G d( d)e+e                   Z2 G d* d+e*e                   Z3 G d, d-e+e                   Z4 G d. d/e+e                   Z5 G d0 d1e(e                   Z6 G d2 d3e(e                   Z7 G d4 d5e(e                   Z8 G d6 d7e*e                   Z9 G d8 d9e+e                   Z: G d: d;e*e                   Z; G d< d=e*e                   Z< G d> d?e+e                   Z= G d@ dAe+e                   Z> G dB dCe*e                   Z? G dD dEe*e                   Z@ G dF dGe+e                   ZA G dH dIe*e                   ZB G dJ dKe(e                   ZC G dL dMe+e                   ZD G dN dOe(e                   ZE G dP dQe*e                   ZF G dR dSe*e                   ZG G dT dUe(e                   ZH G dV dWe(e                   ZI G dX dYe*e                   ZJ G dZ d[e*e                   ZK G d\ d]e(e                   ZL G d^ d_e*e                   ZM G d` dae*e                   ZN G db dce*e                   ZO G dd dee*e                   ZP G df dge*e                   ZQ G dh die*e                   ZR G dj dke+e                   ZS G dl dme(e                   ZT G dn doe(e                   ZU G dp dqe(e                   ZV G dr dse+e                   ZW G dt due(e                   ZX G dv dwe(e                   ZY G dx dye+e                   ZZ G dz d{e*e                   Z[ G d| d}e+e                   Z\ G d~ de\e                   Z] G d de\e                   Z^ G d de\e                   Z_ G d de\e                   Z` G d de\e                   Za G d de+e                   Zb G d de+e                   Zc G d de*e                   Zd G d de*e                   Ze G d de+e                   Zf G d de*e                   Zg G d de(e                   Zh G d de(e                   Zi G d de+e                   Zj G d de*e                   Zk G d de*e                   Zl G d de(e                   Zm G d de*e                   Zn G d de*e                   Zo G d de*e                   Zp G d de(e                   Zq G d de+e                   Zr G d de*e                   Zs G d de*e                   Zt G d de(e                   Zu G d de+e                   Zv G d de(e                   Zw G d de(e                   Zx G d de+e                   Zy G d de*e                   Zz G d de*e                   Z{ G d de(e                   Z| G d de(e                   Z} G d de(e                   Z~ G d de(e                   Z G dĄ de(e                   Z G dƄ de*e                   ZdS )    N)deepcopy)TYPE_CHECKINGAnyClassVarDictGenericIterableLiteralMappingMutableMappingOptionalSequenceUnioncast)DEFAULT   )Query)AggResponse
BucketDataFieldBucketDataTopHitsData)_RAttrDictDslBase)DefaultType)types)InstrumentedField)
SearchBasename_or_aggzAgg[_R]filterr   paramsreturnc                    || dk    rt          d| z            ||d<   t          | t          j        j                  r|rt          d          t          |           }|                    dd           }|                    dd           }t          |          dk    rt          d| z            |                                \  }}|r|	                                }||d<   |r|	                                }||d<   t          t                                       |          ddd	i|S t          | t                    r|rt          d
          | S t          t                                       |           di |S )Nr    z;Aggregation %r doesn't accept positional argument 'filter'.z4A() cannot accept parameters when passing in a dict.aggsmetar   zTA() can only accept dict with an aggregation ({"terms": {...}}). Instead it got (%r)_expand__to_dotFz;A() cannot accept parameters when passing in an Agg object. )
ValueError
isinstancecollectionsabcr   r   poplenpopitemcopyAggr   get_dsl_class)r   r    r!   aggr$   r%   agg_types          V/var/www/html/auto_sub_bot/venv/lib/python3.11/site-packages/elasticsearch/dsl/aggs.pyAr5   2   s   
 (""M   "x +{=>>  	USTTT{##wwvt$$wwvt$$s88q==&(34   ;;==& 	"[[]]F!F6N 	"[[]]F!F6N2w$$X..OOuOOOO 
K	%	%  	M    r7  --77777    c                        e Zd ZdZ ee          ZdZdede	fdZ
deeef         f fdZddd	eeef         dee         fd
Z xZS )r0   r2    keyr"   c                     dS NFr'   selfr9   s     r4   __contains__zAgg.__contains__i   s    ur6   c                 $   t                                                      }t          || j                 t                    rNt          t          t          t          f         || j                           }d|v r|	                    d          |d<   |S )Nr%   )
superto_dictr)   namedictr   r   strr   r,   r=   dn	__class__s      r4   rA   zAgg.to_dictl   sl    GGOOa	lD)) 	*T#s(^Qty\22A{{EE&MM&	r6   searchSearchBase[_R]datac                 :    t          t                   | ||          S N)r   r   r=   rI   rK   s      r4   resultz
Agg.resultt   s    2tVT222r6   )__name__
__module____qualname__
_type_namestaticmethodr5   _type_shortcutrB   rD   boolr>   r   r   rA   r   rO   __classcell__rH   s   @r4   r0   r0   d   s        J!\!__ND     c3h      3- 3T#s(^ 3QT 3 3 3 3 3 3 3 3r6   r0   c                   b   e Zd ZU eeee         f         ed<   ee         ed<   eeef         ed<   ddddiZ	e
eeef                  ed<   ded	efd
Zded	ee         fdZdedee         d	dfdZd	ee         fdZdededeeeef         ee         ef         deded	ee         fdZdedeeeef         ee         ef         deded	ee         f
dZdedeeeef         ee         ef         deded	df
dZdedeeeef         ee         ef         deded	df
dZddded	ee         fdZdS )AggBaser$   _base_paramsr2   Ttypehash_param_defsr9   r"   c                 <    || j                             di           v S Nr$   )r\   getr<   s     r4   r>   zAggBase.__contains__   s    dl&&vr2222r6   agg_namec                     t          t          t                   | j                            di           |                   }t          |t                    r't          |j        fi |j        }|| j        d         |<   |S rb   )	r   r0   r   r\   
setdefaultr)   Bucketr5   rB   r=   rd   r2   s      r4   __getitem__zAggBase.__getitem__   st    GT\,,VR88B
 
 c6"" 	1CH,,,,C-0DL *
r6   Nc                 4    t          |          | j        |<   d S rM   )r5   r$   rh   s      r4   __setitem__zAggBase.__setitem__   s    ff	(r6   c                 *    t          | j                  S rM   )iterr$   )r=   s    r4   __iter__zAggBase.__iter__   s    DIr6   bucketrB   r3   argsr!   c                 B    t          |g|R i |x}| |<   |r|S | j        S rM   )r5   r[   )r=   ro   rB   r3   rp   r!   r2   s          r4   _aggzAggBase._agg   sC     X7777777d4j  	J :r6   c                 (     | j         d||g|R i |S r;   )rr   r=   rB   r3   rp   r!   s        r4   metriczAggBase.metric   s*     tyh@@@@@@@r6   
Bucket[_R]c                 D    t          d | j        d||g|R i |          S )Nrv   Tr   rr   rt   s        r4   ro   zAggBase.bucket   s4     L)$)D$"R4"R"R"R6"R"RSSSr6   Pipeline[_R]c                 D    t          d | j        d||g|R i |          S )Nry   Frx   rt   s        r4   pipelinezAggBase.pipeline   s4     NIDIeT8$Ud$U$U$Uf$U$UVVVr6   rI   rJ   rK   c                 $    t          | ||          S rM   )r   rN   s      r4   rO   zAggBase.result   s    $---r6   )rP   rQ   rR   r   rD   r0   r   __annotations__r   r`   r   rV   r>   ri   rk   r	   rn   r   rr   ru   ro   r{   r   rO   r'   r6   r4   rZ   rZ   x   s        
sCG|
r7NNN#s(^---K$sCx.)   3 3 3 3 3 3C CG    %C %c"g %$ % % % %(3-      S#XB45	
   
R   "AA S#XB45A 	A
 A 
RA A A ATT S#XB45T 	T
 T 
T T T TWW S#XB45W 	W
 W 
W W W W.- .S .Xc] . . . . . .r6   rZ   c                   D     e Zd Zdef fdZdeeef         f fdZ xZS )rg   r!   c                 H     t                      j        di | | | _        d S Nr'   )r@   __init__r[   )r=   r!   rH   s     r4   r   zBucket.__init__   s+    ""6"""


r6   r"   c                 $   t          t          |                                           }t          || j                 t
                    rGt          t          t                   || j                           }d|v r|	                    d          |d<   |S rb   )
r@   rZ   rA   r)   rB   rC   r   r   r   r,   rE   s      r4   rA   zBucket.to_dict   sp    '4  ((**a	lD)) 	*Xc]AdiL11A{{EE&MM&	r6   )	rP   rQ   rR   r   r   r   rD   rA   rW   rX   s   @r4   rg   rg      sq              
c3h          r6   rg   c                       e Zd ZdS )PipelineN)rP   rQ   rR   r'   r6   r4   r   r      s        Dr6   r   c                   z     e Zd ZdZdZddddiZeeddeee	e
f         df         d	ee	df         d
ef fdZ xZS )AdjacencyMatrixa  
    A bucket aggregation returning a form of adjacency matrix. The request
    provides a collection of named filter expressions, similar to the
    `filters` aggregation. Each bucket in the response represents a non-
    empty cell in the matrix of intersecting filters.

    :arg filters: Filters used to create buckets. At least one filter is
        required.
    :arg separator: Separator used to concatenate filter names. Defaults
        to &.
    adjacency_matrixfiltersqueryTr]   r   	separatorr   r   kwargsc                @     t                      j        d||d| d S )Nr   r'   r@   r   )r=   r   r   r   rH   s       r4   r   zAdjacencyMatrix.__init__   s/     	HIHHHHHHHr6   )rP   rQ   rR   __doc__rB   r`   r   r   r   rD   r   r   r   rW   rX   s   @r4   r   r      s        
 
 DGT22K >E/6	I I I wsEz*M9:I m+,	I
 I I I I I I I I I Ir6   r   c                   6    e Zd ZdZdZeeeeeeeeed	deedf         deeddf         deedf         d	ee	d
         df         de
deedf         deeee
f         df         dedeee
f         df         deedf         de
f fdZddde
dee
         fdZ xZS )AutoDateHistograma  
    A multi-bucket aggregation similar to the date histogram, except
    instead of providing an interval to use as the width of each bucket, a
    target number of buckets is provided.

    :arg buckets: The target number of buckets. Defaults to `10` if
        omitted.
    :arg field: The field on which to run the aggregation.
    :arg format: The date format used to format `key_as_string` in the
        response. If no `format` is specified, the first date format
        specified in the field mapping is used.
    :arg minimum_interval: The minimum rounding interval. This can make
        the collection process more efficient, as the aggregation will not
        attempt to round at any interval lower than `minimum_interval`.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg offset: Time zone specified as a ISO 8601 UTC offset.
    :arg params:
    :arg script:
    :arg time_zone: Time zone ID.
    auto_date_histogram	bucketsfieldformatminimum_intervalmissingoffsetr!   script	time_zoner   r   r   r   r   r   )secondminutehourdaymonthyearr   r   r!   r   types.Scriptr   r   c       	         N     t                      j        d|||||||||	d	|
 d S )Nr   r'   r   )r=   r   r   r   r   r   r   r!   r   r   r   rH   s              r4   r   zAutoDateHistogram.__init__  sY      	 	
-	
 	
 	
 	
 	
 	
 	
r6   rI   rJ   rK   r"   c                 $    t          | ||          S rM   r   rN   s      r4   rO   zAutoDateHistogram.result,      tVT222r6   )rP   rQ   rR   r   rB   r   r   intrD   r
   r   r   r   r   r   rO   rW   rX   s   @r4   r   r      sx        , !D
 .5@G,3 ,3:AGN/6
 
 
 sM)*
 S-}<=	

 c=()
  FGV

 
 c=()
 gc3h'67
 nd38nmCD
 m+,
 
 
 
 
 
 
:3- 3S 3Xc] 3 3 3 3 3 3 3 3r6   r   c                        e Zd ZdZdZeeeeddeedf         deeddf         deeee	e
df         d	ed
eeef         df         def
 fdZ xZS )Avgas  
    A single-value metrics aggregation that computes the average of
    numeric values that are extracted from the aggregated documents.

    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    avgr   r   r   r   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S Nr   r'   r   r=   r   r   r   r   r   rH   s         r4   r   zAvg.__init__>  E     	 	
	
 	
JP	
 	
 	
 	
 	
r6   rP   rQ   rR   r   rB   r   r   rD   r   floatrV   r   r   r   rW   rX   s   @r4   r   r   0          	 	 D
 -4@G?FGN
 
 
 c=()
 S-}<=	

 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )	AvgBucketug  
    A sibling pipeline aggregation which calculates the mean value of a
    specified metric in a sibling aggregation. The specified metric must
    be numeric and the sibling aggregation must be a multi-bucket
    aggregation.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    
avg_bucketr   
gap_policybuckets_pathr   r   r   skipinsert_zeroskeep_valuesr   r   c                B     t                      j        d|||d| d S Nr   r'   r   r=   r   r   r   r   rH   s        r4   r   zAvgBucket.__init__^  C     	 	
j|	
 	
OU	
 	
 	
 	
 	
r6   rP   rQ   rR   r   rB   r   r   rD   r
   r   r   r   r   rW   rX   s   @r4   r   r   L  s          D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeeeddeedf         deed         df         dee	d	df         d
ee	e
eedf         dedee	ef         df         def fdZ xZS )Boxplota  
    A metrics aggregation that computes a box plot of numeric values
    extracted from the aggregated documents.

    :arg compression: Limits the maximum number of nodes used by the
        underlying TDigest algorithm to `20 * compression`, enabling
        control of memory usage and approximation error.
    :arg execution_hint: The default implementation of TDigest is
        optimized for performance, scaling to millions or even billions of
        sample values while maintaining acceptable accuracy levels (close
        to 1% relative error for millions of samples in some cases). To
        use an implementation optimized for accuracy, set this parameter
        to high_accuracy instead. Defaults to `default` if omitted.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    boxplotcompressionexecution_hintr   r   r   r   r   r   defaulthigh_accuracyr   r   r   r   r   r   c          	      F     t                      j        d|||||d| d S )Nr   r'   r   )r=   r   r   r   r   r   r   rH   s          r4   r   zBoxplot.__init__  sM     	 	
#)	
 	
 	
 	
 	
 	
 	
r6   rP   rQ   rR   r   rB   r   r   r   r
   rD   r   rV   r   r   r   rW   rX   s   @r4   r   r   o  s         & D
 4; @G?FGN
 
 
 5-/0
 ./>
	
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeeddedeee	f         df         deedf         dee
d	         df         d
eeee         eeef         df         de	f
 fdZ xZS )BucketScriptuW  
    A parent pipeline aggregation which runs a script which can perform
    per bucket computations on metrics in the parent multi-bucket
    aggregation.

    :arg script: The script to run for this aggregation.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    bucket_scriptr   r   r   r   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S Nr   r'   r   r=   r   r   r   r   r   rH   s         r4   r   zBucketScript.__init__  J     	 	
!%		
 	

 	
 	
 	
 	
 	
r6   rP   rQ   rR   r   rB   r   r   r   rD   r   r
   r   r   r   rW   rX   s   @r4   r   r     s          D
 HO,3  
 
 
 nd38nmCD
 c=()	

 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeeddedeee	f         df         deedf         dee
d	         df         d
eeee         eeef         df         de	f
 fdZ xZS )BucketSelectoru[  
    A parent pipeline aggregation which runs a script to determine whether
    the current bucket will be retained in the parent multi-bucket
    aggregation.

    :arg script: The script to run for this aggregation.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    bucket_selectorr   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S r   r   r   s         r4   r   zBucketSelector.__init__  r   r6   r   rX   s   @r4   r   r     s          D
 HO,3  
 
 
 nd38nmCD
 c=()	

 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeeddeedf         deed         df         deedf         d	eeee	d
f         df         e
eee	d
f         df                  ee	ef         df         def
 fdZ xZS )
BucketSorta  
    A parent pipeline aggregation which sorts the buckets of its parent
    multi-bucket aggregation.

    :arg from: Buckets in positions prior to `from` will be truncated.
    :arg gap_policy: The policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg size: The number of buckets to return. Defaults to all buckets of
        the parent aggregation.
    :arg sort: The list of fields to sort on.
    bucket_sortfrom_r   sizesortr   r   r   r   r   r   r   types.SortOptionsr   c                D     t                      j        d||||d| d S )Nr   r'   r   )r=   r   r   r   r   r   rH   s         r4   r   zBucketSort.__init__  sE      	 	
JT	
 	
HN	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   r
   rD   r   r   r   r   rW   rX   s   @r4   r   r     s       
 
 D
 ,3 *1 
 
 
 S-'(
 9:MI
	
 C&'
 %0013FFGU5&9!9:<OOPQcN

 
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeeddeee         df         deee	         df         deedf         deeee         e
eef         df         d	ef
 fd
Z xZS )BucketCountKsTestui  
    A sibling pipeline aggregation which runs a two sample
    Kolmogorov–Smirnov test ("K-S test") against a provided distribution
    and the distribution implied by the documents counts in the configured
    sibling aggregation.

    :arg alternative: A list of string values indicating which K-S test
        alternative to calculate. The valid values are: "greater", "less",
        "two_sided". This parameter is key for determining the K-S
        statistic used when calculating the K-S test. Default value is all
        possible alternative hypotheses.
    :arg fractions: A list of doubles indicating the distribution of the
        samples with which to compare to the `buckets_path` results. In
        typical usage this is the overall proportion of documents in each
        bucket, which is compared with the actual document proportions in
        each bucket from the sibling aggregation counts. The default is to
        assume that overall documents are uniformly distributed on these
        buckets, which they would be if one used equal percentiles of a
        metric to define the bucket end points.
    :arg sampling_method: Indicates the sampling methodology when
        calculating the K-S test. Note, this is sampling of the returned
        values. This determines the cumulative distribution function (CDF)
        points used comparing the two samples. Default is `upper_tail`,
        which emphasizes the upper end of the CDF points. Valid options
        are: `upper_tail`, `uniform`, and `lower_tail`.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    bucket_count_ks_testalternative	fractionssampling_methodr   r   r   r   r   r   r   c                D     t                      j        d||||d| d S )Nr   r'   r   )r=   r   r   r   r   r   rH   s         r4   r   zBucketCountKsTest.__init__/  sJ     	 	
#+%		
 	

 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r   r   r   rW   rX   s   @r4   r   r     s         : "D
 <C;B5< 
 
 
 8C=-78
 %-78	

 sM12
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r   c            
            e Zd ZdZdZeeddedeee	f         df         deee
e         eeef         df         de	f fd	Z xZS )
BucketCorrelationa&  
    A sibling pipeline aggregation which runs a correlation function on
    the configured sibling multi-bucket aggregation.

    :arg function: (required) The correlation function to execute.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    bucket_correlationfunctionr   r   ztypes.BucketCorrelationFunctionr   r   r   c                @     t                      j        d||d| d S )Nr   r'   r   )r=   r   r   r   rH   s       r4   r   zBucketCorrelation.__init__O  s/     	P(PPPPPPPr6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r   r   r   rW   rX   s   @r4   r   r   C  s           D  Q Q Q -tCH~}L
Q #S 1=@
Q Q Q Q Q Q Q Q Q Q Qr6   r   c                        e Zd ZdZdZeeeeeeddeedf         deedf         dee	d         df         d	ee
d
df         dee
eeedf         dedee
ef         df         def fdZ xZS )Cardinalityab  
    A single-value metrics aggregation that calculates an approximate
    count of distinct values.

    :arg precision_threshold: A unique count below which counts are
        expected to be close to accurate. This allows to trade memory for
        accuracy. Defaults to `3000` if omitted.
    :arg rehash:
    :arg execution_hint: Mechanism by which cardinality aggregations is
        run.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    cardinalityprecision_thresholdrehashr   r   r   r   r   r   r   r   )global_ordinalssegment_ordinalsdirectsave_memory_heuristicsave_time_heuristicr   r   r   r   r   r   c          
      H     t                      j        d||||||d| d S )Nr   r'   r   )	r=   r   r   r   r   r   r   r   rH   s	           r4   r   zCardinality.__init__p  sP    ( 	 	
 3)	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rV   r
   rD   r   r   r   r   rW   rX   s   @r4   r   r   ]  s          D
 :A-4 @G?FGN#
 
 
 #3#56
 dM)*	

 ' 	

 S-}<=
  sCm;<!
" nd38nmCD#
$ %
 
 
 
 
 
 
 
 
 
r6   r   c                        e Zd ZdZdZeeeddeeddf         deeee	e
df         ded	eeef         df         d
ef fdZ xZS )CartesianBoundsaO  
    A metric aggregation that computes the spatial bounding box containing
    all values for a Point or Shape field.

    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    cartesian_boundsr   r   r   r   r   r   r   r   r   r   c                B     t                      j        d|||d| d S Nr   r'   r   r=   r   r   r   r   rH   s        r4   r   zCartesianBounds.__init__  1     	OugfOOOOOOOr6   r   rX   s   @r4   r   r     s          D
 AH?FGNP P P S-}<=P sCm;<	P
 nd38nmCDP P P P P P P P P P Pr6   r   c                        e Zd ZdZdZeeeddeeddf         deeee	e
df         ded	eeef         df         d
ef fdZ xZS )CartesianCentroidaQ  
    A metric aggregation that computes the weighted centroid from all
    coordinate values for point and shape fields.

    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    cartesian_centroidr   r   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r  r   r  s        r4   r   zCartesianCentroid.__init__  r  r6   r   rX   s   @r4   r  r    s           D
 AH?FGNP P P S-}<=P sCm;<	P
 nd38nmCDP P P P P P P P P P Pr6   r  c                   .    e Zd ZdZdZeeeeeeeeeed
deeddf         deedf         deedf         d	eedf         d
ee	e         df         deede
eef         df         deedf         deedf         deedf         deedf         def fdZ xZS )CategorizeTexta
  
    A multi-bucket aggregation that groups semi-structured text into
    buckets.

    :arg field: (required) The semi-structured text field to categorize.
    :arg max_unique_tokens: The maximum number of unique tokens at any
        position up to max_matched_tokens. Must be larger than 1. Smaller
        values use less memory and create fewer categories. Larger values
        will use more memory and create narrower categories. Max allowed
        value is 100. Defaults to `50` if omitted.
    :arg max_matched_tokens: The maximum number of token positions to
        match on before attempting to merge categories. Larger values will
        use more memory and create narrower categories. Max allowed value
        is 100. Defaults to `5` if omitted.
    :arg similarity_threshold: The minimum percentage of tokens that must
        match for text to be added to the category bucket. Must be between
        1 and 100. The larger the value the narrower the categories.
        Larger values will increase memory usage and create narrower
        categories. Defaults to `50` if omitted.
    :arg categorization_filters: This property expects an array of regular
        expressions. The expressions are used to filter out matching
        sequences from the categorization field values. You can use this
        functionality to fine tune the categorization by excluding
        sequences from consideration when categories are defined. For
        example, you can exclude SQL statements that appear in your log
        files. This property cannot be used at the same time as
        categorization_analyzer. If you only want to define simple regular
        expression filters that are applied prior to tokenization, setting
        this property is the easiest method. If you also want to customize
        the tokenizer or post-tokenization filtering, use the
        categorization_analyzer property instead and include the filters
        as pattern_replace character filters.
    :arg categorization_analyzer: The categorization analyzer specifies
        how the text is analyzed and tokenized before being categorized.
        The syntax is very similar to that used to define the analyzer in
        the `_analyze` endpoint. This property cannot be used at the same
        time as categorization_filters.
    :arg shard_size: The number of categorization buckets to return from
        each shard before merging all the results.
    :arg size: The number of buckets to return. Defaults to `10` if
        omitted.
    :arg min_doc_count: The minimum number of documents in a bucket to be
        returned to the results.
    :arg shard_min_doc_count: The minimum number of documents in a bucket
        to be returned from the shard before merging.
    categorize_text
r   max_unique_tokensmax_matched_tokenssimilarity_thresholdcategorization_filterscategorization_analyzer
shard_sizer   min_doc_countshard_min_doc_countr   r   r   r  r  r  r  r  z"types.CustomCategorizeTextAnalyzerr  r   r  r  r   c       
         P     t                      j        d|||||||||	|
d
| d S )Nr  r'   r   )r=   r   r  r  r  r  r  r  r   r  r  r   rH   s               r4   r   zCategorizeText.__init__  s\    " 	 	
/1!5#9$;!' 3	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   r   rW   rX   s   @r4   r
  r
    sf       - -^ D
 AH7>8?:AFM 07*13:9@
 
 
 S-}<=
 !m!34	

 "#}"45
 $C$67
 !&hsm]&B C
 "'5tCH~}T"

 #},-
 C&'
 S-/0
 #3#56
 
 
 
 
 
 
 
 
 
 
r6   r
  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )ChangePointu3  
    A sibling pipeline that detects, spikes, dips, and change points in a
    metric. Given a distribution of values provided by the sibling multi-
    bucket aggregation, this aggregation indicates the bucket of any spike
    or dip and/or the bucket at which the largest change in the
    distribution of values, if they are statistically significant. There
    must be at least 22 bucketed values. Fewer than 1,000 is preferred.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    change_pointr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zChangePoint.__init__%  r   r6   r   rX   s   @r4   r  r    s         " D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r  c                   D     e Zd ZdZdZefdeedf         def fdZ	 xZ
S )Childrenz
    A single bucket aggregation that selects child documents that have the
    specified type, as defined in a `join` field.

    :arg type: The child type that should be selected.
    childrenr^   r   r   c                 >     t                      j        dd|i| d S Nr^   r'   r   r=   r^   r   rH   s      r4   r   zChildren.__init__@  +    --d-f-----r6   rP   rQ   rR   r   rB   r   r   rD   r   r   rW   rX   s   @r4   r  r  6  sn          D9@ . .U3#56 .C . . . . . . . . . .r6   r  c                        e Zd ZdZdZeeeddeeeedf         ee	e
eedef         f         df         dee	df         d	eeeeee         f                  df         d
ef fdZ xZS )	Compositeax  
    A multi-bucket aggregation that creates composite buckets from
    different sources. Unlike the other multi-bucket aggregations, you can
    use the `composite` aggregation to paginate *all* buckets from a
    multi-level aggregation efficiently.

    :arg after: When paginating, use the `after_key` value returned in the
        previous response to retrieve the next page.
    :arg size: The number of composite buckets that should be returned.
        Defaults to `10` if omitted.
    :arg sources: The value sources used to build composite buckets. Keys
        are returned in the order of the `sources` definition.
    	compositeafterr   sourcesr&  r   Nr   r   r'  r   c                B     t                      j        d|||d| d S )Nr%  r'   r   )r=   r&  r   r'  r   rH   s        r4   r   zComposite.__init__U  s1     	Ku4KKFKKKKKr6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r   rV   r   r   r0   r   r   rW   rX   s   @r4   r#  r#  D  s          D *1IPL L L c../sE3dTW7W1XX 
L C&'L xSW 56EFL L L L L L L L L L Lr6   r#  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )CumulativeCardinalityu  
    A parent pipeline aggregation which calculates the cumulative
    cardinality in a parent `histogram` or `date_histogram` aggregation.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    cumulative_cardinalityr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zCumulativeCardinality.__init__u  r   r6   r   rX   s   @r4   r*  r*  e  s          $D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r*  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )CumulativeSumu   
    A parent pipeline aggregation which calculates the cumulative sum of a
    specified metric in a parent `histogram` or `date_histogram`
    aggregation.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    cumulative_sumr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zCumulativeSum.__init__  r   r6   r   rX   s   @r4   r.  r.    s          D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r.  c            !           e Zd ZdZdZeeeeeeeeeeeeeeeddeed         df         dedee	e
f         df         d	edee	e
f         df         d
ee	ddf         de
dee	df         de
deedf         de
de
deeee	df         ed         f         eeee	df         ed         f                  df         deee	e
f         df         dedee	e
f         df         dee	df         deedf         de
f  fdZddde
dee
         fdZ xZS ) DateHistograma  
    A multi-bucket values source based aggregation that can be applied on
    date values or date range values extracted from the documents. It
    dynamically builds fixed size (interval) buckets over the values.

    :arg calendar_interval: Calendar-aware interval. Can be specified
        using the unit name, such as `month`, or as a single unit
        quantity, such as `1M`.
    :arg extended_bounds: Enables extending the bounds of the histogram
        beyond the data itself.
    :arg hard_bounds: Limits the histogram to specified bounds.
    :arg field: The date field whose values are use to build a histogram.
    :arg fixed_interval: Fixed intervals: a fixed number of SI units and
        never deviate, regardless of where they fall on the calendar.
    :arg format: The date format used to format `key_as_string` in the
        response. If no `format` is specified, the first date format
        specified in the field mapping is used.
    :arg interval:
    :arg min_doc_count: Only returns buckets that have `min_doc_count`
        number of documents. By default, all buckets between the first
        bucket that matches documents and the last one are returned.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg offset: Changes the start value of each bucket by the specified
        positive (`+`) or negative offset (`-`) duration.
    :arg order: The sort order of the returned buckets.
    :arg params:
    :arg script:
    :arg time_zone: Time zone used for bucketing and rounding. Defaults to
        Coordinated Universal Time (UTC).
    :arg keyed: Set to `true` to associate a unique string key with each
        bucket and return the ranges as a hash rather than an array.
    date_histogramcalendar_intervalextended_boundshard_boundsr   fixed_intervalr   intervalr  r   r   orderr!   r   r   keyedr5  r   r   r   r   weekr   quarterr   r   r6  types.ExtendedBoundsr7  r   r   r8  r   r9  r  r   r   r:  ascdescr!   r   r   r   r;  r   c                Z     t                      j        d|||||||||	|
|||||d| d S )Nr4  r'   r   )r=   r5  r6  r7  r   r8  r   r9  r  r   r   r:  r!   r   r   r;  r   rH   s                    r4   r   zDateHistogram.__init__  sl    B 	 	
/+#)'	
 	
  !	
 	
 	
 	
 	
r6   rI   rJ   rK   r"   c                 $    t          | ||          S rM   r   rN   s      r4   rO   zDateHistogram.result  r   r6   )rP   rQ   rR   r   rB   r   r   r
   r   rD   r   r   r   r   rV   r   r   rO   rW   rX   s   @r4   r2  r2    sM          D D   @G%,33:
 :AGN/6,3=2
 2
 2
 !U 
2
 "DcNMA
2
 "DcNMA
2
 S-}<=2
  !2
" c=()#2
$ %2
& S-/0'2
( )2
* +2
, E#223W]5KKLWU3(;#;<gm>TTUV
-2
6 gc3h'6772
8 nd38nmCD92
: m+,;2
< T=()=2
> ?2
 2
 2
 2
 2
 2
h3- 3S 3Xc] 3 3 3 3 3 3 3 3r6   r2  c                        e Zd ZdZdZeeeeeeddeeddf         deedf         deeee	e
df         d	eed
         eeeef                  df         deedf         dee
df         def fdZ xZS )	DateRangea  
    A multi-bucket value source based aggregation that enables the user to
    define a set of date ranges - each representing a bucket.

    :arg field: The date field whose values are use to build ranges.
    :arg format: The date format used to format `from` and `to` in the
        response.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg ranges: Array of date ranges.
    :arg time_zone: Time zone used to convert dates from another time zone
        to UTC.
    :arg keyed: Set to `true` to associate a unique string key with each
        bucket and returns the ranges as a hash rather than an array.
    
date_ranger   r   r   rangesr   r;  r   r   r   r   r   rI  ztypes.DateRangeExpressionr   r;  r   c          
      H     t                      j        d||||||d| d S )NrH  r'   r   )	r=   r   r   r   rI  r   r;  r   rH   s	           r4   r   zDateRange.__init__  sP     	 	
	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   rV   r   r   r   r   rW   rX   s   @r4   rF  rF    s          D
 AH,3?F
 /6,3
 
 
 S-}<=
 c=()	

 sCm;<
 01T#s(^$

 m+,
 T=()
 
 
 
 
 
 
 
 
 
 
r6   rF  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )
Derivativeu  
    A parent pipeline aggregation which calculates the derivative of a
    specified metric in a parent `histogram` or `date_histogram`
    aggregation.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    
derivativer   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zDerivative.__init__C  r   r6   r   rX   s   @r4   rL  rL  2            D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   rL  c                        e Zd ZdZdZeeeeeddeed         df         deedf         ded	e	e
ef         df         d
eedf         dee
ddf         def fdZ xZS )DiversifiedSamplera  
    A filtering aggregation used to limit any sub aggregations' processing
    to a sample of the top-scoring documents. Similar to the `sampler`
    aggregation, but adds the ability to limit the number of matches that
    share a common value.

    :arg execution_hint: The type of value used for de-duplication.
        Defaults to `global_ordinals` if omitted.
    :arg max_docs_per_value: Limits how many documents are permitted per
        choice of de-duplicating value. Defaults to `1` if omitted.
    :arg script:
    :arg shard_size: Limits how many top-scoring documents are collected
        in the sample processed on each shard. Defaults to `100` if
        omitted.
    :arg field: The field used to provide values used for de-duplication.
    diversified_samplerr   max_docs_per_valuer   r  r   r   )mapr   
bytes_hashr   rT  r   r   r  r   r   r   c          	      F     t                      j        d|||||d| d S )NrS  r'   r   )r=   r   rT  r   r  r   r   rH   s          r4   r   zDiversifiedSampler.__init__h  sM     	 	
)1!	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r
   r   r   rD   r   r   rW   rX   s   @r4   rQ  rQ  T  s         " !D 8?GN07@G
 
 
 :;]J

 "#}"45
 nd38nmCD
 #},-
 S-}<=
 
 
 
 
 
 
 
 
 
 
r6   rQ  c                        e Zd ZdZdZeeeeeddeedf         deedf         deeddf         d	eee	ee
df         d
edeeef         df         def fdZ xZS )ExtendedStatsa  
    A multi-value metrics aggregation that computes stats over numeric
    values extracted from the aggregated documents.

    :arg sigma: The number of standard deviations above/below the mean to
        display.
    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    extended_statssigmar   r   r   r   r\  r   r   r   r   r   r   r   r   c          	      F     t                      j        d|||||d| d S )Nr[  r'   r   )r=   r\  r   r   r   r   r   rH   s          r4   r   zExtendedStats.__init__  sM     	 	
	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rD   r   rV   r   r   r   rW   rX   s   @r4   rY  rY  ~  s          D
 .5,3@G?FGN
 
 
 UM)*
 c=()	

 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   rY  c                        e Zd ZdZdZeeeeddeedf         deedf         dee	d         df         d	eee
e         eeef         df         d
ef
 fdZ xZS )ExtendedStatsBucketuk  
    A sibling pipeline aggregation which calculates a variety of stats
    across all bucket of a specified metric in a sibling aggregation.

    :arg sigma: The number of standard deviations above/below the mean to
        display.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    extended_stats_bucketr\  r   r   r   r\  r   r   r   r   r   r   c                D     t                      j        d||||d| d S )Nra  r'   r   )r=   r\  r   r   r   r   rH   s         r4   r   zExtendedStatsBucket.__init__  sJ     	 	
!%		
 	

 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rD   r
   r   r   r   r   rW   rX   s   @r4   r_  r_    s          #D
 .5,3  
 
 
 UM)*
 c=()	

 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r_  c                        e Zd ZdZdZdddiiZeeeeeddeed         ee	e
ef                  d	f         d
eed	f         deed	f         deed	f         deed	f         def fdZ xZS )FrequentItemSetsa(  
    A bucket aggregation which finds frequent item sets, a form of
    association rules mining that identifies items that often occur
    together.

    :arg fields: (required) Fields to analyze.
    :arg minimum_set_size: The minimum size of one item set. Defaults to
        `1` if omitted.
    :arg minimum_support: The minimum support of one item set. Defaults to
        `0.1` if omitted.
    :arg size: The number of top item sets to return. Defaults to `10` if
        omitted.
    :arg filter: Query that filters documents from analysis.
    frequent_item_setsr    r^   r   fieldsminimum_set_sizeminimum_supportr   r    rg  ztypes.FrequentItemSetsFieldr   rh  ri  r   r   c          	      F     t                      j        d|||||d| d S )Nrf  r'   r   )r=   rg  rh  ri  r   r    r   rH   s          r4   r   zFrequentItemSets.__init__  sM     	 	
-+	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r`   r   r   r   r   rD   r   r   r   r   r   rW   rX   s   @r4   rd  rd    s          D67#K 6=7>*1.5
 
 
 23T#s(^$

  ] 23
 um34
 C&'
 e]*+
 
 
 
 
 
 
 
 
 
 
r6   rd  c                   x     e Zd ZdZdZddiddddZefdeed	f         d
e	f fdZ
deee	f         f fdZ xZS )Filterz
    A single bucket aggregation that narrows the set of documents to those
    that match a query.

    :arg filter: A single bucket aggregation that narrows the set of
        documents to those that match a query.
    r    r^   r   r2   Tr]   )r    r$   r   r   c                 >     t                      j        dd|i| d S )Nr    r'   r   )r=   r    r   rH   s      r4   r   zFilter.__init__  s+    111&11111r6   r"   c                 0   t                                                      }t          || j                 t                    rTt          t          t                   || j                           }|                    |	                    di                      |S )Nr    )
r@   rA   r)   rB   rC   r   r   r   updater,   rE   s      r4   rA   zFilter.to_dict	  sl    GGOOa	lD)) 	*Xc]AdiL11AHHQUU8R(()))r6   )rP   rQ   rR   r   rB   r`   r   r   r   r   r   r   rD   rA   rW   rX   s   @r4   rl  rl    s          D7#-- K
 >E 2 2uUM%9: 2PS 2 2 2 2 2 2c3h          r6   rl  c                        e Zd ZdZdZdddddddZeeeeddeee	e
f         d	f         d
eed	f         dee	d	f         deed	f         def
 fdZ xZS )Filtersa  
    A multi-bucket aggregation where each bucket contains the documents
    that match a query.

    :arg filters: Collection of queries from which to build buckets.
    :arg other_bucket: Set to `true` to add a bucket to the response which
        will contain all documents that do not match any of the given
        filters.
    :arg other_bucket_key: The key with which the other bucket is
        returned. Defaults to `_other_` if omitted.
    :arg keyed: By default, the named filters aggregation returns the
        buckets as an object. Set to `false` to return the buckets as an
        array of objects. Defaults to `True` if omitted.
    r   r   Tr]   r2   )r   r$   r   other_bucketother_bucket_keyr;  r   rs  rt  r;  r   c                D     t                      j        d||||d| d S )Nrr  r'   r   )r=   r   rs  rt  r;  r   rH   s         r4   r   zFilters.__init__'  sJ     	 	
%-		
 	

 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r`   r   r   r   rD   r   rV   r   r   rW   rX   s   @r4   rq  rq    s          D#T22-- K ;B3:6=,3
 
 
 tCJ'67
 D-/0	

  ] 23
 T=()
 
 
 
 
 
 
 
 
 
 
r6   rq  c                        e Zd ZdZdZeeeeddeedf         deeddf         deee	e
edf         d	ed
eeef         df         def
 fdZ xZS )	GeoBoundsa  
    A metric aggregation that computes the geographic bounding box
    containing all values for a Geopoint or Geoshape field.

    :arg wrap_longitude: Specifies whether the bounding box should be
        allowed to overlap the international date line. Defaults to `True`
        if omitted.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    
geo_boundswrap_longituder   r   r   rz  r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S )Nry  r'   r   )r=   rz  r   r   r   r   rH   s         r4   r   zGeoBounds.__init__I  sJ     	 	
)		
 	

 	
 	
 	
 	
 	
r6   rP   rQ   rR   r   rB   r   r   rV   rD   r   r   r   r   r   rW   rX   s   @r4   rw  rw  9  s          D
 6=@G?FGN
 
 
 dM12
 S-}<=	

 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   rw  c                        e Zd ZdZdZeeeeeddeedf         deddee	         e
ee
ef         df         d	ee
d
df         dee
ee	edf         dedee
ef         df         def fdZ xZS )GeoCentroidah  
    A metric aggregation that computes the weighted centroid from all
    coordinate values for geo fields.

    :arg count:
    :arg location:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    geo_centroidcountlocationr   r   r   r  r   r  types.LatLonGeoLocationtypes.GeoHashLocationr   r   r   r   r   r   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r  r  r   r   r   r   rH   s          r4   r   zGeoCentroid.__init__j  sM    " 	 	
	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   r   r   rD   r   r   rV   r   rW   rX   s   @r4   r~  r~  [  s
       
 
 D
 ,3 @G?FGN
 
 
 S-'(
 %#UOcN
	
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r~  c                       e Zd ZdZdZeeeeeddeed         df         deeddf         d	ed
de	e
         eeeef         df         dee	d         e	eeef                  df         deed         df         def fdZ xZS )GeoDistanceaH  
    A multi-bucket aggregation that works on `geo_point` fields. Evaluates
    the distance of each document value from an origin point and
    determines the buckets it belongs to, based on ranges defined in the
    request.

    :arg distance_type: The distance calculation type. Defaults to `arc`
        if omitted.
    :arg field: A field of type `geo_point` used to evaluate the distance.
    :arg origin: The origin  used to evaluate the distance.
    :arg ranges: An array of ranges used to bucket documents.
    :arg unit: The distance unit. Defaults to `m` if omitted.
    geo_distancedistance_typer   originrI  unitr  )arcplaner   r   r   r  r  r  rI  types.AggregationRanger  )	inftydminmikmmcmmmr   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r  r   r  rI  r  r   rH   s          r4   r   zGeoDistance.__init__  sM    * 	 	
'	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r
   rD   r   r   r   r   r   rW   rX   s   @r4   r  r    s&         D
 HO@G   %
 
 
 W^4mCD
 S-}<=	

 %#UOcN

 -.c3h0H-W

  HI=X
!
& '
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddeddddeee	f         d	f         d
eedd	f         dee
ed	f         deed	f         deed	f         de	f fdZ xZS )GeohashGrida  
    A multi-bucket aggregation that groups `geo_point` and `geo_shape`
    values into buckets that represent a grid. Each cell is labeled using
    a geohash which is of user-definable precision.

    :arg bounds: The bounding box to filter the points in each bucket.
    :arg field: Field containing indexed `geo_point` or `geo_shape`
        values. If the field contains an array, `geohash_grid` aggregates
        all array values.
    :arg precision: The string length of the geohashes used to define
        cells/buckets in the results. Defaults to `5` if omitted.
    :arg shard_size: Allows for more accurate counting of the top cells
        returned in the final result the aggregation. Defaults to
        returning `max(10,(size x number-of-shards))` buckets from each
        shard.
    :arg size: The maximum number of geohash buckets to return. Defaults
        to `10000` if omitted.
    geohash_gridboundsr   	precisionr  r   r  types.CoordsGeoBounds!types.TopLeftBottomRightGeoBounds!types.TopRightBottomLeftGeoBoundstypes.WktGeoBoundsr   r   r   r  r  r   r   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r  r   r  r  r   r   rH   s          r4   r   zGeohashGrid.__init__  sM    " 	 	
!	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r   r   r   rW   rX   s   @r4   r  r    s         & D @G6=07*1
 
 
 #// cN

 S-}<=
 ]23
 #},-
 C&'
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddedeee	f         df         dedeee	f         df         d	ee
df         d
eed         df         deedf         de	f fdZ xZS )GeoLinead  
    Aggregates all `geo_point` values within a bucket into a `LineString`
    ordered by the chosen sort field.

    :arg point: (required) The name of the geo_point field.
    :arg sort: (required) The name of the numeric field to use as the sort
        key for ordering the points. When the `geo_line` aggregation is
        nested inside a `time_series` aggregation, this field defaults to
        `@timestamp`, and any other value will result in error.
    :arg include_sort: When `true`, returns an additional array of the
        sort values in the feature properties.
    :arg sort_order: The order in which the line is sorted (ascending or
        descending). Defaults to `asc` if omitted.
    :arg size: The maximum length of the line represented in the
        aggregation. Valid sizes are between 1 and 10000. Defaults to
        `10000` if omitted.
    geo_linepointr   include_sort
sort_orderr   r  types.GeoLinePointr   r   types.GeoLineSortr  r  r@  r   r   c          	      F     t                      j        d|||||d| d S Nr  r'   r   r=   r  r   r  r  r   r   rH   s          r4   r   zGeoLine.__init__  M     	 	
%!	
 	
 	
 	
 	
 	
 	
r6   rP   rQ   rR   r   rB   r   r   r   rD   r   rV   r
   r   r   rW   rX   s   @r4   r  r    s         $ D
 MTJQ3:CJ*1
 
 
 )4S>=HI
 'c3hFG	

 D-/0
 '-0-?@
 C&'
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddeeddf         deedf         dee	df         d	ee	df         d
edddde
eef         df         def fdZ xZS )GeotileGrida  
    A multi-bucket aggregation that groups `geo_point` and `geo_shape`
    values into buckets that represent a grid. Each cell corresponds to a
    map tile as used by many online map sites.

    :arg field: Field containing indexed `geo_point` or `geo_shape`
        values. If the field contains an array, `geotile_grid` aggregates
        all array values.
    :arg precision: Integer zoom of the key used to define cells/buckets
        in the results. Values outside of the range [0,29] will be
        rejected. Defaults to `7` if omitted.
    :arg shard_size: Allows for more accurate counting of the top cells
        returned in the final result the aggregation. Defaults to
        returning `max(10,(size x number-of-shards))` buckets from each
        shard.
    :arg size: The maximum number of buckets to return. Defaults to
        `10000` if omitted.
    :arg bounds: A bounding box to filter the geo-points or geo-shapes in
        each bucket.
    geotile_gridr   r  r  r   r  r   r   r   r  r  r   r  r  r  r  r  r   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r   r  r  r   r  r   rH   s          r4   r   zGeotileGrid.__init__'  sM    " 	 	
!	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   r   rW   rX   s   @r4   r  r    s         * D
 AH1807*1 
 
 
 S-}<=
 -.	

 #},-
 C&'
 #// cN

 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddeeddf         deedf         ded	d
dde	ee
f         df         deedf         deedf         de
f fdZ xZS )
GeohexGrida$  
    A multi-bucket aggregation that groups `geo_point` and `geo_shape`
    values into buckets that represent a grid. Each cell corresponds to a
    H3 cell index and is labeled using the H3Index representation.

    :arg field: (required) Field containing indexed `geo_point` or
        `geo_shape` values. If the field contains an array, `geohex_grid`
        aggregates all array values.
    :arg precision: Integer zoom of the key used to defined cells or
        buckets in the results. Value should be between 0-15. Defaults to
        `6` if omitted.
    :arg bounds: Bounding box used to filter the geo-points in each
        bucket.
    :arg size: Maximum number of buckets to return. Defaults to `10000` if
        omitted.
    :arg shard_size: Number of buckets returned from each shard.
    geohex_gridr   r  r  r   r  r   r   r   r  r  r  r  r  r  r   r  r   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r   r  r  r   r  r   rH   s          r4   r   zGeohexGrid.__init__W  sM    " 	 	
!	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   rW   rX   s   @r4   r  r  B  s         $ D
 AH/6 *107
 
 
 S-}<=
 m+,	

 #// cN

 C&'
 #},-
 
 
 
 
 
 
 
 
 
 
r6   r  c                   ,     e Zd ZdZdZdef fdZ xZS )Globalu   
    Defines a single bucket of all the documents within the search
    execution context. This context is defined by the indices and the
    document types you’re searching on, but is not influenced by the
    search query itself.
    globalr   c                 :     t                      j        di | d S r   r   r=   r   rH   s     r4   r   zGlobal.__init__|  &    ""6"""""r6   rP   rQ   rR   r   rB   r   r   rW   rX   s   @r4   r  r  r  sU          D# # # # # # # # # # #r6   r  c                       e Zd ZdZdZeeeeeeeeeeeddedeee	f         df         dedeee	f         df         deed	df         d
ee
df         deedf         dee
df         dee
df         deeeed	f         ed         f         eeeed	f         ed         f                  df         dedeee	f         df         deedf         deedf         de	f fdZddde	dee	         fdZ xZS )	Histograma  
    A multi-bucket values source based aggregation that can be applied on
    numeric values or numeric range values extracted from the documents.
    It dynamically builds fixed size (interval) buckets over the values.

    :arg extended_bounds: Enables extending the bounds of the histogram
        beyond the data itself.
    :arg hard_bounds: Limits the range of buckets in the histogram. It is
        particularly useful in the case of open data ranges that can
        result in a very large number of buckets.
    :arg field: The name of the field to aggregate on.
    :arg interval: The interval for the buckets. Must be a positive
        decimal.
    :arg min_doc_count: Only returns buckets that have `min_doc_count`
        number of documents. By default, the response will fill gaps in
        the histogram with empty buckets.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg offset: By default, the bucket keys start with 0 and then
        continue in even spaced steps of `interval`. The bucket boundaries
        can be shifted by using the `offset` option.
    :arg order: The sort order of the returned buckets. By default, the
        returned buckets are sorted by their key ascending.
    :arg script:
    :arg format:
    :arg keyed: If `true`, returns buckets as a hash instead of an array,
        keyed by the bucket keys.
    	histogramr6  r7  r   r9  r  r   r   r:  r   r   r;  r6  r?  r   r7  r   r   r9  r  r   r   r:  r@  r   r   r   r;  r   c                R     t                      j        d|||||||||	|
|d| d S )Nr  r'   r   )r=   r6  r7  r   r9  r  r   r   r:  r   r   r;  r   rH   s                r4   r   zHistogram.__init__  s_    0 	 	
+#'	
 	
 	
 	
 	
 	
 	
r6   rI   rJ   rK   r"   c                 $    t          | ||          S rM   r   rN   s      r4   rO   zHistogram.result  r   r6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r   r   r   r
   r   rV   r   r   rO   rW   rX   s   @r4   r  r    s        : D  @G073:/6.5
 GN,3,3+%
 %
 %
 "DcNMA
%
 "DcNMA
%
 S-}<=%
 },-%
 S-/0%
 um+,%
 e]*+%
 E#223W]5KKLWU3(;#;<gm>TTUV
%
& nd38nmCD'%
( c=())%
* T=()+%
, -%
 %
 %
 %
 %
 %
N3- 3S 3Xc] 3 3 3 3 3 3 3 3r6   r  c            
            e Zd ZdZdZeeddeeddf         deed         ee	ee
f                  df         d	e
f fd
Z xZS )IPRangez
    A multi-bucket value source based aggregation that enables the user to
    define a set of IP ranges - each representing a bucket.

    :arg field: The date field whose values are used to build ranges.
    :arg ranges: Array of IP ranges.
    ip_ranger   rI  r   r   r   rI  ztypes.IpRangeAggregationRanger   c                @     t                      j        d||d| d S )Nr  r'   r   )r=   r   rI  r   rH   s       r4   r   zIPRange.__init__  s/     	>uV>>v>>>>>r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   rW   rX   s   @r4   r  r    s          D
 AH
 ? ? ? S-}<=? 45T#s(^$
	? ? ? ? ? ? ? ? ? ? ?r6   r  c                        e Zd ZdZdZeeeeeeddeeddf         deedf         dee	df         d	ee	df         d
ee	df         deedf         de
f fdZ xZS )IPPrefixaN  
    A bucket aggregation that groups documents based on the network or
    sub-network of an IP address.

    :arg field: (required) The IP address field to aggregation on. The
        field mapping type must be `ip`.
    :arg prefix_length: (required) Length of the network prefix. For IPv4
        addresses the accepted range is [0, 32]. For IPv6 addresses the
        accepted range is [0, 128].
    :arg is_ipv6: Defines whether the prefix applies to IPv6 addresses.
    :arg append_prefix_length: Defines whether the prefix length is
        appended to IP address keys in the response.
    :arg keyed: Defines whether buckets are returned as a hash rather than
        an array in the response.
    :arg min_doc_count: Minimum number of documents in a bucket for it to
        be included in the response. Defaults to `1` if omitted.
    	ip_prefixr   prefix_lengthis_ipv6append_prefix_lengthr;  r  r   r   r   r  r  r  r;  r  r   c          
      H     t                      j        d||||||d| d S )Nr  r'   r   )	r=   r   r  r  r  r;  r  r   rH   s	           r4   r   zIPPrefix.__init__  sP     	 	
'!5'	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   rV   r   r   rW   rX   s   @r4   r  r    s         $ D
 AH3:.5;B,33:
 
 
 S-}<=
 S-/0	

 t]*+
 $D-$78
 T=()
 S-/0
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddeedf         dedeee	f         df         deedf         d	ee
d
         df         deeee         eeef         df         de	f fdZ xZS )	Inferenceu  
    A parent pipeline aggregation which loads a pre-trained model and
    performs inference on the collated result fields from the parent
    bucket aggregation.

    :arg model_id: (required) The ID or alias for the trained model.
    :arg inference_config: Contains the inference type and its options.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    	inferencemodel_idinference_configr   r   r   r  r   r  ztypes.InferenceConfigContainerr   r   r   r   r   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r  r  r   r   r   r   rH   s          r4   r   zInference.__init__"  sM      	 	
-!%	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r
   r   r   r   rW   rX   s   @r4   r  r    s          D
 /6 ,3  
 
 
 ]*+
  ,d38nmK
	
 c=()
 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddedeee	f         df         dedeee	f         df         d	ee
df         d
eed         df         deedf         de	f fdZ xZS )Linea  
    :arg point: (required) The name of the geo_point field.
    :arg sort: (required) The name of the numeric field to use as the sort
        key for ordering the points. When the `geo_line` aggregation is
        nested inside a `time_series` aggregation, this field defaults to
        `@timestamp`, and any other value will result in error.
    :arg include_sort: When `true`, returns an additional array of the
        sort values in the feature properties.
    :arg sort_order: The order in which the line is sorted (ascending or
        descending). Defaults to `asc` if omitted.
    :arg size: The maximum length of the line represented in the
        aggregation. Valid sizes are between 1 and 10000. Defaults to
        `10000` if omitted.
    liner  r  r  r   r   r  r  r  r@  r   r   c          	      F     t                      j        d|||||d| d S r  r   r  s          r4   r   zLine.__init__N  r  r6   r  rX   s   @r4   r  r  <  s          D
 MTJQ3:CJ*1
 
 
 )4S>=HI
 'c3hFG	

 D-/0
 '-0-?@
 C&'
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeddeed         df         deeedf         e	eedf                  df         d	ee
eedf         ef         df         d
ef fdZ xZS )MatrixStatsa	  
    A numeric aggregation that computes the following statistics over a
    set of document fields: `count`, `mean`, `variance`, `skewness`,
    `kurtosis`, `covariance`, and `covariance`.

    :arg mode: Array value the aggregation will use for array or multi-
        valued fields. Defaults to `avg` if omitted.
    :arg fields: An array of fields for computing the statistics.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    matrix_statsmoderg  r   r  )minmaxsumr   medianr   rg  r   r   r   c                B     t                      j        d|||d| d S )Nr  r'   r   )r=   r  rg  r   r   rH   s        r4   r   zMatrixStats.__init__q  s1      	Md67MMfMMMMMr6   )rP   rQ   rR   r   rB   r   r   r
   rD   r   r   r   r   r   rW   rX   s   @r4   r  r  b  s       
 
 D 
  N N N 89=H
N #**+U3 3345
N E#223U:;]J
N N N N N N N N N N Nr6   r  c                        e Zd ZdZdZeeeeddeedf         deeddf         deeee	e
df         d	ed
eeef         df         def
 fdZ xZS )Maxav  
    A single-value metrics aggregation that returns the maximum value
    among the numeric values extracted from the aggregated documents.

    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    r  r   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S r   r   r   s         r4   r   zMax.__init__  r   r6   r   rX   s   @r4   r  r    r   r6   r  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )	MaxBucketuO  
    A sibling pipeline aggregation which identifies the bucket(s) with the
    maximum value of a specified metric in a sibling aggregation and
    outputs both the value and the key(s) of the bucket(s).

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    
max_bucketr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zMaxBucket.__init__  r   r6   r   rX   s   @r4   r  r    rO  r6   r  c                        e Zd ZdZdZeeeeeeddeedf         deed         df         dee	df         d	ee	d
df         dee	e
eedf         dedee	ef         df         def fdZ xZS )MedianAbsoluteDeviationa  
    A single-value aggregation that approximates the median absolute
    deviation of its search results.

    :arg compression: Limits the maximum number of nodes used by the
        underlying TDigest algorithm to `20 * compression`, enabling
        control of memory usage and approximation error. Defaults to
        `1000` if omitted.
    :arg execution_hint: The default implementation of TDigest is
        optimized for performance, scaling to millions or even billions of
        sample values while maintaining acceptable accuracy levels (close
        to 1% relative error for millions of samples in some cases). To
        use an implementation optimized for accuracy, set this parameter
        to high_accuracy instead. Defaults to `default` if omitted.
    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    median_absolute_deviationr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c          
      H     t                      j        d||||||d| d S )Nr  r'   r   )	r=   r   r   r   r   r   r   r   rH   s	           r4   r   z MedianAbsoluteDeviation.__init__  sP     	 	
#)	
 	
 	
 	
 	
 	
 	
r6   r   rX   s   @r4   r  r    s        * 'D
 4; ,3@G?FGN
 
 
 5-/0
 ./>
	
 c=()
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeddeedf         deeddf         deeee	e
df         d	ed
eeef         df         def
 fdZ xZS )Minar  
    A single-value metrics aggregation that returns the minimum value
    among numeric values extracted from the aggregated documents.

    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    r  r   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S r   r   r   s         r4   r   zMin.__init__   r   r6   r   rX   s   @r4   r  r    r   r6   r  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )	MinBucketuO  
    A sibling pipeline aggregation which identifies the bucket(s) with the
    minimum value of a specified metric in a sibling aggregation and
    outputs both the value and the key(s) of the bucket(s).

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    
min_bucketr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zMinBucket.__init__  r   r6   r   rX   s   @r4   r  r    rO  r6   r  c            
       d     e Zd ZdZdZeeddeeddf         deeee	e
df         def fdZ xZS )	Missinga/  
    A field data based single bucket aggregation, that creates a bucket of
    all documents in the current document set context that are missing a
    field value (effectively, missing a field or having the configured
    NULL value set).

    :arg field: The name of the field.
    :arg missing:
    r   r   r   r   r   r   r   c                @     t                      j        d||d| d S )Nr  r'   r   )r=   r   r   r   rH   s       r4   r   zMissing.__init__=  s/     	@ug@@@@@@@r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   rV   r   r   rW   rX   s   @r4   r   r   0  s          D
 AH?F	A A A S-}<=A sCm;<	A
 A A A A A A A A A Ar6   r   c                   ,     e Zd ZdZdZdef fdZ xZS )	MovingAvg 
moving_avgr   c                 :     t                      j        di | d S r   r   r  s     r4   r   zMovingAvg.__init__L  r  r6   r  rX   s   @r4   r  r  G  sN        GD# # # # # # # # # # #r6   r  c                   
    e Zd ZdZeeeeeeeeddededeeef         df         dee	df         dee
df         d	ee
df         d
eedf         deed         df         deeee         eeef         df         def fdZ xZS )LinearMovingAverageAggregation  
    :arg model: (required)
    :arg settings: (required)
    :arg minimize:
    :arg predict:
    :arg window:
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    modelsettingsminimizepredictwindowr   r   r   r  r  types.EmptyObjectr   r  r  r  r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S Nr  r'   r   r=   r  r  r  r  r  r   r   r   r   rH   s             r4   r   z'LinearMovingAverageAggregation.__init__`  V    " 	 
	
!%
	
 
	
 
	
 
	
 
	
 
	
 
	
r6   rP   rQ   rR   r   r   r   r   r   rD   rV   r   r
   r   r   r   rW   rX   s   @r4   r	  r	  P  7        $ NU/6-4,3,3  
 
 
 
 +T#s(^]JK	

 m+,
 sM)*
 c=()
 c=()
 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r	  c                   
    e Zd ZdZeeeeeeeeddededeeef         df         dee	df         dee
df         d	ee
df         d
eedf         deed         df         deeee         eeef         df         def fdZ xZS )SimpleMovingAverageAggregationr
  r  r  r  r  r   r  r  r  r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S r  r   r  s             r4   r   z'SimpleMovingAverageAggregation.__init__  r  r6   r  rX   s   @r4   r  r  ~  r  r6   r  c                   
    e Zd ZdZeeeeeeeeddededeeef         df         dee	df         dee
df         d	ee
df         d
eedf         deed         df         deeee         eeef         df         def fdZ xZS )EwmaMovingAverageAggregationr
  r  r  r  ztypes.EwmaModelSettingsr   r  r  r  r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S r  r   r  s             r4   r   z%EwmaMovingAverageAggregation.__init__  V    & 	 
	
!%
	
 
	
 
	
 
	
 
	
 
	
 
	
r6   r  rX   s   @r4   r  r    s;        $  /6-4,3,3  !
 
 
 
 %tCH~}D
	
 m+,
 sM)*
 c=()
 c=()
 9:MI

 #S 1=@

" #
 
 
 
 
 
 
 
 
 
r6   r  c                   
    e Zd ZdZeeeeeeeeddededeeef         df         dee	df         dee
df         d	ee
df         d
eedf         deed         df         deeee         eeef         df         def fdZ xZS )HoltMovingAverageAggregationr
  r  r  r  ztypes.HoltLinearModelSettingsr   r  r  r  r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S r  r   r  s             r4   r   z%HoltMovingAverageAggregation.__init__  r  r6   r  rX   s   @r4   r   r     s;        $  /6-4,3,3  !
 
 
 
 +T#s(^]J
	
 m+,
 sM)*
 c=()
 c=()
 9:MI

 #S 1=@

" #
 
 
 
 
 
 
 
 
 
r6   r   c                   
    e Zd ZdZeeeeeeeeddededeeef         df         dee	df         dee
df         d	ee
df         d
eedf         deed         df         deeee         eeef         df         def fdZ xZS )#HoltWintersMovingAverageAggregationr
  r  r  r  ztypes.HoltWintersModelSettingsr   r  r  r  r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S r  r   r  s             r4   r   z,HoltWintersMovingAverageAggregation.__init__	  r  r6   r  rX   s   @r4   r#  r#  	  s;        $  /6-4,3,3  !
 
 
 
 ,d38nmK
	
 m+,
 sM)*
 c=()
 c=()
 9:MI

 #S 1=@

" #
 
 
 
 
 
 
 
 
 
r6   r#  c                        e Zd ZdZdZeeeeeeddeedf         deedf         deedf         dee	df         d	ee
d
         df         dee	ee	         ee	e	f         df         def fdZ xZS )MovingPercentilesu  
    Given an ordered series of percentiles, "slides" a window across those
    percentiles and computes cumulative percentiles.

    :arg window: The size of window to "slide" across the histogram.
    :arg shift: By default, the window consists of the last n values
        excluding the current bucket. Increasing `shift` by 1, moves the
        starting window position by 1 to the right.
    :arg keyed:
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    moving_percentilesr  shiftr;  r   r   r   r  r   r)  r;  r   r   r   r   r   c          
      H     t                      j        d||||||d| d S )Nr(  r'   r   )	r=   r  r)  r;  r   r   r   r   rH   s	           r4   r   zMovingPercentiles.__init__Q	  sP     	 	
!%	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rV   rD   r
   r   r   r   r   rW   rX   s   @r4   r&  r&  <	  s        $  D
 -4+2,3,3  
 
 
 c=()
 S-'(	

 T=()
 c=()
 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r&  c                        e Zd ZdZdZeeeeeeddeedf         deedf         deedf         deedf         d	ee	d
         df         deee
e         eeef         df         def fdZ xZS )MovingFnu  
    Given an ordered series of data, "slides" a window across the data and
    runs a custom script on each window of data. For convenience, a number
    of common functions are predefined such as `min`, `max`, and moving
    averages.

    :arg script: The script that should be executed on each window of
        data.
    :arg shift: By default, the window consists of the last n values
        excluding the current bucket. Increasing `shift` by 1, moves the
        starting window position by 1 to the right.
    :arg window: The size of window to "slide" across the histogram.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    	moving_fnr   r)  r  r   r   r   r   r   r)  r  r   r   r   r   r   c          
      H     t                      j        d||||||d| d S )Nr.  r'   r   )	r=   r   r)  r  r   r   r   r   rH   s	           r4   r   zMovingFn.__init__	  sP     	 	
!%	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r
   r   r   r   r   rW   rX   s   @r4   r,  r,  k	  s        * D
 -4+2,3,3  
 
 
 c=()
 S-'(	

 c=()
 c=()
 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r,  c                   |    e Zd ZdZdZeeeeeeeeddeed         eee	e
f                  df         deed         df         d	eeee	d
f         ed         f         eeee	d
f         ed         f                  df         deedf         deedf         deedf         deedf         deedf         de
f fdZ xZS )
MultiTermsan  
    A multi-bucket value source based aggregation where buckets are
    dynamically built - one per unique set of values.

    :arg terms: (required) The field from which to generate sets of terms.
    :arg collect_mode: Specifies the strategy for data collection.
        Defaults to `breadth_first` if omitted.
    :arg order: Specifies the sort order of the buckets. Defaults to
        sorting by descending document count.
    :arg min_doc_count: The minimum number of documents in a bucket for it
        to be returned. Defaults to `1` if omitted.
    :arg shard_min_doc_count: The minimum number of documents in a bucket
        on each shard for it to be returned. Defaults to `1` if omitted.
    :arg shard_size: The number of candidate terms produced by each shard.
        By default, `shard_size` will be automatically estimated based on
        the number of shards and the `size` parameter.
    :arg show_term_doc_count_error: Calculates the doc count error on per
        term basis.
    :arg size: The number of term buckets should be returned out of the
        overall terms list. Defaults to `10` if omitted.
    multi_termstermscollect_moder:  r  r  r  show_term_doc_count_errorr   r4  ztypes.MultiTermLookupr   r5  depth_firstbreadth_firstr:  r   r@  r  r  r  r6  r   r   c                L     t                      j        d||||||||d|	 d S )Nr3  r'   r   )r=   r4  r5  r:  r  r  r  r6  r   r   rH   s             r4   r   zMultiTerms.__init__	  sV    * 	 
	
%' 3!&?
	
 
	
 
	
 
	
 
	
 
	
 
	
r6   )rP   rQ   rR   r   rB   r   r   r   r   rD   r   r
   r   r   rV   r   rW   rX   s   @r4   r1  r1  	  s        , D  
 3:9@07@G*1%
 
 
 ,-xS#X/GV

 23]B

 E#223W]5KKLWU3(;#;<gm>TTUV

 S-/0
 #3#56
  #},-!
" $)})<#=#
$ C&'%
& '
 
 
 
 
 
 
 
 
 
r6   r1  c                   F     e Zd ZdZdZefdeeddf         def fdZ	 xZ
S )Nestedz
    A special single bucket aggregation that enables aggregating nested
    documents.

    :arg path: The path to the field of type `nested`.
    nestedpathr   r   r   c                 >     t                      j        dd|i| d S Nr>  r'   r   r=   r>  r   rH   s      r4   r   zNested.__init__	  -    
 	--d-f-----r6   r!  rX   s   @r4   r<  r<  	  sy          D @G. .C,m;<. . . . . . . . . . .r6   r<  c                        e Zd ZdZdZeeeeddeed         df         deedf         deed	         df         d
eee	e         e
eef         df         def
 fdZ xZS )	Normalizeu-  
    A parent pipeline aggregation which calculates the specific
    normalized/rescaled value for a specific bucket value.

    :arg method: The specific method to apply.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    	normalizemethodr   r   r   rG  )rescale_0_1rescale_0_100percent_of_summeanzz-scoresoftmaxr   r   r   r   r   r   c                D     t                      j        d||||d| d S )NrF  r'   r   )r=   rG  r   r   r   r   rH   s         r4   r   zNormalize.__init__	  sJ    . 	 	
!%		
 	

 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r
   rD   r   r   r   r   rW   rX   s   @r4   rD  rD  	  s          D ,3  )
 
 
  


 c=()
 9:MI

$ #S 1=@
%
* +
 
 
 
 
 
 
 
 
 
r6   rD  c                   D     e Zd ZdZdZefdeedf         def fdZ	 xZ
S )Parentz
    A special single bucket aggregation that selects parent documents that
    have the specified type, as defined in a `join` field.

    :arg type: The child type that should be selected.
    parentr^   r   r   c                 >     t                      j        dd|i| d S r  r   r  s      r4   r   zParent.__init__%
  r   r6   r!  rX   s   @r4   rO  rO  
  sn          D9@ . .U3#56 .C . . . . . . . . . .r6   rO  c                   ,    e Zd ZdZdZeeeeeeeeddeedf         deee	         ddf         ded	e
eef         df         d
ede
eef         df         deedf         deeddf         deeee	edf         dede
eef         df         def fdZ xZS )PercentileRanksa  
    A multi-value metrics aggregation that calculates one or more
    percentile ranks over numeric values extracted from the aggregated
    documents.

    :arg keyed: By default, the aggregation associates a unique string key
        with each bucket and returns the ranges as a hash rather than an
        array. Set to `false` to disable this behavior. Defaults to `True`
        if omitted.
    :arg values: An array of values for which to calculate the percentile
        ranks.
    :arg hdr: Uses the alternative High Dynamic Range Histogram algorithm
        to calculate percentile ranks.
    :arg tdigest: Sets parameters for the default TDigest algorithm used
        to calculate percentile ranks.
    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    percentile_ranksr;  valueshdrtdigestr   r   r   r   r;  r   rV  NrW  types.HdrMethodrX  types.TDigestr   r   r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S )NrU  r'   r   )r=   r;  rV  rW  rX  r   r   r   r   r   rH   s             r4   r   zPercentileRanks.__init__B
  sV     	 
	

	
 
	
 
	
 
	
 
	
 
	
 
	
r6   rP   rQ   rR   r   rB   r   r   rV   r   r   r   rD   r   r   r   rW   rX   s   @r4   rS  rS  )
  sJ        , D
 -4>EGNIP,3@G?FGN
 
 
 T=()
 huot]:;	

 $d38nmCD
 S#XEF
 c=()
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   rS  c                   *    e Zd ZdZdZeeeeeeeeddeedf         deee	         df         dede
eef         df         d	ed
e
eef         df         deedf         deeddf         deeee	edf         dede
eef         df         def fdZ xZS )Percentilesax  
    A multi-value metrics aggregation that calculates one or more
    percentiles over numeric values extracted from the aggregated
    documents.

    :arg keyed: By default, the aggregation associates a unique string key
        with each bucket and returns the ranges as a hash rather than an
        array. Set to `false` to disable this behavior. Defaults to `True`
        if omitted.
    :arg percents: The percentiles to calculate.
    :arg hdr: Uses the alternative High Dynamic Range Histogram algorithm
        to calculate percentiles.
    :arg tdigest: Sets parameters for the default TDigest algorithm used
        to calculate percentiles.
    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    percentilesr;  percentsrW  rX  r   r   r   r   r;  r   ra  rW  rY  rX  rZ  r   r   r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S )Nr`  r'   r   )r=   r;  ra  rW  rX  r   r   r   r   r   rH   s             r4   r   zPercentiles.__init__t
  sV     	 
	

	
 
	
 
	
 
	
 
	
 
	
 
	
r6   r\  rX   s   @r4   r^  r^  \
  sH        * D
 -4:AGNIP,3@G?FGN
 
 
 T=()
 67	

 $d38nmCD
 S#XEF
 c=()
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r^  c                        e Zd ZdZdZeeeeddeee         df         dee	df         dee
d         df         d	ee	ee	         ee	e	f         df         d
ef
 fdZ xZS )PercentilesBucketuB  
    A sibling pipeline aggregation which calculates percentiles across all
    bucket of a specified metric in a sibling aggregation.

    :arg percents: The list of percentiles to calculate.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    percentiles_bucketra  r   r   r   ra  r   r   r   r   r   r   c                D     t                      j        d||||d| d S )Nrf  r'   r   )r=   ra  r   r   r   r   rH   s         r4   r   zPercentilesBucket.__init__
  sJ     	 	
!%		
 	

 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   r   rD   r
   r   r   r   rW   rX   s   @r4   rd  rd  
  s           D
 ;B,3  
 
 
 67
 c=()	

 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   rd  c                        e Zd ZdZdZeeeeeeddeeddf         deedf         dee	d	         e	e
eef                  df         d
ede
eef         df         deedf         deedf         def fdZ xZS )RangeaD  
    A multi-bucket value source based aggregation that enables the user to
    define a set of ranges - each representing a bucket.

    :arg field: The date field whose values are use to build ranges.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg ranges: An array of ranges used to bucket documents.
    :arg script:
    :arg keyed: Set to `true` to associate a unique string key with each
        bucket and return the ranges as a hash rather than an array.
    :arg format:
    ranger   r   rI  r   r;  r   r   r   r   r   rI  r  r   r   r;  r   r   c          
      H     t                      j        d||||||d| d S )Nrk  r'   r   )	r=   r   r   rI  r   r;  r   r   rH   s	           r4   r   zRange.__init__
  sP     	 	
	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   rV   r   rW   rX   s   @r4   ri  ri  
  s         D
 AH-4 GN,3,3
 
 
 S-}<=
 sM)*	

 -.c3h0H-W

 nd38nmCD
 T=()
 c=()
 
 
 
 
 
 
 
 
 
 
r6   ri  c                       e Zd ZdZdZeeeeeeeddeeee         df         deeddf         deeee         d	e	ee
f         df         d
eedf         deeeeedf         deedf         deedf         de
f fdZ xZS )	RareTermsu<  
    A multi-bucket value source based aggregation which finds "rare"
    terms — terms that are at the long-tail of the distribution and are
    not frequent.

    :arg exclude: Terms that should be excluded from the aggregation.
    :arg field: The field from which to return rare terms.
    :arg include: Terms that should be included in the aggregation.
    :arg max_doc_count: The maximum number of documents a term should
        appear in. Defaults to `1` if omitted.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg precision: The precision of the internal CuckooFilters. Smaller
        precision leads to better approximation, but higher memory usage.
        Defaults to `0.001` if omitted.
    :arg value_type:
    
rare_termsexcluder   includemax_doc_countr   r  
value_typerq  r   r   r   rr  types.TermsPartitionrs  r   r  rt  r   c                J     t                      j        d|||||||d| d S )Nrp  r'   r   )
r=   rq  r   rr  rs  r   r  rt  r   rH   s
            r4   r   zRareTerms.__init__
  sS     	 		
'!		
 		
 		
 		
 		
 		
 		
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   r   rV   r   rW   rX   s   @r4   rn  rn  
  s-        $ D
 =D@G 3:?F1807
 
 
 sHSM=89
 S-}<=	

 # 6S#XU

 S-/0
 sCm;<
 -.
 #},-
 
 
 
 
 
 
 
 
 
 
r6   rn  c                        e Zd ZdZdZeeeeeeddeed         df         deed         df         d	eedf         d
eeddf         deee	e
edf         dedeeef         df         def fdZ xZS )Ratea6  
    Calculates a rate of documents or a field in each bucket. Can only be
    used inside a `date_histogram` or `composite` aggregation.

    :arg unit: The interval used to calculate the rate. By default, the
        interval of the `date_histogram` is used.
    :arg mode: How the rate is calculated. Defaults to `sum` if omitted.
    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    rater  r  r   r   r   r   r  r<  r   r  )r  value_countr   r   r   r   r   r   r   c          
      H     t                      j        d||||||d| d S )Nrz  r'   r   )	r=   r  r  r   r   r   r   r   rH   s	           r4   r   zRate.__init__  sP      	 	
	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r
   rD   r   r   rV   r   r   r   rW   rX   s   @r4   rx  rx    s         D DK,3@G?FGN
 
 
 U 

 G01=@A
 c=()
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   rx  c                   F     e Zd ZdZdZefdeeddf         def fdZ	 xZ
S )ReverseNestedad  
    A special single bucket aggregation that enables aggregating on parent
    documents from nested documents. Should only be defined inside a
    `nested` aggregation.

    :arg path: Defines the nested object field that should be joined back
        to. The default is empty, which means that it joins back to the
        root/main document level.
    reverse_nestedr>  r   r   r   c                 >     t                      j        dd|i| d S r@  r   rA  s      r4   r   zReverseNested.__init__F  rB  r6   r!  rX   s   @r4   r~  r~  9  sy          D @G. .C,m;<. . . . . . . . . . .r6   r~  c            	       r     e Zd ZdZdZeeeddeedf         deedf         deedf         de	f fd	Z
 xZS )
RandomSamplera  
    A single bucket aggregation that randomly includes documents in the
    aggregated results. Sampling provides significant speed improvement at
    the cost of accuracy.

    :arg probability: (required) The probability that a document will be
        included in the aggregated data. Must be greater than 0, less than
        0.5, or exactly 1. The lower the probability, the fewer documents
        are matched.
    :arg seed: The seed to generate the random sampling of documents. When
        a seed is provided, the random subset of documents is the same
        between calls.
    :arg shard_seed: When combined with seed, setting shard_seed ensures
        100% consistent sampling over shards where data is exactly the
        same.
    random_samplerprobabilityseed
shard_seedr  r   r  r  r   c                B     t                      j        d|||d| d S )Nr  r'   r   )r=   r  r  r  r   rH   s        r4   r   zRandomSampler.__init__b  sC     	 	
#$:	
 	
IO	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   r   r   r   rW   rX   s   @r4   r  r  N  s         " D
 4;*107

 

 

 5-/0

 C&'	


 #},-

 

 

 

 

 

 

 

 

 

 

r6   r  c                   D     e Zd ZdZdZefdeedf         def fdZ	 xZ
S )Samplera  
    A filtering aggregation used to limit any sub aggregations' processing
    to a sample of the top-scoring documents.

    :arg shard_size: Limits how many top-scoring documents are collected
        in the sample processed on each shard. Defaults to `100` if
        omitted.
    samplerr  r   r   c                 >     t                      j        dd|i| d S )Nr  r'   r   )r=   r  r   rH   s      r4   r   zSampler.__init__{  s+    99J9&99999r6   )rP   rQ   rR   r   rB   r   r   r   r   r   rW   rX   s   @r4   r  r  o  so          D?F : :5m);#< :RU : : : : : : : : : :r6   r  c                   R    e Zd ZdZdZeeeeeeeeddedeee	f         df         dedeee	f         df         dedeee	f         df         d	ee
ee	f         df         d
edeee	f         df         deeddf         deeeeedf         dedeee	f         df         de	f fdZ xZS )ScriptedMetrica  
    A metric aggregation that uses scripts to provide a metric output.

    :arg combine_script: Runs once on each shard after document collection
        is complete. Allows the aggregation to consolidate the state
        returned from each shard.
    :arg init_script: Runs prior to any collection of documents. Allows
        the aggregation to set up any initial state.
    :arg map_script: Run once per document collected. If no
        `combine_script` is specified, the resulting state needs to be
        stored in the `state` object.
    :arg params: A global object with script parameters for `init`, `map`
        and `combine` scripts. It is shared between the scripts.
    :arg reduce_script: Runs once on the coordinating node after all
        shards have returned their results. The script is provided with
        access to a variable `states`, which is an array of the result of
        the `combine_script` on each shard.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    scripted_metriccombine_scriptinit_script
map_scriptr!   reduce_scriptr   r   r   r  r   r   r  r  r!   r  r   r   r   r   r   c                L     t                      j        d||||||||d|	 d S )Nr  r'   r   )r=   r  r  r  r!   r  r   r   r   r   rH   s             r4   r   zScriptedMetric.__init__  sV     	 
	
)#!'
	
 
	
 
	
 
	
 
	
 
	
 
	
r6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r   r   r   rV   r   rW   rX   s   @r4   r  r    sb        . D
 PWLSKR:ANU@G?FGN
 
 
 nd38nmKL
 >4S>=HI	

 .$sCx.-GH
 gc3h'67
 ^T#s(^]JK
 S-}<=
 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeddeedf         deedf         dee	d         df         d	eee
e         eeef         df         d
ef
 fdZ xZS )
SerialDiffuj  
    An aggregation that subtracts values in a time series from themselves
    at different time lags or periods.

    :arg lag: The historical bucket to subtract from the current value.
        Must be a positive, non-zero integer.
    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    serial_difflagr   r   r   r  r   r   r   r   r   r   c                D     t                      j        d||||d| d S )Nr  r'   r   )r=   r  r   r   r   r   rH   s         r4   r   zSerialDiff.__init__  sJ     	 	
!%		
 	

 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   rD   r
   r   r   r   r   rW   rX   s   @r4   r  r    s          D
 *1,3  
 
 
 3%&
 c=()	

 9:MI

 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r  c            #       X    e Zd ZdZdZdddiiZeeeeeeeeeeeeeeeeddeedf         ded	e	e
ef         df         d
ee
ee
         df         deed         df         dee
ddf         dede	e
ef         df         dee
ee
         de	e
ef         df         dede	e
ef         df         deedf         dede	e
ef         df         dede	e
ef         df         dede	e
ef         df         dede	e
ef         df         deedf         deedf         d eedf         d!ef" fd"Z xZS )#SignificantTermsaf
  
    Returns interesting or unusual occurrences of terms in a set.

    :arg background_filter: A background filter that can be used to focus
        in on significant terms within a narrower context, instead of the
        entire index.
    :arg chi_square: Use Chi square, as described in "Information
        Retrieval", Manning et al., Chapter 13.5.2, as the significance
        score.
    :arg exclude: Terms to exclude.
    :arg execution_hint: Mechanism by which the aggregation should be
        executed: using field values directly or using global ordinals.
    :arg field: The field from which to return significant terms.
    :arg gnd: Use Google normalized distance as described in "The Google
        Similarity Distance", Cilibrasi and Vitanyi, 2007, as the
        significance score.
    :arg include: Terms to include.
    :arg jlh: Use JLH score as the significance score.
    :arg min_doc_count: Only return terms that are found in more than
        `min_doc_count` hits. Defaults to `3` if omitted.
    :arg mutual_information: Use mutual information as described in
        "Information Retrieval", Manning et al., Chapter 13.5.1, as the
        significance score.
    :arg percentage: A simple calculation of the number of documents in
        the foreground sample with a term divided by the number of
        documents in the background with the term.
    :arg script_heuristic: Customized score, implemented via a script.
    :arg p_value: Significant terms heuristic that calculates the p-value
        between the term existing in foreground and background sets.  The
        p-value is the probability of obtaining test results at least as
        extreme as the results actually observed, under the assumption
        that the null hypothesis is correct. The p-value is calculated
        assuming that the foreground set and the background set are
        independent https://en.wikipedia.org/wiki/Bernoulli_trial, with
        the null hypothesis that the probabilities are the same.
    :arg shard_min_doc_count: Regulates the certainty a shard has if the
        term should actually be added to the candidate list or not with
        respect to the `min_doc_count`. Terms will only be considered if
        their local shard frequency within the set is higher than the
        `shard_min_doc_count`.
    :arg shard_size: Can be used to control the volumes of candidate terms
        produced by each shard. By default, `shard_size` will be
        automatically estimated based on the number of shards and the
        `size` parameter.
    :arg size: The number of buckets returned out of the overall terms
        list.
    significant_termsbackground_filterr^   r   )r  
chi_squarerq  r   r   gndrr  jlhr  mutual_information
percentagescript_heuristicp_valuer  r  r   r   r  types.ChiSquareHeuristicrq  r   rU  r   global_ordinals_hashglobal_ordinals_low_cardinalityr   r   r  'types.GoogleNormalizedDistanceHeuristicrr  ru  r  r  r  r   types.MutualInformationHeuristicr  types.PercentageScoreHeuristicr  types.ScriptedHeuristicr  ztypes.PValueHeuristicr  r  r   r   c                     t                      j        di d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|| d S )Nr  r  rq  r   r   r  rr  r  r  r  r  r  r  r  r  r   r'   r   )r=   r  r  rq  r   r   r  rr  r  r  r  r  r  r  r  r  r   r   rH   s                     r4   r   zSignificantTerms.__init__  s    V 	 	
 	
 	
//	
!z	
 G	
 *>		

 %	
 	
 G	
 	
 (-	
  21	
 "z	
 .-	
 G	
 !4 3	
 "z	
  #	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r`   r   r   r   r   rD   r   r   r
   r   r   rW   rX   s   @r4   r  r    s       . .` Dfg.K :A <C @G  IP3:    9@07*1Q=
 =
 =
 !!56=
 &S#XE
	=
 sHSM=89=
 3 
=
" S-}<=#=
$ 5tCH~}T
%=
* # 6S#XU
+=
0 &S#XEF1=
2 S-/03=
4 ".S#XM
5=
: ,d38nmK
;=
@  %tCH~}D
A=
F #T#s(^]B
G=
L #3#56M=
N #},-O=
P C&'Q=
R S=
 =
 =
 =
 =
 =
 =
 =
 =
 =
r6   r  c            (           e Zd ZdZdZdddiiZeeeeeeeeeeeeeeeeeddeedf         ded	e	e
ef         df         d
ee
ee
         df         deed         df         dee
ddf         deedf         dede	e
ef         df         dee
ee
         de	e
ef         df         dede	e
ef         df         deedf         dede	e
ef         df         dede	e
ef         df         dede	e
ef         df         deedf         deedf         deedf         d eee
df         eee
df                  df         d!ef$ fd"Z xZS )#SignificantTexta  
    Returns interesting or unusual occurrences of free-text terms in a
    set.

    :arg background_filter: A background filter that can be used to focus
        in on significant terms within a narrower context, instead of the
        entire index.
    :arg chi_square: Use Chi square, as described in "Information
        Retrieval", Manning et al., Chapter 13.5.2, as the significance
        score.
    :arg exclude: Values to exclude.
    :arg execution_hint: Determines whether the aggregation will use field
        values directly or global ordinals.
    :arg field: The field from which to return significant text.
    :arg filter_duplicate_text: Whether to out duplicate text to deal with
        noisy data.
    :arg gnd: Use Google normalized distance as described in "The Google
        Similarity Distance", Cilibrasi and Vitanyi, 2007, as the
        significance score.
    :arg include: Values to include.
    :arg jlh: Use JLH score as the significance score.
    :arg min_doc_count: Only return values that are found in more than
        `min_doc_count` hits. Defaults to `3` if omitted.
    :arg mutual_information: Use mutual information as described in
        "Information Retrieval", Manning et al., Chapter 13.5.1, as the
        significance score.
    :arg percentage: A simple calculation of the number of documents in
        the foreground sample with a term divided by the number of
        documents in the background with the term.
    :arg script_heuristic: Customized score, implemented via a script.
    :arg shard_min_doc_count: Regulates the certainty a shard has if the
        values should actually be added to the candidate list or not with
        respect to the min_doc_count. Values will only be considered if
        their local shard frequency within the set is higher than the
        `shard_min_doc_count`.
    :arg shard_size: The number of candidate terms produced by each shard.
        By default, `shard_size` will be automatically estimated based on
        the number of shards and the `size` parameter.
    :arg size: The number of buckets returned out of the overall terms
        list.
    :arg source_fields: Overrides the JSON `_source` fields from which
        text will be analyzed.
    significant_textr  r^   r   )r  r  rq  r   r   filter_duplicate_textr  rr  r  r  r  r  r  r  r  r   source_fieldsr   r  r  rq  r   r  r   r   r  r  r  rr  ru  r  r  r  r  r  r  r  r  r  r  r  r   r  r   c                     t                      j        di d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|| d S )Nr  r  rq  r   r   r  r  rr  r  r  r  r  r  r  r  r   r  r'   r   )r=   r  r  rq  r   r   r  r  rr  r  r  r  r  r  r  r  r   r  r   rH   s                      r4   r   zSignificantText.__init__  s   \ 	 	
 	
 	
//	
!z	
 G	
 *>		

 %	
 #8"7	
 	
 G	
 	
 (-	
  21	
 "z	
 .-	
 !4 3	
 "z	
  !	
" (-%	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r`   r   r   r   r   rD   r   r   r
   rV   r   r   rW   rX   s   @r4   r  r  Q  s       * *X Dfg.K :A <C @G<C  IP3:   9@07*1
 WA
 A
 A
 !!56A
 &S#XE
	A
 sHSM=89A
 3 
A
" S-}<=#A
$  %T=%89%A
& 5tCH~}T
'A
, # 6S#XU
-A
2 &S#XEF3A
4 S-/05A
6 ".S#XM
7A
< ,d38nmK
=A
B  %tCH~}D
CA
H #3#56IA
J #},-KA
L C&'MA
N #**+U3 3345
OA
X YA
 A
 A
 A
 A
 A
 A
 A
 A
 A
r6   r  c                        e Zd ZdZdZeeeeddeedf         deeddf         deeee	e
df         d	ed
eeef         df         def
 fdZ xZS )Statsae  
    A multi-value metrics aggregation that computes stats over numeric
    values extracted from the aggregated documents.

    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    statsr   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S r   r   r   s         r4   r   zStats.__init__  r   r6   r   rX   s   @r4   r  r    s        	 	 D
 -4@G?FGN
 
 
 c=()
 S-}<=	

 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )StatsBucketu  
    A sibling pipeline aggregation which calculates a variety of stats
    across all bucket of a specified metric in a sibling aggregation.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    stats_bucketr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zStatsBucket.__init__  r   r6   r   rX   s   @r4   r  r    s          D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeddeedf         deeddf         deee	e
edf         d	ed
eeef         df         def
 fdZ xZS )StringStatsa  
    A multi-value metrics aggregation that computes statistics over string
    values extracted from the aggregated documents.

    :arg show_distribution: Shows the probability distribution for all
        characters.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    string_statsshow_distributionr   r   r   r  r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S )Nr  r'   r   )r=   r  r   r   r   r   rH   s         r4   r   zStringStats.__init__  sJ     	 	
/		
 	

 	
 	
 	
 	
 	
r6   r|  rX   s   @r4   r  r    s        
 
 D
 9@@G?FGN
 
 
 !}!45
 S-}<=	

 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeddeedf         deeddf         deeee	e
df         d	ed
eeef         df         def
 fdZ xZS )Suma`  
    A single-value metrics aggregation that sums numeric values that are
    extracted from the aggregated documents.

    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    r  r   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S r   r   r   s         r4   r   zSum.__init__3  r   r6   r   rX   s   @r4   r  r  %  r   r6   r  c                        e Zd ZdZdZeeeddeedf         deed         df         deee	e         e
eef         df         d	ef fd
Z xZS )	SumBucketu  
    A sibling pipeline aggregation which calculates the sum of a specified
    metric across all buckets in a sibling aggregation.

    :arg format: `DecimalFormat` pattern for the output value. If
        specified, the formatted value is returned in the aggregation’s
        `value_as_string` property.
    :arg gap_policy: Policy to apply when gaps are found in the data.
        Defaults to `skip` if omitted.
    :arg buckets_path: Path to the buckets that contain one set of values
        to correlate.
    
sum_bucketr   r   r   r   r   r   r   c                B     t                      j        d|||d| d S r   r   r   s        r4   r   zSumBucket.__init__Q  r   r6   r   rX   s   @r4   r  r  A  s          D
 -4  
 
 
 c=()
 9:MI
	
 #S 1=@

 
 
 
 
 
 
 
 
 
 
r6   r  c            %           e Zd ZdZdZeeeeeeeeeeeeeeeeeddeed         df         deee	e         df         deed	         df         d
eeddf         deee	e         de
eef         df         deedf         deeeeedf         deed         df         deedf         deedf         deeeedf         ed         f         e	eeedf         ed         f                  df         dede
eef         df         deedf         deedf         deedf         deedf         deedf         def$ fdZdd d!ed"ee         fd#Z xZS )$Termsa  
    A multi-bucket value source based aggregation where buckets are
    dynamically built - one per unique value.

    :arg collect_mode: Determines how child aggregations should be
        calculated: breadth-first or depth-first.
    :arg exclude: Values to exclude. Accepts regular expressions and
        partitions.
    :arg execution_hint: Determines whether the aggregation will use field
        values directly or global ordinals.
    :arg field: The field from which to return terms.
    :arg include: Values to include. Accepts regular expressions and
        partitions.
    :arg min_doc_count: Only return values that are found in more than
        `min_doc_count` hits. Defaults to `1` if omitted.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg missing_order:
    :arg missing_bucket:
    :arg value_type: Coerced unmapped fields into the specified type.
    :arg order: Specifies the sort order of the buckets. Defaults to
        sorting by descending document count.
    :arg script:
    :arg shard_min_doc_count: Regulates the certainty a shard has if the
        term should actually be added to the candidate list or not with
        respect to the `min_doc_count`. Terms will only be considered if
        their local shard frequency within the set is higher than the
        `shard_min_doc_count`.
    :arg shard_size: The number of candidate terms produced by each shard.
        By default, `shard_size` will be automatically estimated based on
        the number of shards and the `size` parameter.
    :arg show_term_doc_count_error: Set to `true` to return the
        `doc_count_error_upper_bound`, which is an upper bound to the
        error on the `doc_count` returned by each shard.
    :arg size: The number of buckets returned out of the overall terms
        list. Defaults to `10` if omitted.
    :arg format:
    r4  )r5  rq  r   r   rr  r  r   missing_ordermissing_bucketrt  r:  r   r  r  r6  r   r   r5  r7  r   rq  r   r  r   r   rr  ru  r  r   r  )firstlastr   r  rt  r:  r@  r   r   r  r  r6  r   r   r   c                     t                      j        di d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|d|| d S )Nr5  rq  r   r   rr  r  r   r  r  rt  r:  r   r  r  r6  r   r   r'   r   )r=   r5  rq  r   r   rr  r  r   r  r  rt  r:  r   r  r  r6  r   r   r   rH   s                      r4   r   zTerms.__init__  s   P 	 	
 	
 	
%	
G	
 *>	
 %		

 G	
 (-	
 G	
 (-	
 *>	
 "z	
 %	
 6	
 !4 3	
 "z	
 '@&?	
  !	
" 6%	
 	
 	
 	
 	
r6   rI   rJ   rK   r"   c                 $    t          | ||          S rM   r   rN   s      r4   rO   zTerms.result  r   r6   )rP   rQ   rR   r   rB   r   r   r
   rD   r   r   r   r   r   rV   r   r   r   rO   rW   rX   s   @r4   r  r  b  s       % %N D <C @G 3:?F 5<07
 GN9@07@G*1,3K;
 ;
 ;
 23]B
;
 sHSM=89;
 3 
;
  S-}<=!;
" # 6S#XU
#;
( S-/0);
* sCm;<+;
, ./>
-;
2 dM123;
4 #},-5;
6 E#223W]5KKLWU3(;#;<gm>TTUV
7;
@ nd38nmCDA;
B #3#56C;
D #},-E;
F $)})<#=G;
H C&'I;
J c=()K;
L M;
 ;
 ;
 ;
 ;
 ;
z3- 3S 3Xc] 3 3 3 3 3 3 3 3r6   r  c                   \     e Zd ZdZdZeeddeedf         deedf         de	f fdZ
 xZS )	
TimeSeriesa  
    The time series aggregation queries data created using a time series
    index. This is typically data such as metrics or other data streams
    with a time component, and requires creating an index using the time
    series mode.

    :arg size: The maximum number of results to return. Defaults to
        `10000` if omitted.
    :arg keyed: Set to `true` to associate a unique string key with each
        bucket and returns the ranges as a hash rather than an array.
    time_seriesr   r;  r   r   r;  r   c                @     t                      j        d||d| d S )Nr  r'   r   )r=   r   r;  r   rH   s       r4   r   zTimeSeries.__init__  s/     	:d%::6:::::r6   )rP   rQ   rR   r   rB   r   r   r   rV   r   r   rW   rX   s   @r4   r  r    s        
 
 D
 +2,3	; ; ; C&'; T=()	;
 ; ; ; ; ; ; ; ; ; ;r6   r  c            %           e Zd ZdZdZeeeeeeeeeeeeeeeeddeed         eee	e
f                  df         deedf         deed         eee	e
f                  df         d	eedf         d
edee	e
f         df         deee	df         ee	e
f         df         deedf         deeee	df         df         eeee	df         df                  ee	e
f         df         deedee	e
f         df         deee	df         eee	df                  df         deedf         deedf         deedf         dee	ddf         dee	eeedf         dedee	e
f         df         de
f" fdZddd e
d!ee
         fd"Z xZS )#TopHitsa  
    A metric aggregation that returns the top matching documents per
    bucket.

    :arg docvalue_fields: Fields for which to return doc values.
    :arg explain: If `true`, returns detailed information about score
        computation as part of a hit.
    :arg fields: Array of wildcard (*) patterns. The request returns
        values for field names matching these patterns in the hits.fields
        property of the response.
    :arg from: Starting document offset.
    :arg highlight: Specifies the highlighter to use for retrieving
        highlighted snippets from one or more fields in the search
        results.
    :arg script_fields: Returns the result of one or more script
        evaluations for each hit.
    :arg size: The maximum number of top matching hits to return per
        bucket. Defaults to `3` if omitted.
    :arg sort: Sort order of the top matching hits. By default, the hits
        are sorted by the score of the main query.
    :arg _source: Selects the fields of the source that are returned.
    :arg stored_fields: Returns values for the specified stored fields
        (fields that use the `store` mapping option).
    :arg track_scores: If `true`, calculates and returns document scores,
        even if the scores are not used for sorting.
    :arg version: If `true`, returns document version as part of a hit.
    :arg seq_no_primary_term: If `true`, returns sequence number and
        primary term of the last modification of each hit.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    top_hits)docvalue_fieldsexplainrg  r   	highlightscript_fieldsr   r   _sourcestored_fieldstrack_scoresversionseq_no_primary_termr   r   r   r  ztypes.FieldAndFormatr   r  rg  r   r  ztypes.Highlightr  ztypes.ScriptFieldr   r   r   r   r  ztypes.SourceFilterr  r  r  r  r   r   r   r   r   c                     t                      j        di d|d|d|d|d|d|d|d|d	|	d
|
d|d|d|d|d|d|| d S )Nr  r  rg  r   r  r  r   r   r  r  r  r  r  r   r   r   r'   r   )r=   r  r  rg  r   r  r  r   r   r  r  r  r  r  r   r   r   r   rH   s                     r4   r   zTopHits.__init__  s    L 	 	
 	
 	
+O	
G	
 6	
 %		

  i	
 (-	
 	
 	
 G	
 (-	
 &	
 G	
 !4 3	
 %	
 G	
  6#	
 	
 	
 	
 	
r6   rI   rJ   rK   r"   c                 $    t          | ||          S rM   )r   rN   s      r4   rO   zTopHits.resultE  s    4...r6   )rP   rQ   rR   r   rB   r   r   r   r   rD   r   rV   r   r   r   r   r   rO   rW   rX   s   @r4   r  r    s          D D .5 +2MT *1  
 3:.5:A@G?FGNG8
 8
 8
 +,htCH~.FU
8
 t]*+8
 +,htCH~.FU
8
 S-'(8
 *DcNMIJ8
 C,,-tCH~}L
8
 C&'8
  %0013FFGU5&9!9:<OOPQcN
!8
, &S#XE
-8
2 #**+U3 3345
38
< D-/0=8
> t]*+?8
@ #4#67A8
B S-}<=C8
D sCm;<E8
F nd38nmCDG8
H I8
 8
 8
 8
 8
 8
t/- /S /Xc] / / / / / / / /r6   r  c            	            e Zd ZdZdZeeeddedeee	f         df         dedeee	f         df         dee
d	         df         d
e	f fdZ xZS )TTestuw  
    A metrics aggregation that performs a statistical hypothesis test in
    which the test statistic follows a Student’s t-distribution under the
    null hypothesis on numeric values extracted from the aggregated
    documents.

    :arg a: Test population A.
    :arg b: Test population B.
    :arg type: The type of test. Defaults to `heteroscedastic` if omitted.
    t_testabr^   r  ztypes.TestPopulationr   r  r^   )pairedhomoscedasticheteroscedasticr   c                B     t                      j        d|||d| d S )Nr  r'   r   )r=   r  r  r^   r   rH   s        r4   r   zTTest.__init__W  s1     	717777777r6   )rP   rQ   rR   r   rB   r   r   r   rD   r   r
   r   rW   rX   s   @r4   r  r  I  s        	 	 D
 KRJQ 
8 
8 
8 'c3hFG
8 'c3hFG	
8
 @A=P

8 
8 
8 
8 
8 
8 
8 
8 
8 
8 
8r6   r  c                   Z    e Zd ZdZdZeeeeeeddeded         eee	e
f                  df         deedf         deeee	d	f         d
f         eeee	d	f         d
f                  ee	e
f         df         dee	d	df         dee	eeedf         dedee	e
f         df         de
f fdZ xZS )
TopMetricsa  
    A metric aggregation that selects metrics from the document with the
    largest or smallest sort value.

    :arg metrics: The fields of the top document to return.
    :arg size: The number of top documents from which to return metrics.
        Defaults to `1` if omitted.
    :arg sort: The sort order of the documents.
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    top_metricsmetricsr   r   r   r   r   r  ztypes.TopMetricsValuer   r   r   r   r   r   r   r   r   r   c          
      H     t                      j        d||||||d| d S )Nr  r'   r   )	r=   r  r   r   r   r   r   r   rH   s	           r4   r   zTopMetrics.__init__u  sP    * 	 	
	
 	
 	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   r   r   rD   r   r   r   rV   r   rW   rX   s   @r4   r  r  d  sg         D *1 @G?FGN%
 
 
 #,-T#s(^$

 C&'
 %0013FFGU5&9!9:<OOPQcN

  S-}<=!
" sCm;<#
$ nd38nmCD%
& '
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeddeedf         deeddf         deeee	e
df         d	ed
eeef         df         def
 fdZ xZS )
ValueCountah  
    A single-value metrics aggregation that counts the number of values
    that are extracted from the aggregated documents.

    :arg format:
    :arg field: The field on which to run the aggregation.
    :arg missing: The value to apply to documents that do not have a
        value. By default, documents without a value are ignored.
    :arg script:
    r{  r   r   r   r   r   r   r   r   r   c                D     t                      j        d||||d| d S r   r   r   s         r4   r   zValueCount.__init__  r   r6   r   rX   s   @r4   r  r    s        	 	 D
 -4@G?FGN
 
 
 c=()
 S-}<=	

 sCm;<
 nd38nmCD
 
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeddeedf         dedeee	f         df         dee
d	         df         d
edeee	f         df         de	f
 fdZ xZS )WeightedAvga|  
    A single-value metrics aggregation that computes the weighted average
    of numeric values that are extracted from the aggregated documents.

    :arg format: A numeric response formatter.
    :arg value: Configuration for the field that provides the values.
    :arg value_type:
    :arg weight: Configuration for the field or script that provides the
        weights.
    weighted_avgr   valuert  weightr   r   r  ztypes.WeightedAverageValuert  )
stringlongdoublenumberdate
date_nanosipnumeric	geo_pointbooleanr  r   c                D     t                      j        d||||d| d S )Nr  r'   r   )r=   r   r  rt  r  r   rH   s         r4   r   zWeightedAvg.__init__  sE    6 	 	
:f	
 	
PV	
 	
 	
 	
 	
r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r
   r   rW   rX   s   @r4   r  r    s        	 	 D
 -4   1
 
 
 c=()
 ($sCx.-G
	
 	 

, ($sCx.-G
-
2 3
 
 
 
 
 
 
 
 
 
r6   r  c                        e Zd ZdZdZeeeeeddeeddf         deedf         deedf         d	eedf         d
ede	ee
f         df         de
f fdZddde
dee
         fdZ xZS )VariableWidthHistograma  
    A multi-bucket aggregation similar to the histogram, except instead of
    providing an interval to use as the width of each bucket, a target
    number of buckets is provided.

    :arg field: The name of the field.
    :arg buckets: The target number of buckets. Defaults to `10` if
        omitted.
    :arg shard_size: The number of buckets that the coordinating node will
        request from each shard. Defaults to `buckets * 50`.
    :arg initial_buffer: Specifies the number of individual documents that
        will be stored in memory on a shard before the initial bucketing
        algorithm is run. Defaults to `min(10 * shard_size, 50000)`.
    :arg script:
    variable_width_histogramr   r   r  initial_bufferr   r   r   r   r   r  r  r   r   r   c          	      F     t                      j        d|||||d| d S )Nr  r'   r   )r=   r   r   r  r  r   r   rH   s          r4   r   zVariableWidthHistogram.__init__  sM     	 	
!)	
 	
 	
 	
 	
 	
 	
r6   rI   rJ   rK   r"   c                 $    t          | ||          S rM   r   rN   s      r4   rO   zVariableWidthHistogram.result  r   r6   )rP   rQ   rR   r   rB   r   r   rD   r   r   r   r   r   rO   rW   rX   s   @r4   r  r    s          &D
 AH-4074;GN
 
 
 S-}<=
 sM)*	

 #},-
 c=01
 nd38nmCD
 
 
 
 
 
 
&3- 3S 3Xc] 3 3 3 3 3 3 3 3r6   r  rM   )collections.abcr*   r/   r   typingr   r   r   r   r   r	   r
   r   r   r   r   r   r   elastic_transport.client_utilsr   r   r   response.aggsr   r   r   r   utilsr   r   r   r   r8   r   document_baser   search_baser   rD   r5   r0   rZ   rg   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r#  r*  r.  r2  rF  rL  rQ  rY  r_  rd  rl  rq  rw  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r	  r  r  r   r#  r&  r,  r1  r<  rD  rO  rS  r^  rd  ri  rn  rx  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r'   r6   r4   <module>r     s  $                                         3 2 2 2 2 2       P P P P P P P P P P P P ( ( ( ( ( ( ( ( ( ( (::::::000000''''''
 -1/8 /8~c3h/C?@/8U3<()/8 /8 	/8 /8 /8 /8d3 3 3 3 3'72; 3 3 3(L. L. L. L. L.gbk L. L. L.^    WR[#b'   	 	 	 	 	s2w 	 	 	I I I I IfRj I I I873 73 73 73 73r
 73 73 73t
 
 
 
 
#b' 
 
 
8 
  
  
  
  
  
  
  
F)
 )
 )
 )
 )
c"g )
 )
 )
X%
 %
 %
 %
 %
8B< %
 %
 %
P%
 %
 %
 %
 %
Xb\ %
 %
 %
P!
 !
 !
 !
 !
 !
 !
 !
H1
 1
 1
 1
 1
 1
 1
 1
hQ Q Q Q Q Q Q Q4/
 /
 /
 /
 /
#b' /
 /
 /
dP P P P Pc"g P P P0P P P P PB P P P0O
 O
 O
 O
 O
VBZ O
 O
 O
d"
 "
 "
 "
 "
(2, "
 "
 "
J. . . . .vbz . . .L L L L Lr
 L L LB
 
 
 
 
HRL 
 
 
B
 
 
 
 
HRL 
 
 
DZ3 Z3 Z3 Z3 Z3F2J Z3 Z3 Z3z*
 *
 *
 *
 *
r
 *
 *
 *
Z
 
 
 
 
" 
 
 
D'
 '
 '
 '
 '
 '
 '
 '
T!
 !
 !
 !
 !
CG !
 !
 !
H%
 %
 %
 %
 %
(2, %
 %
 %
P*
 *
 *
 *
 *
s2w *
 *
 *
Z    VBZ   4%
 %
 %
 %
 %
fRj %
 %
 %
P
 
 
 
 
B 
 
 
D'
 '
 '
 '
 '
#b' '
 '
 '
T-
 -
 -
 -
 -
&* -
 -
 -
`.
 .
 .
 .
 .
&* .
 .
 .
b&
 &
 &
 &
 &
c"g &
 &
 &
R0
 0
 0
 0
 0
&* 0
 0
 0
f-
 -
 -
 -
 -
 -
 -
 -
`# # # # #VBZ # # #H3 H3 H3 H3 H3r
 H3 H3 H3V? ? ? ? ?fRj ? ? ?2(
 (
 (
 (
 (
vbz (
 (
 (
V*
 *
 *
 *
 *
 *
 *
 *
Z#
 #
 #
 #
 #
3r7 #
 #
 #
LN N N N N#b' N N ND
 
 
 
 
#b' 
 
 
8
 
 
 
 
 
 
 
D-
 -
 -
 -
 -
c"g -
 -
 -
`
 
 
 
 
#b' 
 
 
8
 
 
 
 
 
 
 
DA A A A AfRj A A A.# # # # # # # #+
 +
 +
 +
 +
Yr] +
 +
 +
\+
 +
 +
 +
 +
Yr] +
 +
 +
\-
 -
 -
 -
 -
9R= -
 -
 -
`-
 -
 -
 -
 -
9R= -
 -
 -
`-
 -
 -
 -
 -
)B- -
 -
 -
`,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
^/
 /
 /
 /
 /
x| /
 /
 /
d8
 8
 8
 8
 8
 8
 8
 8
v. . . . .VBZ . . .$.
 .
 .
 .
 .
 .
 .
 .
b. . . . .VBZ . . .0
 0
 0
 0
 0
c"g 0
 0
 0
f/
 /
 /
 /
 /
#b' /
 /
 /
d$
 $
 $
 $
 $
 $
 $
 $
N&
 &
 &
 &
 &
F2J &
 &
 &
R,
 ,
 ,
 ,
 ,
r
 ,
 ,
 ,
^)
 )
 )
 )
 )
3r7 )
 )
 )
X. . . . .F2J . . .*
 
 
 
 
F2J 
 
 
B: : : : :fRj : : : 1
 1
 1
 1
 1
SW 1
 1
 1
h%
 %
 %
 %
 %
" %
 %
 %
Ps
 s
 s
 s
 s
vbz s
 s
 s
ls
 s
 s
 s
 s
fRj s
 s
 s
l
 
 
 
 
CG 
 
 
8
 
 
 
 
(2, 
 
 
B
 
 
 
 
#b' 
 
 
B
 
 
 
 
#b' 
 
 
8
 
 
 
 
 
 
 
Bh3 h3 h3 h3 h3F2J h3 h3 h3V; ; ; ; ; ; ; ;2`/ `/ `/ `/ `/c"g `/ `/ `/F8 8 8 8 8CG 8 8 86.
 .
 .
 .
 .
R .
 .
 .
b
 
 
 
 
R 
 
 
8+
 +
 +
 +
 +
#b' +
 +
 +
\'3 '3 '3 '3 '3VBZ '3 '3 '3 '3 '3r6   