id int64 0 328k | repository_name stringlengths 7 58 | file_path stringlengths 9 302 | class_name stringlengths 5 256 | human_written_code stringlengths 16 2.16M | class_skeleton stringlengths 18 1.49M ⌀ | total_program_units int64 1 1.76k | total_doc_str int64 0 771 | AvgCountLine float64 0 7.89k | AvgCountLineBlank float64 0 297 | AvgCountLineCode float64 0 7.89k | AvgCountLineComment float64 0 7.89k | AvgCyclomatic float64 0 130 | CommentToCodeRatio float64 0 168 | CountClassBase float64 0 40 | CountClassCoupled float64 0 583 | CountClassCoupledModified float64 0 575 | CountClassDerived float64 0 5.35k | CountDeclInstanceMethod float64 0 529 | CountDeclInstanceVariable float64 0 296 | CountDeclMethod float64 0 599 | CountDeclMethodAll float64 0 1.12k | CountLine float64 1 40.4k | CountLineBlank float64 0 8.16k | CountLineCode float64 1 25.7k | CountLineCodeDecl float64 1 8.15k | CountLineCodeExe float64 0 24.2k | CountLineComment float64 0 16.5k | CountStmt float64 1 9.71k | CountStmtDecl float64 1 8.15k | CountStmtExe float64 0 9.69k | MaxCyclomatic float64 0 759 | MaxInheritanceTree float64 0 16 | MaxNesting float64 0 34 | SumCyclomatic float64 0 2.9k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
23,600 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/retry.py | redis.asyncio.retry.Retry | from asyncio import sleep
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Tuple, Type, TypeVar
from redis.exceptions import ConnectionError, RedisError, TimeoutError
from redis.retry import AbstractRetry
class Retry(AbstractRetry[RedisError]):
__hash__ = AbstractRetry.__hash__
def __init__(self, b... |
class Retry(AbstractRetry[RedisError]):
def __init__(self, backoff: 'AbstractBackoff', retries: int, supported_errors: Tuple[Type[RedisError], ...]=(ConnectionError, TimeoutError)):
pass
def __eq__(self, other: Any) -> bool:
pass
async def call_with_retry(self, do: Callable[[], Awaitable... | 4 | 1 | 16 | 0 | 11 | 5 | 2 | 0.5 | 0 | 8 | 1 | 0 | 3 | 3 | 3 | 3 | 55 | 4 | 34 | 21 | 20 | 17 | 22 | 10 | 18 | 5 | 0 | 3 | 7 |
23,601 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/sentinel.py | redis.asyncio.sentinel.Sentinel | import asyncio
from typing import AsyncIterator, Iterable, Mapping, Optional, Sequence, Tuple, Type
from redis.asyncio.client import Redis
from redis.commands import AsyncSentinelCommands
from redis.asyncio.connection import Connection, ConnectionPool, EncodableT, SSLConnection
import random
from redis.exceptions impor... |
class Sentinel(AsyncSentinelCommands):
'''
Redis Sentinel cluster client
>>> from redis.sentinel import Sentinel
>>> sentinel = Sentinel([('localhost', 26379)], socket_timeout=0.1)
>>> master = sentinel.master_for('mymaster', socket_timeout=0.1)
>>> await master.set('foo', 'bar')
>>> slave ... | 10 | 7 | 20 | 2 | 12 | 5 | 3 | 0.63 | 1 | 11 | 4 | 0 | 9 | 4 | 9 | 23 | 213 | 29 | 113 | 54 | 81 | 71 | 73 | 31 | 63 | 5 | 2 | 2 | 24 |
23,602 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/sentinel.py | redis.asyncio.sentinel.SentinelConnectionPool | import random
from typing import AsyncIterator, Iterable, Mapping, Optional, Sequence, Tuple, Type
import weakref
from redis.asyncio.connection import Connection, ConnectionPool, EncodableT, SSLConnection
class SentinelConnectionPool(ConnectionPool):
"""
Sentinel backed connection pool.
If ``check_connect... |
class SentinelConnectionPool(ConnectionPool):
'''
Sentinel backed connection pool.
If ``check_connection`` flag is set to True, SentinelManagedConnection
sends a PING command right after establishing the connection.
'''
def __init__(self, service_name, sentinel_manager, **kwargs):
pass... | 7 | 2 | 9 | 0 | 9 | 1 | 2 | 0.17 | 1 | 7 | 5 | 0 | 6 | 6 | 6 | 22 | 69 | 7 | 53 | 18 | 46 | 9 | 41 | 18 | 34 | 5 | 1 | 2 | 13 |
23,603 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/sentinel.py | redis.asyncio.sentinel.SentinelManagedConnection | import asyncio
from redis.exceptions import ConnectionError, ReadOnlyError, ResponseError, TimeoutError
from typing import AsyncIterator, Iterable, Mapping, Optional, Sequence, Tuple, Type
from redis.asyncio.connection import Connection, ConnectionPool, EncodableT, SSLConnection
class SentinelManagedConnection(Connect... |
class SentinelManagedConnection(Connection):
def __init__(self, **kwargs):
pass
def __repr__(self):
pass
async def connect_to(self, address):
pass
async def _connect_retry(self):
pass
async def connect_to(self, address):
pass
async def read_response... | 7 | 0 | 10 | 0 | 9 | 1 | 3 | 0.13 | 1 | 6 | 2 | 1 | 6 | 3 | 6 | 41 | 64 | 5 | 54 | 19 | 40 | 7 | 38 | 12 | 31 | 5 | 2 | 3 | 15 |
23,604 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/sentinel.py | redis.asyncio.sentinel.SentinelManagedSSLConnection | from redis.asyncio.connection import Connection, ConnectionPool, EncodableT, SSLConnection
class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection):
pass |
class SentinelManagedSSLConnection(SentinelManagedConnection, SSLConnection):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
23,605 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/utils.py | redis.asyncio.utils.pipeline | class pipeline:
def __init__(self, redis_obj: 'Redis'):
self.p: 'Pipeline' = redis_obj.pipeline()
async def __aenter__(self) -> 'Pipeline':
return self.p
async def __aexit__(self, exc_type, exc_value, traceback):
await self.p.execute()
del self.p | class pipeline:
def __init__(self, redis_obj: 'Redis'):
pass
async def __aenter__(self) -> 'Pipeline':
pass
async def __aexit__(self, exc_type, exc_value, traceback):
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | 3 | 3 | 10 | 2 | 8 | 5 | 4 | 0 | 8 | 5 | 4 | 1 | 0 | 0 | 3 |
23,606 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/err.py | redis.auth.err.InvalidTokenSchemaErr | from typing import Iterable
class InvalidTokenSchemaErr(Exception):
"""
Represents an exception related to invalid token schema.
"""
def __init__(self, missing_fields: Iterable[str]=[]):
super().__init__('Unexpected token schema. Following fields are missing: ' + ', '.join(missing_fields)) |
class InvalidTokenSchemaErr(Exception):
'''
Represents an exception related to invalid token schema.
'''
def __init__(self, missing_fields: Iterable[str]=[]):
pass | 2 | 1 | 5 | 0 | 5 | 0 | 1 | 0.5 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 10 | 1 | 6 | 2 | 4 | 3 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
23,607 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/err.py | redis.auth.err.RequestTokenErr | class RequestTokenErr(Exception):
"""
Represents an exception during token request.
"""
def __init__(self, *args):
super().__init__(*args) | class RequestTokenErr(Exception):
'''
Represents an exception during token request.
'''
def __init__(self, *args):
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 11 | 7 | 1 | 3 | 2 | 1 | 3 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
23,608 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/err.py | redis.auth.err.TokenRenewalErr | class TokenRenewalErr(Exception):
"""
Represents an exception during token renewal process.
"""
def __init__(self, *args):
super().__init__(*args) | class TokenRenewalErr(Exception):
'''
Represents an exception during token renewal process.
'''
def __init__(self, *args):
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 11 | 7 | 1 | 3 | 2 | 1 | 3 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
23,609 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/idp.py | redis.auth.idp.IdentityProviderConfigInterface | from abc import ABC, abstractmethod
class IdentityProviderConfigInterface(ABC):
"""
Configuration class that provides a configured identity provider.
"""
@abstractmethod
def get_provider(self) -> IdentityProviderInterface:
pass |
class IdentityProviderConfigInterface(ABC):
'''
Configuration class that provides a configured identity provider.
'''
@abstractmethod
def get_provider(self) -> IdentityProviderInterface:
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 0.75 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 21 | 8 | 1 | 4 | 3 | 1 | 3 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
23,610 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/idp.py | redis.auth.idp.IdentityProviderInterface | from abc import ABC, abstractmethod
from redis.auth.token import TokenInterface
class IdentityProviderInterface(ABC):
"""
Receive a token from the identity provider.
Receiving a token only works when being authenticated.
"""
@abstractmethod
def request_token(self, force_refresh=False) -> Token... |
class IdentityProviderInterface(ABC):
'''
Receive a token from the identity provider.
Receiving a token only works when being authenticated.
'''
@abstractmethod
def request_token(self, force_refresh=False) -> TokenInterface:
pass | 3 | 1 | 2 | 0 | 2 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 0 | 1 | 21 | 9 | 1 | 4 | 3 | 1 | 4 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
23,611 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token.py | redis.auth.token.JWToken | from datetime import datetime, timezone
from redis.auth.err import InvalidTokenSchemaErr
class JWToken(TokenInterface):
REQUIRED_FIELDS = {'exp'}
def __init__(self, token: str):
try:
import jwt
except ImportError as ie:
raise ImportError(f'The PyJWT library is required ... |
class JWToken(TokenInterface):
def __init__(self, token: str):
pass
def is_expired(self) -> bool:
pass
def ttl(self) -> float:
pass
def try_get(self, key: str) -> str:
pass
def get_value(self) -> str:
pass
def get_expires_at_ms(self) -> float:
... | 9 | 0 | 5 | 0 | 4 | 0 | 1 | 0 | 1 | 6 | 1 | 0 | 8 | 2 | 8 | 34 | 48 | 12 | 36 | 15 | 27 | 0 | 28 | 15 | 19 | 2 | 5 | 1 | 11 |
23,612 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token.py | redis.auth.token.SimpleToken | from datetime import datetime, timezone
class SimpleToken(TokenInterface):
def __init__(self, value: str, expires_at_ms: float, received_at_ms: float, claims: dict) -> None:
self.value = value
self.expires_at = expires_at_ms
self.received_at = received_at_ms
self.claims = claims
... |
class SimpleToken(TokenInterface):
def __init__(self, value: str, expires_at_ms: float, received_at_ms: float, claims: dict) -> None:
pass
def ttl(self) -> float:
pass
def is_expired(self) -> bool:
pass
def try_get(self, key: str) -> str:
pass
def get_value(self... | 8 | 0 | 4 | 0 | 3 | 0 | 1 | 0 | 1 | 6 | 0 | 0 | 7 | 4 | 7 | 33 | 32 | 8 | 24 | 14 | 14 | 0 | 22 | 12 | 14 | 2 | 5 | 1 | 9 |
23,613 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token.py | redis.auth.token.TokenInterface | from abc import ABC, abstractmethod
class TokenInterface(ABC):
@abstractmethod
def is_expired(self) -> bool:
pass
@abstractmethod
def ttl(self) -> float:
pass
@abstractmethod
def try_get(self, key: str) -> str:
pass
@abstractmethod
def get_value(self) -> str:... |
class TokenInterface(ABC):
@abstractmethod
def is_expired(self) -> bool:
pass
@abstractmethod
def ttl(self) -> float:
pass
@abstractmethod
def try_get(self, key: str) -> str:
pass
@abstractmethod
def get_value(self) -> str:
pass
@abstractmethod
d... | 13 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 3 | 0 | 2 | 6 | 0 | 6 | 26 | 24 | 5 | 19 | 13 | 6 | 0 | 13 | 7 | 6 | 1 | 4 | 0 | 6 |
23,614 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token.py | redis.auth.token.TokenResponse | class TokenResponse:
def __init__(self, token: TokenInterface):
self._token = token
def get_token(self) -> TokenInterface:
return self._token
def get_ttl_ms(self) -> float:
return self._token.get_expires_at_ms() - self._token.get_received_at_ms() | class TokenResponse:
def __init__(self, token: TokenInterface):
pass
def get_token(self) -> TokenInterface:
pass
def get_ttl_ms(self) -> float:
pass | 4 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 0 | 2 | 1 | 0 | 3 | 1 | 3 | 3 | 9 | 2 | 7 | 5 | 3 | 0 | 7 | 5 | 3 | 1 | 0 | 0 | 3 |
23,615 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token_manager.py | redis.auth.token_manager.CredentialsListener | from typing import Any, Awaitable, Callable, Union
class CredentialsListener:
"""
Listeners that will be notified on events related to credentials.
Accepts callbacks and awaitable callbacks.
"""
def __init__(self):
self._on_next = None
self._on_error = None
@property
def o... |
class CredentialsListener:
'''
Listeners that will be notified on events related to credentials.
Accepts callbacks and awaitable callbacks.
'''
def __init__(self):
pass
@property
def on_next(self) -> Union[Callable[[Any], None], Awaitable]:
pass
@on_next.setter
def ... | 10 | 1 | 2 | 0 | 2 | 0 | 1 | 0.25 | 0 | 2 | 0 | 0 | 5 | 2 | 5 | 5 | 25 | 5 | 16 | 12 | 6 | 4 | 12 | 8 | 6 | 1 | 0 | 0 | 5 |
23,616 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token_manager.py | redis.auth.token_manager.RetryPolicy | class RetryPolicy:
def __init__(self, max_attempts: int, delay_in_ms: float):
self.max_attempts = max_attempts
self.delay_in_ms = delay_in_ms
def get_max_attempts(self) -> int:
"""
Retry attempts before exception will be thrown.
:return: int
"""
return ... | class RetryPolicy:
def __init__(self, max_attempts: int, delay_in_ms: float):
pass
def get_max_attempts(self) -> int:
'''
Retry attempts before exception will be thrown.
:return: int
'''
pass
def get_delay_in_ms(self) -> float:
'''
Delay bet... | 4 | 2 | 6 | 1 | 2 | 3 | 1 | 1 | 0 | 2 | 0 | 0 | 3 | 2 | 3 | 3 | 20 | 4 | 8 | 6 | 4 | 8 | 8 | 6 | 4 | 1 | 0 | 0 | 3 |
23,617 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token_manager.py | redis.auth.token_manager.TokenManager | from redis.auth.err import RequestTokenErr, TokenRenewalErr
from datetime import datetime, timezone
import asyncio
import threading
from redis.auth.token import TokenResponse
from time import sleep
from typing import Any, Awaitable, Callable, Union
from redis.auth.idp import IdentityProviderInterface
class TokenManage... |
class TokenManager:
def __init__(self, identity_provider: IdentityProviderInterface, config: TokenManagerConfig):
pass
def __del__(self):
pass
def start(self, listener: CredentialsListener, skip_initial: bool=False) -> Callable[[], None]:
pass
async def start_async(self, lis... | 13 | 2 | 17 | 2 | 14 | 1 | 3 | 0.07 | 0 | 13 | 6 | 0 | 12 | 6 | 12 | 12 | 220 | 36 | 172 | 59 | 143 | 12 | 124 | 39 | 111 | 9 | 0 | 3 | 37 |
23,618 | andymccurdy/redis-py | andymccurdy_redis-py/redis/auth/token_manager.py | redis.auth.token_manager.TokenManagerConfig | class TokenManagerConfig:
def __init__(self, expiration_refresh_ratio: float, lower_refresh_bound_millis: int, token_request_execution_timeout_in_ms: int, retry_policy: RetryPolicy):
self._expiration_refresh_ratio = expiration_refresh_ratio
self._lower_refresh_bound_millis = lower_refresh_bound_mil... | class TokenManagerConfig:
def __init__(self, expiration_refresh_ratio: float, lower_refresh_bound_millis: int, token_request_execution_timeout_in_ms: int, retry_policy: RetryPolicy):
pass
def get_expiration_refresh_ratio(self) -> float:
'''
Represents the ratio of a token's lifetime at... | 6 | 4 | 10 | 1 | 4 | 5 | 1 | 1.09 | 0 | 3 | 1 | 0 | 5 | 4 | 5 | 5 | 55 | 9 | 22 | 16 | 10 | 24 | 14 | 10 | 8 | 1 | 0 | 0 | 5 |
23,619 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.AbstractBackoff | from abc import ABC, abstractmethod
class AbstractBackoff(ABC):
"""Backoff interface"""
def reset(self):
"""
Reset internal state before an operation.
`reset` is called once at the beginning of
every call to `Retry.call_with_retry`
"""
pass
@abstractmethod
... |
class AbstractBackoff(ABC):
'''Backoff interface'''
def reset(self):
'''
Reset internal state before an operation.
`reset` is called once at the beginning of
every call to `Retry.call_with_retry`
'''
pass
@abstractmethod
def compute(self, failures: int) ... | 4 | 3 | 5 | 0 | 2 | 3 | 1 | 1.17 | 1 | 2 | 0 | 7 | 2 | 0 | 2 | 22 | 15 | 2 | 6 | 4 | 2 | 7 | 5 | 3 | 2 | 1 | 4 | 0 | 2 |
23,620 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.ConstantBackoff | class ConstantBackoff(AbstractBackoff):
"""Constant backoff upon failure"""
def __init__(self, backoff: float) -> None:
"""`backoff`: backoff time in seconds"""
self._backoff = backoff
def __hash__(self) -> int:
return hash((self._backoff,))
def __eq__(self, other) -> bool:
... | class ConstantBackoff(AbstractBackoff):
'''Constant backoff upon failure'''
def __init__(self, backoff: float) -> None:
'''`backoff`: backoff time in seconds'''
pass
def __hash__(self) -> int:
pass
def __eq__(self, other) -> bool:
pass
def compute(self, failures: ... | 5 | 2 | 3 | 0 | 2 | 1 | 1 | 0.4 | 1 | 2 | 0 | 1 | 2 | 1 | 2 | 24 | 9 | 2 | 5 | 4 | 2 | 2 | 5 | 4 | 2 | 1 | 5 | 0 | 2 |
23,621 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.DecorrelatedJitterBackoff | import random
class DecorrelatedJitterBackoff(AbstractBackoff):
"""Decorrelated jitter backoff upon failure"""
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE) -> None:
"""
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
"""
... |
class DecorrelatedJitterBackoff(AbstractBackoff):
'''Decorrelated jitter backoff upon failure'''
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE) -> None:
'''
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
'''
pass
d... | 6 | 2 | 5 | 0 | 4 | 1 | 1 | 0.42 | 1 | 2 | 0 | 0 | 3 | 3 | 3 | 25 | 20 | 3 | 12 | 9 | 8 | 5 | 12 | 9 | 8 | 1 | 5 | 0 | 3 |
23,622 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.EqualJitterBackoff | import random
class EqualJitterBackoff(AbstractBackoff):
"""Equal jitter backoff upon failure"""
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE) -> None:
"""
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
"""
self._cap =... |
class EqualJitterBackoff(AbstractBackoff):
'''Equal jitter backoff upon failure'''
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE) -> None:
'''
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
'''
pass
def __hash__(se... | 5 | 2 | 5 | 0 | 3 | 2 | 1 | 0.71 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 24 | 14 | 2 | 7 | 6 | 4 | 5 | 7 | 6 | 4 | 1 | 5 | 0 | 2 |
23,623 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.ExponentialBackoff | class ExponentialBackoff(AbstractBackoff):
"""Exponential backoff upon failure"""
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE):
"""
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
"""
self._cap = cap
self._base ... | class ExponentialBackoff(AbstractBackoff):
'''Exponential backoff upon failure'''
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE):
'''
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
'''
pass
def __hash__(self) -> int... | 5 | 2 | 5 | 0 | 3 | 2 | 1 | 0.83 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 24 | 13 | 2 | 6 | 5 | 3 | 5 | 6 | 5 | 3 | 1 | 5 | 0 | 2 |
23,624 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.FullJitterBackoff | import random
class FullJitterBackoff(AbstractBackoff):
"""Full jitter backoff upon failure"""
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE) -> None:
"""
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
"""
self._cap = c... |
class FullJitterBackoff(AbstractBackoff):
'''Full jitter backoff upon failure'''
def __init__(self, cap: float=DEFAULT_CAP, base: float=DEFAULT_BASE) -> None:
'''
`cap`: maximum backoff time in seconds
`base`: base backoff time in seconds
'''
pass
def __hash__(self... | 5 | 2 | 5 | 0 | 3 | 2 | 1 | 0.83 | 1 | 2 | 0 | 0 | 2 | 2 | 2 | 24 | 13 | 2 | 6 | 5 | 3 | 5 | 6 | 5 | 3 | 1 | 5 | 0 | 2 |
23,625 | andymccurdy/redis-py | andymccurdy_redis-py/redis/backoff.py | redis.backoff.NoBackoff | class NoBackoff(ConstantBackoff):
"""No backoff upon failure"""
def __init__(self) -> None:
super().__init__(0) | class NoBackoff(ConstantBackoff):
'''No backoff upon failure'''
def __init__(self) -> None:
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 0.33 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 25 | 5 | 1 | 3 | 2 | 1 | 1 | 3 | 2 | 1 | 1 | 6 | 0 | 1 |
23,626 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheConfig | from typing import Any, List, Optional, Union
class CacheConfig(CacheConfigurationInterface):
DEFAULT_CACHE_CLASS = DefaultCache
DEFAULT_EVICTION_POLICY = EvictionPolicy.LRU
DEFAULT_MAX_SIZE = 10000
DEFAULT_ALLOW_LIST = ['BITCOUNT', 'BITFIELD_RO', 'BITPOS', 'EXISTS', 'GEODIST', 'GEOHASH', 'GEOPOS', 'GE... |
class CacheConfig(CacheConfigurationInterface):
def __init__(self, max_size: int=DEFAULT_MAX_SIZE, cache_class: Any=DEFAULT_CACHE_CLASS, eviction_policy: EvictionPolicy=DEFAULT_EVICTION_POLICY):
pass
def get_cache_class(self):
pass
def get_max_size(self) -> int:
pass
def get... | 7 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 5 | 1 | 0 | 6 | 3 | 6 | 31 | 106 | 7 | 99 | 19 | 87 | 0 | 19 | 14 | 12 | 1 | 5 | 0 | 6 |
23,627 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheConfigurationInterface | from abc import ABC, abstractmethod
class CacheConfigurationInterface(ABC):
@abstractmethod
def get_cache_class(self):
pass
@abstractmethod
def get_max_size(self) -> int:
pass
@abstractmethod
def get_eviction_policy(self):
pass
@abstractmethod
def is_exceeds_... |
class CacheConfigurationInterface(ABC):
@abstractmethod
def get_cache_class(self):
pass
@abstractmethod
def get_max_size(self) -> int:
pass
@abstractmethod
def get_eviction_policy(self):
pass
@abstractmethod
def is_exceeds_max_size(self, count: int) -> bool:
... | 11 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 3 | 0 | 1 | 5 | 0 | 5 | 25 | 20 | 4 | 16 | 11 | 5 | 0 | 11 | 6 | 5 | 1 | 4 | 0 | 5 |
23,628 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheEntry | class CacheEntry:
def __init__(self, cache_key: CacheKey, cache_value: bytes, status: CacheEntryStatus, connection_ref):
self.cache_key = cache_key
self.cache_value = cache_value
self.status = status
self.connection_ref = connection_ref
def __hash__(self):
return hash((... | class CacheEntry:
def __init__(self, cache_key: CacheKey, cache_value: bytes, status: CacheEntryStatus, connection_ref):
pass
def __hash__(self):
pass
def __eq__(self, other):
pass | 4 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 3 | 2 | 0 | 3 | 4 | 3 | 3 | 20 | 2 | 18 | 14 | 8 | 0 | 10 | 8 | 6 | 1 | 0 | 0 | 3 |
23,629 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheEntryStatus | from enum import Enum
class CacheEntryStatus(Enum):
VALID = 'VALID'
IN_PROGRESS = 'IN_PROGRESS' |
class CacheEntryStatus(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
23,630 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheFactory | from typing import Any, List, Optional, Union
class CacheFactory(CacheFactoryInterface):
def __init__(self, cache_config: Optional[CacheConfig]=None):
self._config = cache_config
if self._config is None:
self._config = CacheConfig()
def get_cache(self) -> CacheInterface:
c... |
class CacheFactory(CacheFactoryInterface):
def __init__(self, cache_config: Optional[CacheConfig]=None):
pass
def get_cache(self) -> CacheInterface:
pass | 3 | 0 | 4 | 1 | 4 | 0 | 2 | 0 | 1 | 2 | 2 | 0 | 2 | 1 | 2 | 23 | 10 | 2 | 8 | 5 | 5 | 0 | 8 | 5 | 5 | 2 | 5 | 1 | 3 |
23,631 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheFactoryInterface | from abc import ABC, abstractmethod
class CacheFactoryInterface(ABC):
@abstractmethod
def get_cache(self) -> CacheInterface:
pass |
class CacheFactoryInterface(ABC):
@abstractmethod
def get_cache(self) -> CacheInterface:
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 21 | 4 | 0 | 4 | 3 | 1 | 0 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
23,632 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheInterface | from typing import Any, List, Optional, Union
from collections import OrderedDict
from abc import ABC, abstractmethod
class CacheInterface(ABC):
@property
@abstractmethod
def collection(self) -> OrderedDict:
pass
@property
@abstractmethod
def config(self) -> CacheConfigurationInterfac... |
class CacheInterface(ABC):
@property
@abstractmethod
def collection(self) -> OrderedDict:
pass
@property
@abstractmethod
def config(self) -> CacheConfigurationInterface:
pass
@property
@abstractmethod
def eviction_policy(self) -> EvictionPolicyInterface:
pas... | 25 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 8 | 4 | 1 | 10 | 0 | 10 | 30 | 44 | 9 | 35 | 21 | 10 | 0 | 21 | 11 | 10 | 1 | 4 | 0 | 10 |
23,633 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.CacheKey | from dataclasses import dataclass
@dataclass(frozen=True)
class CacheKey:
command: str
redis_keys: tuple | @dataclass(frozen=True)
class CacheKey:
pass | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 3 | 1 | 2 | 0 | 3 | 1 | 2 | 0 | 0 | 0 | 0 |
23,634 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.DefaultCache | from collections import OrderedDict
from typing import Any, List, Optional, Union
class DefaultCache(CacheInterface):
def __init__(self, cache_config: CacheConfigurationInterface) -> None:
self._cache = OrderedDict()
self._cache_config = cache_config
self._eviction_policy = self._cache_con... |
class DefaultCache(CacheInterface):
def __init__(self, cache_config: CacheConfigurationInterface) -> None:
pass
@property
def collection(self) -> OrderedDict:
pass
@property
def config(self) -> CacheConfigurationInterface:
pass
@property
def eviction_policy(self) ->... | 16 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 8 | 4 | 0 | 11 | 3 | 11 | 41 | 83 | 20 | 63 | 31 | 44 | 0 | 55 | 24 | 43 | 6 | 5 | 3 | 21 |
23,635 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.EvictionPolicy | from enum import Enum
class EvictionPolicy(Enum):
LRU = LRUPolicy |
class EvictionPolicy(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 4 | 0 | 0 |
23,636 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.EvictionPolicyInterface | from typing import Any, List, Optional, Union
from abc import ABC, abstractmethod
class EvictionPolicyInterface(ABC):
@property
@abstractmethod
def cache(self):
pass
@cache.setter
@abstractmethod
def cache(self, value):
pass
@property
@abstractmethod
def type(self... |
class EvictionPolicyInterface(ABC):
@property
@abstractmethod
def cache(self):
pass
@cache.setter
@abstractmethod
def cache(self):
pass
@property
@abstractmethod
def type(self) -> EvictionPolicyType:
pass
@abstractmethod
def evict_next(self) -> Cache... | 16 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 3 | 2 | 1 | 6 | 0 | 6 | 26 | 26 | 5 | 21 | 13 | 6 | 0 | 13 | 7 | 6 | 1 | 4 | 0 | 6 |
23,637 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.EvictionPolicyType | from enum import Enum
class EvictionPolicyType(Enum):
time_based = 'time_based'
frequency_based = 'frequency_based' |
class EvictionPolicyType(Enum):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 3 | 0 | 3 | 3 | 2 | 0 | 3 | 3 | 2 | 0 | 4 | 0 | 0 |
23,638 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cache.py | redis.cache.LRUPolicy | from typing import Any, List, Optional, Union
class LRUPolicy(EvictionPolicyInterface):
def __init__(self):
self.cache = None
@property
def cache(self):
return self._cache
@cache.setter
def cache(self, cache: CacheInterface):
self._cache = cache
@property
def typ... |
class LRUPolicy(EvictionPolicyInterface):
def __init__(self):
pass
@property
def cache(self):
pass
@cache.setter
def cache(self):
pass
@property
def type(self) -> EvictionPolicyType:
pass
def evict_next(self) -> CacheKey:
pass
def evict_man... | 12 | 0 | 4 | 1 | 4 | 0 | 2 | 0 | 1 | 6 | 3 | 0 | 8 | 1 | 8 | 34 | 45 | 12 | 33 | 17 | 21 | 0 | 30 | 14 | 21 | 3 | 5 | 1 | 12 |
23,639 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.AbstractRedis | class AbstractRedis:
pass | class AbstractRedis:
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 0 | 0 | 0 |
23,640 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.CaseInsensitiveDict | from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Set, Type, Union
class CaseInsensitiveDict(dict):
"""Case insensitive dict implementation. Assumes string keys only."""
def __init__(self, data: Dict[str, str]) -> None:
for k, v in data.items():
self[k.upper()... |
class CaseInsensitiveDict(dict):
'''Case insensitive dict implementation. Assumes string keys only.'''
def __init__(self, data: Dict[str, str]) -> None:
pass
def __contains__(self, k):
pass
def __delitem__(self, k):
pass
def __getitem__(self, k):
pass
def ge... | 8 | 1 | 2 | 0 | 2 | 0 | 1 | 0.06 | 1 | 2 | 0 | 0 | 7 | 0 | 7 | 34 | 25 | 7 | 17 | 9 | 9 | 1 | 17 | 9 | 9 | 2 | 2 | 1 | 8 |
23,641 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.Monitor | import re
from redis.exceptions import ConnectionError, ExecAbortError, PubSubError, RedisError, ResponseError, WatchError
from redis._parsers.helpers import _RedisCallbacks, _RedisCallbacksRESP2, _RedisCallbacksRESP3, bool_ok
class Monitor:
"""
Monitor is useful for handling the MONITOR command to the redis s... |
class Monitor:
'''
Monitor is useful for handling the MONITOR command to the redis server.
next_command() method returns one command from monitor
listen() method yields commands from monitor.
'''
def __init__(self, connection_pool):
pass
def __enter__(self):
pass
def ... | 7 | 3 | 10 | 0 | 9 | 1 | 2 | 0.26 | 0 | 4 | 1 | 0 | 5 | 2 | 5 | 5 | 65 | 7 | 46 | 18 | 40 | 12 | 37 | 18 | 31 | 4 | 0 | 1 | 10 |
23,642 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.Pipeline | from redis.connection import AbstractConnection, Connection, ConnectionPool, SSLConnection, UnixDomainSocketConnection
from itertools import chain
from redis.exceptions import ConnectionError, ExecAbortError, PubSubError, RedisError, ResponseError, WatchError
from redis.commands.core import Script
from typing import TY... |
class Pipeline(Redis):
'''
Pipelines provide a way to transmit multiple commands to the Redis server
in one transmission. This is convenient for batch processing, such as
saving all the values in a list to Redis.
All commands executed within a pipeline(when running in transactional mode,
which... | 25 | 12 | 13 | 1 | 9 | 3 | 3 | 0.42 | 1 | 17 | 5 | 0 | 24 | 9 | 24 | 430 | 346 | 45 | 212 | 67 | 183 | 90 | 177 | 60 | 152 | 14 | 10 | 3 | 64 |
23,643 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.PubSub | from redis.commands import CoreCommands, RedisModuleCommands, SentinelCommands, list_or_args
from redis.event import AfterPooledConnectionsInstantiationEvent, AfterPubSubConnectionInstantiationEvent, AfterSingleConnectionInstantiationEvent, ClientType, EventDispatcher
import threading
from redis.exceptions import Conne... |
class PubSub:
'''
PubSub provides publish, subscribe and listen support to Redis channels.
After subscribing to one or more channels, the listen() method will block
until a message arrives on one of the subscribed channels. That message
will be returned and it's safe to start listening again.
'... | 30 | 20 | 17 | 0 | 12 | 4 | 3 | 0.38 | 0 | 15 | 5 | 1 | 27 | 18 | 27 | 27 | 503 | 43 | 335 | 104 | 290 | 127 | 254 | 88 | 225 | 19 | 0 | 3 | 89 |
23,644 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.PubSubWorkerThread | import threading
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Mapping, Optional, Set, Type, Union
class PubSubWorkerThread(threading.Thread):
def __init__(self, pubsub, sleep_time: float, daemon: bool=False, exception_handler: Union[Callable[[Exception, 'PubSub', 'PubSubWorkerThread'], None], None... |
class PubSubWorkerThread(threading.Thread):
def __init__(self, pubsub, sleep_time: float, daemon: bool=False, exception_handler: Union[Callable[[Exception, 'PubSub', 'PubSubWorkerThread'], None], None]=None):
pass
def run(self) -> None:
pass
def stop(self) -> None:
pass | 4 | 0 | 11 | 0 | 10 | 1 | 2 | 0.09 | 1 | 6 | 0 | 0 | 3 | 5 | 3 | 28 | 37 | 2 | 32 | 20 | 20 | 3 | 24 | 11 | 20 | 5 | 1 | 3 | 7 |
23,645 | andymccurdy/redis-py | andymccurdy_redis-py/redis/client.py | redis.client.Redis | from redis.event import AfterPooledConnectionsInstantiationEvent, AfterPubSubConnectionInstantiationEvent, AfterSingleConnectionInstantiationEvent, ClientType, EventDispatcher
from redis.exceptions import ConnectionError, ExecAbortError, PubSubError, RedisError, ResponseError, WatchError
import time
from redis.maintena... | null | 30 | 16 | 19 | 1 | 12 | 5 | 2 | 0.47 | 3 | 26 | 18 | 1 | 24 | 7 | 26 | 406 | 544 | 67 | 324 | 114 | 233 | 153 | 149 | 49 | 122 | 13 | 9 | 4 | 56 |
23,646 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.AbstractRedisCluster | from redis.exceptions import AskError, AuthenticationError, ClusterDownError, ClusterError, ConnectionError, CrossSlotTransactionError, DataError, ExecAbortError, InvalidPipelineStack, MaxConnectionsError, MovedError, RedisClusterException, RedisError, ResponseError, SlotNotCoveredError, TimeoutError, TryAgainError, Wa... |
class AbstractRedisCluster:
def replace_default_node(self, target_node: 'ClusterNode'=None) -> None:
'''Replace the default cluster node.
A random cluster node will be chosen if target_node isn't passed, and primaries
will be prioritized. The default node will not be changed if there are n... | 2 | 1 | 23 | 1 | 12 | 10 | 4 | 0.04 | 0 | 3 | 0 | 3 | 1 | 0 | 1 | 1 | 242 | 9 | 223 | 17 | 221 | 10 | 23 | 17 | 21 | 4 | 0 | 3 | 4 |
23,647 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.ClusterNode | import socket
class ClusterNode:
def __init__(self, host, port, server_type=None, redis_connection=None):
if host == 'localhost':
host = socket.gethostbyname(host)
self.host = host
self.port = port
self.name = get_node_name(host, port)
self.server_type = server_... |
class ClusterNode:
def __init__(self, host, port, server_type=None, redis_connection=None):
pass
def __repr__(self):
pass
def __eq__(self, obj):
pass
def __del__(self):
pass | 5 | 0 | 6 | 0 | 5 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 4 | 5 | 4 | 4 | 26 | 4 | 22 | 10 | 17 | 0 | 16 | 10 | 11 | 2 | 0 | 1 | 6 |
23,648 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.ClusterPipeline | import threading
from redis.exceptions import AskError, AuthenticationError, ClusterDownError, ClusterError, ConnectionError, CrossSlotTransactionError, DataError, ExecAbortError, InvalidPipelineStack, MaxConnectionsError, MovedError, RedisClusterException, RedisError, ResponseError, SlotNotCoveredError, TimeoutError, ... |
class ClusterPipeline(RedisCluster):
'''
Support for Redis pipeline
in cluster mode
'''
@deprecated_args(args_to_warn=['cluster_error_retry_attempts'], reason="Please configure the 'retry' object instead", version='6.0.0')
def __init__(self, nodes_manager: 'NodesManager', commands_parser: 'Comm... | 25 | 18 | 14 | 1 | 8 | 5 | 2 | 0.67 | 1 | 14 | 5 | 0 | 27 | 17 | 27 | 475 | 433 | 47 | 232 | 83 | 188 | 155 | 162 | 65 | 134 | 22 | 11 | 5 | 60 |
23,649 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.ClusterPubSub | from redis.commands.helpers import list_or_args
from redis.utils import deprecated_args, dict_merge, list_keys_to_dict, merge_result, safe_str, str_if_bytes, truncate_text
from redis.client import EMPTY_RESPONSE, CaseInsensitiveDict, PubSub, Redis
from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Unio... |
class ClusterPubSub(PubSub):
'''
Wrapper for PubSub class.
IMPORTANT: before using ClusterPubSub, read about the known limitations
with pubsub in Cluster mode and learn how to workaround them:
https://redis-py-cluster.readthedocs.io/en/stable/pubsub.html
'''
def __init__(self, redis_cluste... | 14 | 8 | 17 | 0 | 12 | 4 | 3 | 0.39 | 1 | 9 | 5 | 0 | 13 | 7 | 13 | 40 | 242 | 19 | 160 | 53 | 135 | 63 | 112 | 42 | 98 | 8 | 1 | 3 | 43 |
23,650 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.LoadBalancer | import random
class LoadBalancer:
"""
Round-Robin Load Balancing
"""
def __init__(self, start_index: int=0) -> None:
self.primary_to_idx = {}
self.start_index = start_index
def get_server_index(self, primary: str, list_size: int, load_balancing_strategy: LoadBalancingStrategy=Load... |
class LoadBalancer:
'''
Round-Robin Load Balancing
'''
def __init__(self, start_index: int=0) -> None:
pass
def get_server_index(self, primary: str, list_size: int, load_balancing_strategy: LoadBalancingStrategy=LoadBalancingStrategy.ROUND_ROBIN) -> int:
pass
def reset(self) ... | 6 | 1 | 3 | 0 | 3 | 0 | 1 | 0.4 | 0 | 2 | 0 | 0 | 3 | 2 | 3 | 3 | 17 | 3 | 10 | 7 | 6 | 4 | 10 | 7 | 6 | 1 | 0 | 0 | 3 |
23,651 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.NodeCommands | from redis.exceptions import AskError, AuthenticationError, ClusterDownError, ClusterError, ConnectionError, CrossSlotTransactionError, DataError, ExecAbortError, InvalidPipelineStack, MaxConnectionsError, MovedError, RedisClusterException, RedisError, ResponseError, SlotNotCoveredError, TimeoutError, TryAgainError, Wa... |
class NodeCommands:
''' '''
def __init__(self, parse_response, connection_pool, connection):
''' '''
pass
def append(self, c):
''' '''
pass
def write(self):
'''
Code borrowed from Redis so it can be fixed
'''
pass
def read(self):
... | 5 | 5 | 15 | 1 | 8 | 7 | 3 | 0.91 | 0 | 3 | 1 | 0 | 4 | 4 | 4 | 4 | 67 | 6 | 32 | 16 | 27 | 29 | 30 | 14 | 25 | 6 | 0 | 4 | 12 |
23,652 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.NodesManager | from redis.event import AfterPooledConnectionsInstantiationEvent, AfterPubSubConnectionInstantiationEvent, ClientType, EventDispatcher
from redis.exceptions import AskError, AuthenticationError, ClusterDownError, ClusterError, ConnectionError, CrossSlotTransactionError, DataError, ExecAbortError, InvalidPipelineStack, ... |
class NodesManager:
def __init__(self, startup_nodes, from_url=False, require_full_coverage=False, lock=None, dynamic_startup_nodes=True, connection_pool_class=ConnectionPool, address_remap: Optional[Callable[[Tuple[str, int]], Tuple[str, int]]]=None, cache: Optional[CacheInterface]=None, cache_config: Optional[C... | 18 | 8 | 24 | 1 | 17 | 6 | 4 | 0.33 | 0 | 20 | 14 | 0 | 15 | 18 | 15 | 15 | 377 | 32 | 260 | 83 | 230 | 85 | 185 | 68 | 169 | 19 | 0 | 6 | 60 |
23,653 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.PipelineCommand | class PipelineCommand:
""" """
def __init__(self, args, options=None, position=None):
self.args = args
if options is None:
options = {}
self.options = options
self.position = position
self.result = None
self.node = None
self.asking = False | class PipelineCommand:
''' '''
def __init__(self, args, options=None, position=None):
pass | 2 | 1 | 9 | 0 | 9 | 0 | 2 | 0.1 | 0 | 0 | 0 | 0 | 1 | 6 | 1 | 1 | 12 | 1 | 10 | 8 | 8 | 1 | 10 | 8 | 8 | 2 | 0 | 1 | 2 |
23,654 | andymccurdy/redis-py | andymccurdy_redis-py/redis/cluster.py | redis.cluster.RedisCluster | import random
from redis.utils import deprecated_args, dict_merge, list_keys_to_dict, merge_result, safe_str, str_if_bytes, truncate_text
from redis.backoff import ExponentialWithJitterBackoff, NoBackoff
from redis.lock import Lock
from redis.exceptions import AskError, AuthenticationError, ClusterDownError, ClusterErr... | null | 42 | 21 | 21 | 1 | 11 | 8 | 3 | 0.74 | 2 | 32 | 20 | 1 | 37 | 15 | 38 | 448 | 830 | 89 | 427 | 122 | 361 | 314 | 299 | 93 | 260 | 19 | 10 | 4 | 118 |
23,655 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/__init__.py | redis.commands.bf.AbstractBloom | class AbstractBloom:
"""
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
"""
@staticmethod
def appe... | class AbstractBloom:
'''
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
'''
@staticmethod
def append... | 23 | 12 | 4 | 0 | 3 | 1 | 2 | 0.42 | 0 | 1 | 0 | 5 | 0 | 0 | 11 | 11 | 80 | 12 | 48 | 25 | 25 | 20 | 37 | 14 | 25 | 2 | 0 | 1 | 21 |
23,656 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/__init__.py | redis.commands.bf.BFBloom | from ..helpers import get_protocol_version, parse_to_list
from .info import BFInfo, CFInfo, CMSInfo, TDigestInfo, TopKInfo
from redis._parsers.helpers import bool_ok
class BFBloom(BFCommands, AbstractBloom):
def __init__(self, client, **kwargs):
"""Create a new RedisBloom client."""
_MODULE_CALLBA... |
class BFBloom(BFCommands, AbstractBloom):
def __init__(self, client, **kwargs):
'''Create a new RedisBloom client.'''
pass | 2 | 1 | 31 | 4 | 17 | 10 | 3 | 0.56 | 2 | 1 | 1 | 0 | 1 | 3 | 1 | 22 | 32 | 4 | 18 | 9 | 16 | 10 | 13 | 9 | 11 | 3 | 1 | 1 | 3 |
23,657 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/__init__.py | redis.commands.bf.CFBloom | from redis._parsers.helpers import bool_ok
from ..helpers import get_protocol_version, parse_to_list
from .info import BFInfo, CFInfo, CMSInfo, TDigestInfo, TopKInfo
class CFBloom(CFCommands, AbstractBloom):
def __init__(self, client, **kwargs):
"""Create a new RedisBloom client."""
_MODULE_CALLBA... |
class CFBloom(CFCommands, AbstractBloom):
def __init__(self, client, **kwargs):
'''Create a new RedisBloom client.'''
pass | 2 | 1 | 32 | 4 | 17 | 11 | 3 | 0.61 | 2 | 1 | 1 | 0 | 1 | 3 | 1 | 24 | 33 | 4 | 18 | 9 | 16 | 11 | 13 | 9 | 11 | 3 | 1 | 1 | 3 |
23,658 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/__init__.py | redis.commands.bf.CMSBloom | from redis._parsers.helpers import bool_ok
from ..helpers import get_protocol_version, parse_to_list
from .info import BFInfo, CFInfo, CMSInfo, TDigestInfo, TopKInfo
class CMSBloom(CMSCommands, AbstractBloom):
def __init__(self, client, **kwargs):
"""Create a new RedisBloom client."""
_MODULE_CALL... |
class CMSBloom(CMSCommands, AbstractBloom):
def __init__(self, client, **kwargs):
'''Create a new RedisBloom client.'''
pass | 2 | 1 | 27 | 4 | 19 | 4 | 3 | 0.2 | 2 | 1 | 1 | 0 | 1 | 3 | 1 | 18 | 28 | 4 | 20 | 9 | 18 | 4 | 13 | 9 | 11 | 3 | 1 | 1 | 3 |
23,659 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/__init__.py | redis.commands.bf.TDigestBloom | from ..helpers import get_protocol_version, parse_to_list
from redis._parsers.helpers import bool_ok
from .info import BFInfo, CFInfo, CMSInfo, TDigestInfo, TopKInfo
class TDigestBloom(TDigestCommands, AbstractBloom):
def __init__(self, client, **kwargs):
"""Create a new RedisBloom client."""
_MOD... |
class TDigestBloom(TDigestCommands, AbstractBloom):
def __init__(self, client, **kwargs):
'''Create a new RedisBloom client.'''
pass | 2 | 1 | 33 | 4 | 24 | 5 | 3 | 0.2 | 2 | 2 | 1 | 0 | 1 | 3 | 1 | 26 | 34 | 4 | 25 | 9 | 23 | 5 | 13 | 9 | 11 | 3 | 1 | 1 | 3 |
23,660 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/__init__.py | redis.commands.bf.TOPKBloom | from redis._parsers.helpers import bool_ok
from ..helpers import get_protocol_version, parse_to_list
from .info import BFInfo, CFInfo, CMSInfo, TDigestInfo, TopKInfo
class TOPKBloom(TOPKCommands, AbstractBloom):
def __init__(self, client, **kwargs):
"""Create a new RedisBloom client."""
_MODULE_CA... |
class TOPKBloom(TOPKCommands, AbstractBloom):
def __init__(self, client, **kwargs):
'''Create a new RedisBloom client.'''
pass | 2 | 1 | 28 | 4 | 20 | 4 | 3 | 0.19 | 2 | 1 | 1 | 0 | 1 | 3 | 1 | 19 | 29 | 4 | 21 | 9 | 19 | 4 | 13 | 9 | 11 | 3 | 1 | 1 | 3 |
23,661 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/commands.py | redis.commands.bf.commands.BFCommands | from redis.client import NEVER_DECODE
class BFCommands:
"""Bloom Filter commands."""
def create(self, key, errorRate, capacity, expansion=None, noScale=None):
"""
Create a new Bloom Filter `key` with desired probability of false positives
`errorRate` expected entries to be inserted as ... |
class BFCommands:
'''Bloom Filter commands.'''
def create(self, key, errorRate, capacity, expansion=None, noScale=None):
'''
Create a new Bloom Filter `key` with desired probability of false positives
`errorRate` expected entries to be inserted as `capacity`.
Default expansion ... | 11 | 11 | 10 | 0 | 4 | 5 | 1 | 1.2 | 0 | 0 | 0 | 1 | 10 | 0 | 10 | 10 | 112 | 15 | 44 | 25 | 24 | 53 | 35 | 16 | 24 | 1 | 0 | 0 | 10 |
23,662 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/commands.py | redis.commands.bf.commands.CFCommands | class CFCommands:
"""Cuckoo Filter commands."""
def create(self, key, capacity, expansion=None, bucket_size=None, max_iterations=None):
"""
Create a new Cuckoo Filter `key` an initial `capacity` items.
For more information see `CF.RESERVE <https://redis.io/commands/cf.reserve>`_.
... | class CFCommands:
'''Cuckoo Filter commands.'''
def create(self, key, capacity, expansion=None, bucket_size=None, max_iterations=None):
'''
Create a new Cuckoo Filter `key` an initial `capacity` items.
For more information see `CF.RESERVE <https://redis.io/commands/cf.reserve>`_.
... | 13 | 13 | 8 | 0 | 3 | 5 | 1 | 1.55 | 0 | 0 | 0 | 1 | 12 | 0 | 12 | 12 | 117 | 15 | 40 | 19 | 25 | 62 | 38 | 17 | 25 | 1 | 0 | 0 | 12 |
23,663 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/commands.py | redis.commands.bf.commands.CMSCommands | class CMSCommands:
"""Count-Min Sketch Commands"""
def initbydim(self, key, width, depth):
"""
Initialize a Count-Min Sketch `key` to dimensions (`width`, `depth`) specified by user.
For more information see `CMS.INITBYDIM <https://redis.io/commands/cms.initbydim>`_.
"""
... | class CMSCommands:
'''Count-Min Sketch Commands'''
def initbydim(self, key, width, depth):
'''
Initialize a Count-Min Sketch `key` to dimensions (`width`, `depth`) specified by user.
For more information see `CMS.INITBYDIM <https://redis.io/commands/cms.initbydim>`_.
'''
... | 7 | 7 | 8 | 0 | 3 | 5 | 1 | 1.72 | 0 | 0 | 0 | 1 | 6 | 0 | 6 | 6 | 57 | 8 | 18 | 9 | 11 | 31 | 18 | 9 | 11 | 1 | 0 | 0 | 6 |
23,664 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/commands.py | redis.commands.bf.commands.TDigestCommands | class TDigestCommands:
def create(self, key, compression=100):
"""
Allocate the memory and initialize the t-digest.
For more information see `TDIGEST.CREATE <https://redis.io/commands/tdigest.create>`_.
"""
return self.execute_command(TDIGEST_CREATE, key, 'COMPRESSION', comp... | class TDigestCommands:
def create(self, key, compression=100):
'''
Allocate the memory and initialize the t-digest.
For more information see `TDIGEST.CREATE <https://redis.io/commands/tdigest.create>`_.
'''
pass
def reset(self, key):
'''
Reset the sketch... | 15 | 14 | 8 | 0 | 3 | 5 | 1 | 1.83 | 0 | 0 | 0 | 1 | 14 | 0 | 14 | 14 | 121 | 19 | 36 | 16 | 21 | 66 | 34 | 16 | 19 | 3 | 0 | 1 | 16 |
23,665 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/commands.py | redis.commands.bf.commands.TOPKCommands | from redis.utils import deprecated_function
class TOPKCommands:
"""TOP-k Filter commands."""
def reserve(self, key, k, width, depth, decay):
"""
Create a new Top-K Filter `key` with desired probability of false
positives `errorRate` expected entries to be inserted as `size`.
Fo... |
class TOPKCommands:
'''TOP-k Filter commands.'''
def reserve(self, key, k, width, depth, decay):
'''
Create a new Top-K Filter `key` with desired probability of false
positives `errorRate` expected entries to be inserted as `size`.
For more information see `TOPK.RESERVE <https:... | 9 | 8 | 8 | 0 | 3 | 5 | 1 | 1.67 | 0 | 0 | 0 | 1 | 7 | 0 | 7 | 7 | 65 | 9 | 21 | 11 | 12 | 35 | 20 | 10 | 12 | 2 | 0 | 1 | 8 |
23,666 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/info.py | redis.commands.bf.info.BFInfo | from ..helpers import nativestr
class BFInfo:
capacity = None
size = None
filterNum = None
insertedNum = None
expansionRate = None
def __init__(self, args):
response = dict(zip(map(nativestr, args[::2]), args[1::2]))
self.capacity = response['Capacity']
self.size = resp... |
class BFInfo:
def __init__(self, args):
pass
def get(self, item):
pass
def __getitem__(self, item):
pass | 4 | 0 | 5 | 0 | 5 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 3 | 0 | 3 | 3 | 23 | 3 | 20 | 10 | 16 | 0 | 20 | 10 | 16 | 2 | 0 | 1 | 4 |
23,667 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/info.py | redis.commands.bf.info.CFInfo | from ..helpers import nativestr
class CFInfo:
size = None
bucketNum = None
filterNum = None
insertedNum = None
deletedNum = None
bucketSize = None
expansionRate = None
maxIteration = None
def __init__(self, args):
response = dict(zip(map(nativestr, args[::2]), args[1::2]))
... |
class CFInfo:
def __init__(self, args):
pass
def get(self, item):
pass
def __getitem__(self, item):
pass | 4 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 3 | 0 | 3 | 3 | 29 | 3 | 26 | 13 | 22 | 0 | 26 | 13 | 22 | 2 | 0 | 1 | 4 |
23,668 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/info.py | redis.commands.bf.info.CMSInfo | from ..helpers import nativestr
class CMSInfo:
width = None
depth = None
count = None
def __init__(self, args):
response = dict(zip(map(nativestr, args[::2]), args[1::2]))
self.width = response['width']
self.depth = response['depth']
self.count = response['count']
... |
class CMSInfo:
def __init__(self, args):
pass
def __getitem__(self, item):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 0 | 2 | 2 | 13 | 2 | 11 | 7 | 8 | 0 | 11 | 7 | 8 | 1 | 0 | 0 | 2 |
23,669 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/info.py | redis.commands.bf.info.TDigestInfo | from ..helpers import nativestr
class TDigestInfo:
compression = None
capacity = None
merged_nodes = None
unmerged_nodes = None
merged_weight = None
unmerged_weight = None
total_compressions = None
memory_usage = None
def __init__(self, args):
response = dict(zip(map(native... |
class TDigestInfo:
def __init__(self, args):
pass
def get(self, item):
pass
def __getitem__(self, item):
pass | 4 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 3 | 0 | 3 | 3 | 29 | 3 | 26 | 13 | 22 | 0 | 26 | 13 | 22 | 2 | 0 | 1 | 4 |
23,670 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/bf/info.py | redis.commands.bf.info.TopKInfo | from ..helpers import nativestr
class TopKInfo:
k = None
width = None
depth = None
decay = None
def __init__(self, args):
response = dict(zip(map(nativestr, args[::2]), args[1::2]))
self.k = response['k']
self.width = response['width']
self.depth = response['depth']... |
class TopKInfo:
def __init__(self, args):
pass
def __getitem__(self, item):
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 3 | 0 | 0 | 2 | 0 | 2 | 2 | 15 | 2 | 13 | 8 | 10 | 0 | 13 | 8 | 10 | 1 | 0 | 0 | 2 |
23,671 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.AsyncClusterDataAccessCommands | from .core import ACLCommands, AsyncACLCommands, AsyncDataAccessCommands, AsyncFunctionCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncScriptCommands, DataAccessCommands, FunctionCommands, ManagementCommands, ModuleCommands, PubSubCommands, ScriptCommands
from typing import TYPE_CHECKING, Any, AsyncIterato... |
class AsyncClusterDataAccessCommands(ClusterDataAccessCommands, AsyncDataAccessCommands):
'''
A class for Redis Cluster Data Access Commands
The class inherits from Redis's core DataAccessCommand class and do the
required adjustments to work with cluster mode
'''
async def scan_iter(self, matc... | 2 | 1 | 36 | 3 | 30 | 3 | 6 | 0.24 | 2 | 2 | 0 | 1 | 1 | 0 | 1 | 235 | 46 | 5 | 33 | 14 | 23 | 8 | 16 | 6 | 14 | 6 | 9 | 4 | 6 |
23,672 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.AsyncClusterManagementCommands | from .core import ACLCommands, AsyncACLCommands, AsyncDataAccessCommands, AsyncFunctionCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncScriptCommands, DataAccessCommands, FunctionCommands, ManagementCommands, ModuleCommands, PubSubCommands, ScriptCommands
import asyncio
from redis.typing import AnyKeyT, Cl... |
class AsyncClusterManagementCommands(ClusterManagementCommands, AsyncManagementCommands):
'''
A class for Redis Cluster management commands
The class inherits from Redis's core ManagementCommands class and do the
required adjustments to work with cluster mode
'''
async def cluster_delslots(sel... | 2 | 2 | 15 | 2 | 7 | 6 | 1 | 1.1 | 2 | 1 | 0 | 1 | 1 | 0 | 1 | 138 | 25 | 4 | 10 | 4 | 6 | 11 | 3 | 2 | 1 | 1 | 8 | 0 | 1 |
23,673 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.AsyncClusterMultiKeyCommands | from .helpers import list_or_args
from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, Iterable, Iterator, List, Literal, Mapping, NoReturn, Optional, Union
from redis.typing import AnyKeyT, ClusterCommandsProtocol, EncodableT, KeysT, KeyT, PatternT, ResponseT
class AsyncClusterMultiKeyCommands(ClusterMultiKeyC... |
class AsyncClusterMultiKeyCommands(ClusterMultiKeyCommands):
'''
A class containing commands that handle more than one key
'''
async def mget_nonatomic(self, keys: KeysT, *args: KeyT) -> List[Optional[Any]]:
'''
Splits the keys into different slots and then calls MGET
for t... | 5 | 4 | 17 | 3 | 7 | 7 | 1 | 1.03 | 1 | 4 | 0 | 1 | 4 | 0 | 4 | 40 | 77 | 16 | 30 | 13 | 23 | 31 | 19 | 11 | 14 | 2 | 8 | 1 | 5 |
23,674 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.AsyncRedisClusterCommands | from .core import ACLCommands, AsyncACLCommands, AsyncDataAccessCommands, AsyncFunctionCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncScriptCommands, DataAccessCommands, FunctionCommands, ManagementCommands, ModuleCommands, PubSubCommands, ScriptCommands
from .redismodules import AsyncRedisModuleCommands,... |
class AsyncRedisClusterCommands(AsyncClusterMultiKeyCommands, AsyncClusterManagementCommands, AsyncACLCommands, AsyncClusterDataAccessCommands, AsyncScriptCommands, AsyncFunctionCommands, AsyncModuleCommands, AsyncRedisModuleCommands):
'''
A class for all Redis Cluster commands
For key-based commands, the ... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.36 | 9 | 0 | 0 | 2 | 0 | 0 | 0 | 397 | 29 | 3 | 11 | 11 | 0 | 15 | 1 | 1 | 0 | 0 | 10 | 0 | 0 |
23,675 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.ClusterDataAccessCommands | from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, Iterable, Iterator, List, Literal, Mapping, NoReturn, Optional, Union
from redis.typing import AnyKeyT, ClusterCommandsProtocol, EncodableT, KeysT, KeyT, PatternT, ResponseT
from .core import ACLCommands, AsyncACLCommands, AsyncDataAccessCommands, AsyncFunctio... |
class ClusterDataAccessCommands(DataAccessCommands):
'''
A class for Redis Cluster Data Access Commands
The class inherits from Redis's core DataAccessCommand class and do the
required adjustments to work with cluster mode
'''
def stralgo(self, algo: Literal['LCS'], value1: KeyT, value2: KeyT,... | 3 | 2 | 40 | 3 | 28 | 10 | 3 | 0.45 | 1 | 4 | 0 | 2 | 2 | 0 | 2 | 224 | 89 | 8 | 56 | 24 | 36 | 25 | 20 | 7 | 17 | 4 | 8 | 3 | 6 |
23,676 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.ClusterManagementCommands | from .core import ACLCommands, AsyncACLCommands, AsyncDataAccessCommands, AsyncFunctionCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncScriptCommands, DataAccessCommands, FunctionCommands, ManagementCommands, ModuleCommands, PubSubCommands, ScriptCommands
from redis.typing import AnyKeyT, ClusterCommandsPr... |
class ClusterManagementCommands(ManagementCommands):
'''
A class for Redis Cluster management commands
The class inherits from Redis's core ManagementCommands class and do the
required adjustments to work with cluster mode
'''
def slaveof(self, *args, **kwargs) -> NoReturn:
'''
... | 32 | 30 | 10 | 1 | 4 | 5 | 1 | 1.33 | 1 | 6 | 2 | 2 | 32 | 1 | 32 | 132 | 357 | 70 | 123 | 54 | 70 | 164 | 75 | 34 | 42 | 3 | 7 | 2 | 38 |
23,677 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.ClusterMultiKeyCommands | from typing import TYPE_CHECKING, Any, AsyncIterator, Dict, Iterable, Iterator, List, Literal, Mapping, NoReturn, Optional, Union
from .helpers import list_or_args
from redis.crc import key_slot
from redis.typing import AnyKeyT, ClusterCommandsProtocol, EncodableT, KeysT, KeyT, PatternT, ResponseT
class ClusterMultiKe... |
class ClusterMultiKeyCommands(ClusterCommandsProtocol):
'''
A class containing commands that handle more than one key
'''
def _partition_keys_by_slot(self, keys: Iterable[KeyT]) -> Dict[int, List[KeyT]]:
'''Split keys into a dictionary that maps a slot to a list of keys.'''
pass
... | 12 | 10 | 13 | 2 | 6 | 6 | 1 | 1.03 | 1 | 5 | 0 | 2 | 11 | 0 | 11 | 36 | 162 | 36 | 62 | 35 | 41 | 64 | 40 | 25 | 28 | 2 | 7 | 1 | 13 |
23,678 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/cluster.py | redis.commands.cluster.RedisClusterCommands | from .redismodules import AsyncRedisModuleCommands, RedisModuleCommands
from .core import ACLCommands, AsyncACLCommands, AsyncDataAccessCommands, AsyncFunctionCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncScriptCommands, DataAccessCommands, FunctionCommands, ManagementCommands, ModuleCommands, PubSubComm... |
class RedisClusterCommands(ClusterMultiKeyCommands, ClusterManagementCommands, ACLCommands, PubSubCommands, ClusterDataAccessCommands, ScriptCommands, FunctionCommands, ModuleCommands, RedisModuleCommands):
'''
A class for all Redis Cluster commands
For key-based commands, the target node(s) will be intern... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1.25 | 10 | 0 | 0 | 1 | 0 | 0 | 0 | 409 | 30 | 3 | 12 | 12 | 0 | 15 | 1 | 1 | 0 | 0 | 9 | 0 | 0 |
23,679 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.ACLCommands | from .helpers import list_or_args
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT... | null | 15 | 15 | 22 | 3 | 11 | 9 | 4 | 0.8 | 1 | 7 | 1 | 2 | 14 | 0 | 14 | 39 | 332 | 50 | 157 | 45 | 125 | 126 | 112 | 28 | 97 | 34 | 6 | 3 | 53 |
23,680 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncBasicKeyCommands | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
class AsyncBasicKeyCommands(BasicKeyCommands):
def __delitem__(self, name: KeyT):
... |
class AsyncBasicKeyCommands(BasicKeyCommands):
def __delitem__(self, name: KeyT):
pass
def __contains__(self, name: KeyT):
pass
def __getitem__(self, name: KeyT):
pass
def __setitem__(self, name: KeyT, value: EncodableT):
pass
async def watch(self, *names: KeyT)... | 7 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 2 | 0 | 1 | 6 | 0 | 6 | 89 | 18 | 5 | 13 | 7 | 6 | 0 | 13 | 7 | 6 | 1 | 7 | 0 | 6 |
23,681 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncCoreCommands | class AsyncCoreCommands(AsyncACLCommands, AsyncClusterCommands, AsyncDataAccessCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncPubSubCommands, AsyncScriptCommands, AsyncFunctionCommands):
"""
A class containing all of the implemented redis commands. This class is
to be used as a mixin for async... | class AsyncCoreCommands(AsyncACLCommands, AsyncClusterCommands, AsyncDataAccessCommands, AsyncManagementCommands, AsyncModuleCommands, AsyncPubSubCommands, AsyncScriptCommands, AsyncFunctionCommands):
'''
A class containing all of the implemented redis commands. This class is
to be used as a mixin for async... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.36 | 9 | 0 | 0 | 1 | 0 | 0 | 0 | 204 | 15 | 0 | 11 | 11 | 0 | 4 | 1 | 1 | 0 | 0 | 9 | 0 | 0 |
23,682 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncDataAccessCommands | class AsyncDataAccessCommands(AsyncBasicKeyCommands, AsyncHyperlogCommands, AsyncHashCommands, AsyncGeoCommands, AsyncListCommands, AsyncScanCommands, AsyncSetCommands, AsyncStreamCommands, AsyncSortedSetCommands):
"""
A class containing all of the implemented data access redis commands.
This class is to be... | class AsyncDataAccessCommands(AsyncBasicKeyCommands, AsyncHyperlogCommands, AsyncHashCommands, AsyncGeoCommands, AsyncListCommands, AsyncScanCommands, AsyncSetCommands, AsyncStreamCommands, AsyncSortedSetCommands):
'''
A class containing all of the implemented data access redis commands.
This class is to be... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.36 | 9 | 0 | 0 | 2 | 0 | 0 | 0 | 101 | 15 | 0 | 11 | 11 | 0 | 4 | 1 | 1 | 0 | 0 | 8 | 0 | 0 |
23,683 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncManagementCommands | from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
class AsyncManagementCommands(ManagementCommands):
async def command_info(self, **kwargs) -> None:
return super().command_info(**kwargs)
async def debug_segfault(self, **kwargs) -> None:
return super().debug_se... |
class AsyncManagementCommands(ManagementCommands):
async def command_info(self, **kwargs) -> None:
pass
async def debug_segfault(self, **kwargs) -> None:
pass
async def memory_doctor(self, **kwargs) -> None:
pass
async def memory_help(self, **kwargs) -> None:
pass
async def shu... | 6 | 1 | 9 | 0 | 7 | 2 | 2 | 0.22 | 1 | 5 | 2 | 2 | 5 | 0 | 5 | 105 | 49 | 5 | 36 | 15 | 22 | 8 | 28 | 7 | 22 | 8 | 7 | 1 | 12 |
23,684 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncModuleCommands | class AsyncModuleCommands(ModuleCommands):
async def command_info(self) -> None:
return super().command_info() | class AsyncModuleCommands(ModuleCommands):
async def command_info(self) -> None:
pass | 2 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 1 | 0 | 2 | 1 | 0 | 1 | 34 | 3 | 0 | 3 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 7 | 0 | 1 |
23,685 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncScanCommands | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable... |
class AsyncScanCommands(ScanCommands):
async def scan_iter(self, match: Union[PatternT, None]=None, count: Optional[int]=None, _type: Optional[str]=None, **kwargs) -> AsyncIterator:
'''
Make an iterator using the SCAN command so that the client doesn't
need to remember the cursor position.... | 5 | 4 | 26 | 3 | 16 | 8 | 4 | 0.48 | 1 | 4 | 0 | 1 | 4 | 0 | 4 | 37 | 109 | 14 | 64 | 40 | 36 | 31 | 28 | 17 | 23 | 5 | 7 | 3 | 14 |
23,686 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncScript | import hashlib
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZSco... | null | 3 | 2 | 23 | 1 | 17 | 5 | 4 | 0.38 | 0 | 5 | 2 | 0 | 2 | 3 | 2 | 2 | 51 | 4 | 34 | 17 | 21 | 13 | 25 | 8 | 21 | 4 | 0 | 2 | 7 |
23,687 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.AsyncScriptCommands | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
class AsyncScriptCommands(ScriptCommands):
async def script_debug(self, *args) -> N... |
class AsyncScriptCommands(ScriptCommands):
async def script_debug(self, *args) -> None:
pass
def register_script(self: 'redis.asyncio.client.Redis', script: ScriptTextT) -> AsyncScript:
'''
Register a Lua ``script`` specifying the ``keys`` it will touch.
Returns a Script object th... | 3 | 1 | 7 | 0 | 4 | 3 | 1 | 0.75 | 1 | 2 | 1 | 2 | 2 | 0 | 2 | 39 | 15 | 1 | 8 | 6 | 2 | 6 | 5 | 3 | 2 | 1 | 7 | 0 | 2 |
23,688 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.BasicKeyCommands | import datetime
from .helpers import list_or_args
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
from typing import TYPE_CHECKING, Any, ... |
class BasicKeyCommands(CommandsProtocol):
'''
Redis basic key-based commands
'''
def append(self, key: KeyT, value: EncodableT) -> ResponseT:
'''
Appends the string ``value`` to the value at ``key``. If ``key``
doesn't already exist, create it with a value of ``value``.
... | 59 | 57 | 16 | 2 | 8 | 6 | 2 | 0.79 | 1 | 13 | 2 | 2 | 58 | 0 | 58 | 83 | 991 | 162 | 463 | 211 | 282 | 366 | 325 | 91 | 264 | 16 | 6 | 2 | 138 |
23,689 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.BitFieldOperation | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable... |
class BitFieldOperation:
'''
Command builder for BITFIELD commands.
'''
def __init__(self, client: Union['redis.client.Redis', 'redis.asyncio.client.Redis'], key: str, default_overflow: Optional[str]=None):
pass
def reset(self):
'''
Reset the state of the instance to when ... | 10 | 7 | 12 | 0 | 6 | 6 | 1 | 1.02 | 0 | 4 | 0 | 0 | 8 | 5 | 8 | 8 | 110 | 9 | 50 | 29 | 29 | 51 | 38 | 17 | 29 | 2 | 0 | 1 | 11 |
23,690 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.ClusterCommands | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
class ClusterCommands(CommandsProtocol):
"""
Class for Redis Cluster commands
... |
class ClusterCommands(CommandsProtocol):
'''
Class for Redis Cluster commands
'''
def cluster(self, cluster_arg, *args, **kwargs) -> ResponseT:
pass
def readwrite(self, **kwargs) -> ResponseT:
'''
Disables read queries for a connection to a Redis Cluster slave node.
... | 4 | 3 | 5 | 1 | 2 | 3 | 1 | 1.57 | 1 | 0 | 0 | 1 | 3 | 0 | 3 | 28 | 23 | 5 | 7 | 4 | 3 | 11 | 7 | 4 | 3 | 1 | 6 | 0 | 3 |
23,691 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.CoreCommands | class CoreCommands(ACLCommands, ClusterCommands, DataAccessCommands, ManagementCommands, ModuleCommands, PubSubCommands, ScriptCommands, FunctionCommands):
"""
A class containing all of the implemented redis commands. This class is
to be used as a mixin for synchronous Redis clients.
""" | class CoreCommands(ACLCommands, ClusterCommands, DataAccessCommands, ManagementCommands, ModuleCommands, PubSubCommands, ScriptCommands, FunctionCommands):
'''
A class containing all of the implemented redis commands. This class is
to be used as a mixin for synchronous Redis clients.
'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.36 | 9 | 0 | 0 | 1 | 0 | 0 | 0 | 358 | 15 | 0 | 11 | 11 | 0 | 4 | 1 | 1 | 0 | 0 | 8 | 0 | 0 |
23,692 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.DataAccessCommands | class DataAccessCommands(BasicKeyCommands, HyperlogCommands, HashCommands, GeoCommands, ListCommands, ScanCommands, SetCommands, StreamCommands, SortedSetCommands):
"""
A class containing all of the implemented data access redis commands.
This class is to be used as a mixin for synchronous Redis clients.
... | class DataAccessCommands(BasicKeyCommands, HyperlogCommands, HashCommands, GeoCommands, ListCommands, ScanCommands, SetCommands, StreamCommands, SortedSetCommands):
'''
A class containing all of the implemented data access redis commands.
This class is to be used as a mixin for synchronous Redis clients.
... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0.36 | 9 | 0 | 0 | 2 | 0 | 0 | 0 | 222 | 15 | 0 | 11 | 11 | 0 | 4 | 1 | 1 | 0 | 0 | 7 | 0 | 0 |
23,693 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.FunctionCommands | from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, Iterator, List, Literal, Mapping, Optional, Sequence, Set, Tuple, Union
class FunctionCommands:
"""
Redis Function commands
"""
def function_load(self, code: str, replace: Optional[bool]=False) -> Union[Awaitabl... |
class FunctionCommands:
'''
Redis Function commands
'''
def function_load(self, code: str, replace: Optional[bool]=False) -> Union[Awaitable[str], str]:
'''
Load a library to Redis.
:param code: the source code (must start with
Shebang statement that provides a metadata... | 12 | 11 | 10 | 1 | 4 | 5 | 1 | 1.28 | 0 | 3 | 0 | 2 | 11 | 0 | 11 | 11 | 122 | 24 | 43 | 28 | 18 | 55 | 31 | 16 | 18 | 2 | 0 | 1 | 13 |
23,694 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.GeoCommands | from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
from t... |
class GeoCommands(CommandsProtocol):
'''
Redis Geospatial commands.
see: https://redis.com/redis-best-practices/indexing-patterns/geospatial/
'''
def geoadd(self, name: KeyT, values: Sequence[EncodableT], nx: bool=False, xx: bool=False, ch: bool=False) -> ResponseT:
'''
Add the spe... | 11 | 9 | 41 | 5 | 26 | 11 | 5 | 0.43 | 1 | 6 | 1 | 1 | 10 | 0 | 10 | 35 | 426 | 55 | 259 | 90 | 175 | 112 | 99 | 17 | 88 | 22 | 6 | 2 | 51 |
23,695 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.HashCommands | from redis.utils import deprecated_function, extract_expire_flags
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
import datetime
from .helpers import list_or_args
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT... |
class HashCommands(CommandsProtocol):
'''
Redis commands for Hash data type.
see: https://redis.io/topics/data-types-intro#redis-hashes
'''
def hdel(self, name: str, *keys: str) -> Union[Awaitable[int], int]:
'''
Delete ``keys`` from hash ``name``
For more information, see ... | 28 | 27 | 21 | 3 | 9 | 10 | 2 | 1.15 | 1 | 11 | 1 | 1 | 23 | 0 | 23 | 48 | 520 | 85 | 202 | 85 | 129 | 233 | 120 | 36 | 96 | 7 | 6 | 2 | 54 |
23,696 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.HyperlogCommands | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
class HyperlogCommands(CommandsProtocol):
"""
Redis commands of HyperLogLogs dat... |
class HyperlogCommands(CommandsProtocol):
'''
Redis commands of HyperLogLogs data type.
see: https://redis.io/topics/data-types-intro#hyperloglogs
'''
def pfadd(self, name: KeyT, *values: FieldT) -> ResponseT:
'''
Adds the specified elements to the specified HyperLogLog.
Fo... | 4 | 4 | 7 | 1 | 2 | 4 | 1 | 2.43 | 1 | 0 | 0 | 1 | 3 | 0 | 3 | 28 | 30 | 6 | 7 | 4 | 3 | 17 | 7 | 4 | 3 | 1 | 6 | 0 | 3 |
23,697 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.ListCommands | from .helpers import list_or_args
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT... |
class ListCommands(CommandsProtocol):
'''
Redis commands for List data type.
see: https://redis.io/topics/data-types#lists
'''
def blpop(self, keys: List, timeout: Optional[Number]=0) -> Union[Awaitable[list], list]:
'''
LPOP a value off of the first non-empty list
named in... | 23 | 23 | 18 | 3 | 7 | 8 | 2 | 1.1 | 1 | 7 | 1 | 1 | 22 | 0 | 22 | 47 | 415 | 79 | 160 | 85 | 79 | 176 | 93 | 27 | 70 | 13 | 6 | 3 | 43 |
23,698 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.ManagementCommands | from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
from t... | null | 76 | 71 | 12 | 1 | 6 | 5 | 2 | 0.95 | 1 | 9 | 2 | 3 | 75 | 0 | 75 | 100 | 995 | 177 | 420 | 182 | 259 | 398 | 287 | 100 | 208 | 12 | 6 | 2 | 127 |
23,699 | andymccurdy/redis-py | andymccurdy_redis-py/redis/commands/core.py | redis.commands.core.ModuleCommands | from redis.typing import AbsExpiryT, AnyKeyT, BitfieldOffsetT, ChannelT, CommandsProtocol, ConsumerT, EncodableT, ExpiryT, FieldT, GroupT, KeysT, KeyT, Number, PatternT, ResponseT, ScriptTextT, StreamIdT, TimeoutSecT, ZScoreBoundT
from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable... |
class ModuleCommands(CommandsProtocol):
'''
Redis Module commands.
see: https://redis.io/topics/modules-intro
'''
def module_load(self, path, *args) -> ResponseT:
'''
Loads the module from ``path``.
Passes all ``*args`` to the module, during loading.
Raises ``Module... | 9 | 5 | 7 | 1 | 4 | 3 | 1 | 0.77 | 1 | 2 | 0 | 3 | 8 | 0 | 8 | 33 | 68 | 13 | 31 | 15 | 17 | 24 | 24 | 10 | 15 | 3 | 6 | 1 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.