HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //proc/self/root/lib/python3.9/site-packages/redis/commands/bf/__pycache__/__init__.cpython-39.pyc
a

��b��@s�ddlmZddlmZddlTddlmZmZmZm	Z	m
Z
Gdd�de�ZGd	d
�d
e
e�ZGdd�dee�ZGd
d�dee�ZGdd�dee�ZGdd�dee�ZdS)�)�bool_ok�)�
parse_to_list�)�*)�BFInfo�CFInfo�CMSInfo�TDigestInfo�TopKInfoc@s�eZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��ZdS)�
AbstractBlooma
    The client allows to interact with RedisBloom and use all of
    it's functionality.

    - BF for Bloom Filter
    - CF for Cuckoo Filter
    - CMS for Count-Min Sketch
    - TOPK for TopK Data Structure
    - TDIGEST for estimate rank statistics
    cCs|�dg�||7}dS)zAppend ITEMS to params.ZITEMSN��extend)�params�items�r�>/usr/lib/python3.9/site-packages/redis/commands/bf/__init__.py�append_itemsszAbstractBloom.append_itemscCs|dur|�d|g�dS)zAppend ERROR to params.NZERRORr
)r�errorrrr�append_errorszAbstractBloom.append_errorcCs|dur|�d|g�dS)zAppend CAPACITY to params.NZCAPACITYr
)rZcapacityrrr�append_capacity szAbstractBloom.append_capacitycCs|dur|�d|g�dS)zAppend EXPANSION to params.NZ	EXPANSIONr
)rZ	expansionrrr�append_expansion&szAbstractBloom.append_expansioncCs|dur|�dg�dS)z Append NONSCALING tag to params.NZ
NONSCALINGr
)rZnoScalerrr�append_no_scale,szAbstractBloom.append_no_scalecCs"t|�dkr|�d�||7}dS)zAppend WEIGHTS to params.rZWEIGHTSN)�len�append)r�weightsrrr�append_weights2s
zAbstractBloom.append_weightscCs|dur|�dg�dS)zAppend NOCREATE tag to params.NZNOCREATEr
)rZnoCreaterrr�append_no_create9szAbstractBloom.append_no_createcCs2tt|��D] }|�||�|�||�qdS)z/Append pairs of items and increments to params.N��rangerr)rrZ
increments�irrr�append_items_and_increments?sz)AbstractBloom.append_items_and_incrementscCs2tt|��D] }|�||�|�||�qdS)z,Append pairs of items and weights to params.Nr)rrrr rrr�append_values_and_weightsFsz'AbstractBloom.append_values_and_weightscCs|dur|�d|g�dS)zAppend MAXITERATIONS to params.NZ
MAXITERATIONSr
)rZmax_iterationsrrr�append_max_iterationsMsz#AbstractBloom.append_max_iterationscCs|dur|�d|g�dS)zAppend BUCKETSIZE to params.NZ
BUCKETSIZEr
)rZbucket_sizerrr�append_bucket_sizeSsz AbstractBloom.append_bucket_sizeN)�__name__�
__module__�__qualname__�__doc__�staticmethodrrrrrrrr!r"r#r$rrrrrs.









rc@seZdZdd�ZdS)�CMSBloomcKsLtttttttti}||_t|_|j	|_	|�
�D]\}}|j�||�q0dS�zCreate a new RedisBloom client.N)Z
CMS_INITBYDIMrZCMS_INITBYPROBZ	CMS_MERGEZCMS_INFOr	�client�CMSCommands�commandmixin�execute_commandr�set_response_callback��selfr,�kwargsZMODULE_CALLBACKS�k�vrrr�__init__[s�	zCMSBloom.__init__N�r%r&r'r6rrrrr*Zsr*c@seZdZdd�ZdS)�	TOPKBloomc
KsPtttttttttti}||_t	|_
|j|_|��D]\}}|j�
||�q4dSr+)ZTOPK_RESERVErZTOPK_ADDrZTOPK_INCRBYZ	TOPK_LISTZ	TOPK_INFOrr,�TOPKCommandsr.r/rr0r1rrrr6ps�
zTOPKBloom.__init__Nr7rrrrr8osr8c@seZdZdd�ZdS)�CFBloomcKsDtttti}||_t|_|j|_|��D]\}}|j�	||�q(dSr+)
Z
CF_RESERVErZCF_INFOrr,�
CFCommandsr.r/rr0r1rrrr6�s
�zCFBloom.__init__Nr7rrrrr:�sr:c@seZdZdd�ZdS)�TDigestBloomcKsTtttttttttttti}||_	t
|_|j|_|�
�D]\}}|j	�||�q8dSr+)ZTDIGEST_CREATErZTDIGEST_CDF�floatZTDIGEST_QUANTILEZTDIGEST_MINZTDIGEST_MAXZTDIGEST_INFOr
r,�TDigestCommandsr.r/rr0r1rrrr6�s�zTDigestBloom.__init__Nr7rrrrr<�sr<c@seZdZdd�ZdS)�BFBloomcKsDtttti}||_t|_|j|_|��D]\}}|j�	||�q(dSr+)
Z
BF_RESERVErZBF_INFOrr,�
BFCommandsr.r/rr0r1rrrr6�s�zBFBloom.__init__Nr7rrrrr?�sr?N)Zredis.clientrZhelpersrZcommands�inforrr	r
r�objectrr-r*r9r8r;r:r>r<r@r?rrrr�<module>sR