File: //lib/python3.9/site-packages/redis/commands/bf/__pycache__/commands.cpython-39.pyc
a
��b�G � @ s d dl mZ d dlmZ d dlmZ dZdZdZdZ dZ
d Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0G d/d0� d0�Z1G d1d2� d2�Z2G d3d4� d4�Z3G d5d6� d6�Z4G d7d8� d8�Z5d9S ):� )�NEVER_DECODE)�ModuleError)�HIREDIS_AVAILABLEz
BF.RESERVEzBF.ADDzBF.MADDz BF.INSERTz BF.EXISTSz
BF.MEXISTSzBF.SCANDUMPzBF.LOADCHUNKzBF.INFOz
CF.RESERVEzCF.ADDzCF.ADDNXz CF.INSERTzCF.INSERTNXz CF.EXISTSz
CF.MEXISTSzCF.DELzCF.COUNTzCF.SCANDUMPzCF.LOADCHUNKzCF.INFOz
CMS.INITBYDIMzCMS.INITBYPROBz
CMS.INCRBYz CMS.QUERYz CMS.MERGEzCMS.INFOzTOPK.RESERVEzTOPK.ADDzTOPK.INCRBYz
TOPK.QUERYz
TOPK.COUNTz TOPK.LISTz TOPK.INFOzTDIGEST.CREATEz
TDIGEST.RESETzTDIGEST.ADDz
TDIGEST.MERGEzTDIGEST.CDFzTDIGEST.QUANTILEzTDIGEST.MINzTDIGEST.MAXzTDIGEST.INFOc @ s\ e Zd ZdZddd�Zdd� Zdd� Zdd d
�Zdd� Zd
d� Z dd� Z
dd� Zdd� ZdS )�
BFCommandszBloom Filter commands.Nc C s4 |||g}| � ||� | �||� | jtg|�R � S )aA
Create a new Bloom Filter `key` with desired probability of false positives
`errorRate` expected entries to be inserted as `capacity`.
Default expansion value is 2. By default, filter is auto-scaling.
For more information see `BF.RESERVE <https://redis.io/commands/bf.reserve>`_.
)�append_expansion�append_no_scale�execute_command�
BF_RESERVE)�self�keyZ errorRate�capacity� expansion�noScale�params� r �>/usr/lib/python3.9/site-packages/redis/commands/bf/commands.py�create: s
zBFCommands.createc C s | � t||�S )z�
Add to a Bloom Filter `key` an `item`.
For more information see `BF.ADD <https://redis.io/commands/bf.add>`_.
)r �BF_ADD�r
r �itemr r r �addF s zBFCommands.addc G s | j t|g|�R � S )z�
Add to a Bloom Filter `key` multiple `items`.
For more information see `BF.MADD <https://redis.io/commands/bf.madd>`_.
)r �BF_MADD�r
r �itemsr r r �maddM s zBFCommands.maddc C s` |g}| � ||� | �||� | �||� | �||� | �||� | �||� | jtg|�R � S )as
Add to a Bloom Filter `key` multiple `items`.
If `nocreate` remain `None` and `key` does not exist, a new Bloom Filter
`key` will be created with desired probability of false positives `errorRate`
and expected entries to be inserted as `size`.
For more information see `BF.INSERT <https://redis.io/commands/bf.insert>`_.
)�append_capacityZappend_errorr �append_no_creater �append_itemsr � BF_INSERT) r
r r r �errorZnoCreater
r r r r r �insertT s zBFCommands.insertc C s | � t||�S )z�
Check whether an `item` exists in Bloom Filter `key`.
For more information see `BF.EXISTS <https://redis.io/commands/bf.exists>`_.
)r � BF_EXISTSr r r r �existsp s zBFCommands.existsc G s | j t|g|�R � S )z�
Check whether `items` exist in Bloom Filter `key`.
For more information see `BF.MEXISTS <https://redis.io/commands/bf.mexists>`_.
)r �
BF_MEXISTSr r r r �mexistsw s zBFCommands.mexistsc C s8 t rtd��||g}i }g |t<