HEX
Server: Apache
System: Linux beluga.o2switch.net 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP Thu May 7 23:17:13 UTC 2026 x86_64
User: sc3naki1272 (1113)
PHP: 8.3.33
Disabled: NONE
Upload Files
File: //opt/alt/python35/lib/python3.5/site-packages/aioredis/commands/hyperloglog.py
from aioredis.util import wait_ok


class HyperLogLogCommandsMixin:
    """HyperLogLog commands mixin.

    For commands details see: http://redis.io/commands#hyperloglog
    """

    def pfadd(self, key, value, *values):
        """Adds the specified elements to the specified HyperLogLog."""
        return self.execute(b'PFADD', key, value, *values)

    def pfcount(self, key, *keys):
        """Return the approximated cardinality of
        the set(s) observed by the HyperLogLog at key(s).
        """
        return self.execute(b'PFCOUNT', key, *keys)

    def pfmerge(self, destkey, sourcekey, *sourcekeys):
        """Merge N different HyperLogLogs into a single one."""
        fut = self.execute(b'PFMERGE', destkey, sourcekey, *sourcekeys)
        return wait_ok(fut)