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,500 | facebook/watchman | build/fbcode_builder/getdeps/load.py | getdeps.load.ManifestLoader | import copy
from . import fetcher
import hashlib
from .envfuncs import path_search
import os
import base64
class ManifestLoader(object):
"""ManifestLoader stores information about project manifest relationships for a
given set of (build options + platform) configuration.
The ManifestLoader class primarily... |
class ManifestLoader(object):
'''ManifestLoader stores information about project manifest relationships for a
given set of (build options + platform) configuration.
The ManifestLoader class primarily serves as a location to cache project dependency
relationships and project hash values for this build c... | 18 | 4 | 13 | 1 | 10 | 2 | 3 | 0.27 | 1 | 5 | 1 | 0 | 17 | 10 | 17 | 17 | 251 | 39 | 167 | 67 | 149 | 45 | 149 | 66 | 131 | 11 | 1 | 4 | 45 |
23,501 | facebook/watchman | build/fbcode_builder/getdeps/load.py | getdeps.load.ResourceLoader | from .manifest import ManifestParser
from .errors import ManifestNotFound
class ResourceLoader(Loader):
def __init__(self, namespace, manifests_dir) -> None:
self.namespace = namespace
self.manifests_dir = manifests_dir
def _list_manifests(self, _build_opts):
import pkg_resources
... |
class ResourceLoader(Loader):
def __init__(self, namespace, manifests_dir) -> None:
pass
def _list_manifests(self, _build_opts):
pass
def _find_manifest(self, project_name):
pass
def _load_manifest(self, path: str):
pass
def load_project(self, build_opts, projec... | 6 | 0 | 6 | 1 | 5 | 0 | 2 | 0 | 1 | 3 | 2 | 0 | 5 | 2 | 5 | 9 | 36 | 9 | 27 | 16 | 19 | 0 | 26 | 16 | 18 | 4 | 2 | 3 | 10 |
23,502 | facebook/watchman | build/fbcode_builder/getdeps/manifest.py | getdeps.manifest.ContextGenerator | class ContextGenerator(object):
"""ContextGenerator allows creating ManifestContext objects on a per-project basis.
This allows us to evaluate different projects with slightly different contexts.
For instance, this can be used to only enable tests for some projects."""
def __init__(self, default_ctx):... | class ContextGenerator(object):
'''ContextGenerator allows creating ManifestContext objects on a per-project basis.
This allows us to evaluate different projects with slightly different contexts.
For instance, this can be used to only enable tests for some projects.'''
def __init__(self, default_ctx):
... | 5 | 1 | 4 | 0 | 4 | 0 | 2 | 0.19 | 1 | 1 | 1 | 0 | 4 | 2 | 4 | 4 | 24 | 5 | 16 | 9 | 11 | 3 | 16 | 9 | 11 | 2 | 1 | 1 | 6 |
23,503 | facebook/watchman | build/fbcode_builder/getdeps/manifest.py | getdeps.manifest.ManifestContext | class ManifestContext(object):
"""ProjectContext contains a dictionary of values to use when evaluating boolean
expressions in a project manifest.
This object should be passed as the `ctx` parameter in ManifestParser.get() calls.
"""
ALLOWED_VARIABLES = {'os', 'distro', 'distro_vers', 'fb', 'fbsour... | class ManifestContext(object):
'''ProjectContext contains a dictionary of values to use when evaluating boolean
expressions in a project manifest.
This object should be passed as the `ctx` parameter in ManifestParser.get() calls.
'''
def __init__(self, ctx_dict):
pass
def get(self, key... | 6 | 1 | 3 | 0 | 3 | 0 | 1 | 0.16 | 1 | 2 | 0 | 0 | 5 | 1 | 5 | 5 | 36 | 7 | 25 | 9 | 19 | 4 | 15 | 9 | 9 | 1 | 1 | 0 | 5 |
23,504 | facebook/watchman | build/fbcode_builder/getdeps/manifest.py | getdeps.manifest.ManifestParser | from .py_wheel_builder import PythonWheelBuilder
from .cargo import CargoBuilder
from .fetcher import ArchiveFetcher, GitFetcher, PreinstalledNopFetcher, ShipitTransformerFetcher, SimpleShipitTransformerFetcher, SubFetcher, SystemPackageFetcher
import sys
from .builder import AutoconfBuilder, Boost, CMakeBootStrapBuild... |
class ManifestParser(object):
def __init__(self, file_name, fp=None):
pass
def get(self, section, key, defval=None, ctx=None):
pass
def get_dependencies(self, ctx):
pass
def get_section_as_args(self, section, ctx=None) -> List[str]:
'''Intended for use with the make.... | 18 | 6 | 30 | 2 | 26 | 3 | 5 | 0.11 | 1 | 28 | 20 | 0 | 17 | 6 | 17 | 17 | 534 | 53 | 436 | 111 | 393 | 48 | 222 | 87 | 203 | 18 | 1 | 3 | 84 |
23,505 | facebook/watchman | build/fbcode_builder/getdeps/platform.py | getdeps.platform.HostType | import sys
class HostType(object):
def __init__(self, ostype=None, distro=None, distrovers=None) -> None:
isarm = False
if ostype is None:
distro = None
distrovers = None
if sys.platform.startswith('linux'):
ostype, distro, distrovers = get_linux... |
class HostType(object):
def __init__(self, ostype=None, distro=None, distrovers=None) -> None:
pass
def is_windows(self):
pass
def is_arm(self):
pass
def is_darwin(self):
pass
def is_linux(self):
pass
def is_freebsd(self):
pass
def as_t... | 12 | 0 | 7 | 0 | 6 | 1 | 2 | 0.28 | 1 | 1 | 0 | 0 | 9 | 4 | 10 | 10 | 89 | 12 | 60 | 18 | 48 | 17 | 47 | 17 | 36 | 6 | 1 | 2 | 20 |
23,506 | facebook/watchman | build/fbcode_builder/getdeps/py_wheel_builder.py | getdeps.py_wheel_builder.PythonWheelBuilder | import email
import stat
import codecs
from .builder import BuilderBase, CMakeBuilder
import os
import re
from typing import Dict, List
class PythonWheelBuilder(BuilderBase):
"""This Builder can take Python wheel archives and install them as python libraries
that can be used by add_fb_python_library()/add_fb_p... |
class PythonWheelBuilder(BuilderBase):
'''This Builder can take Python wheel archives and install them as python libraries
that can be used by add_fb_python_library()/add_fb_python_executable() CMake rules.
'''
def _build(self, reconfigure: bool) -> None:
pass
def _run_cmake_build(self, r... | 8 | 1 | 24 | 2 | 18 | 4 | 3 | 0.24 | 1 | 4 | 1 | 0 | 7 | 7 | 7 | 23 | 183 | 21 | 131 | 44 | 121 | 31 | 74 | 32 | 66 | 5 | 2 | 3 | 19 |
23,507 | facebook/watchman | build/fbcode_builder/getdeps/runcmd.py | getdeps.runcmd.RunCommandError | class RunCommandError(Exception):
pass | class RunCommandError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
23,508 | facebook/watchman | build/fbcode_builder/getdeps/subcmd.py | getdeps.subcmd.SubCmd | class SubCmd(object):
NAME = None
HELP = None
def run(self, args) -> int:
"""perform the command"""
return 0
def setup_parser(self, parser) -> None:
pass | class SubCmd(object):
def run(self, args) -> int:
'''perform the command'''
pass
def setup_parser(self, parser) -> None:
pass | 3 | 1 | 4 | 0 | 2 | 2 | 1 | 0.43 | 1 | 1 | 0 | 5 | 2 | 0 | 2 | 2 | 12 | 2 | 7 | 5 | 4 | 3 | 7 | 5 | 4 | 1 | 1 | 0 | 2 |
23,509 | facebook/watchman | watchman/integration/lib/TempDir.py | integration.lib.TempDir.TempDir | import time
from . import path_utils as path
import sys
import shutil
import atexit
import tempfile
import os
class TempDir:
"""
This is a helper for locating a reasonable place for temporary files.
When run in the watchman test suite, we compute this up-front and then
store everything under that tempo... |
class TempDir:
'''
This is a helper for locating a reasonable place for temporary files.
When run in the watchman test suite, we compute this up-front and then
store everything under that temporary directory.
When run under the FB internal test runner, we infer a reasonable grouped
location fro... | 6 | 1 | 10 | 1 | 7 | 2 | 2 | 0.6 | 0 | 2 | 0 | 0 | 4 | 2 | 4 | 4 | 58 | 10 | 30 | 11 | 24 | 18 | 28 | 11 | 22 | 3 | 0 | 2 | 9 |
23,510 | facebook/watchman | watchman/integration/lib/WatchmanInstance.py | integration.lib.WatchmanInstance.InitWithDirMixin | import tempfile
import os
class InitWithDirMixin:
"""A mixin to allow setting up a state dir rather than a state file. This is
only meant to test state dir creation and permissions -- most operations are
unlikely to work.
"""
def _init_state(self) -> None:
self.base_dir = tempfile.mkdtemp(... |
class InitWithDirMixin:
'''A mixin to allow setting up a state dir rather than a state file. This is
only meant to test state dir creation and permissions -- most operations are
unlikely to work.
'''
def _init_state(self) -> None:
pass
def get_state_args(self):
pass | 3 | 1 | 13 | 0 | 6 | 7 | 1 | 1.31 | 0 | 0 | 0 | 1 | 2 | 8 | 2 | 2 | 32 | 2 | 13 | 12 | 10 | 17 | 13 | 12 | 10 | 1 | 0 | 0 | 2 |
23,511 | facebook/watchman | watchman/integration/lib/WatchmanInstance.py | integration.lib.WatchmanInstance.InitWithFilesMixin | import os
import uuid
import tempfile
class InitWithFilesMixin:
def _init_state(self) -> None:
self.base_dir = tempfile.mkdtemp(prefix='inst')
self.user_dir = None
self.cfg_file = os.path.join(self.base_dir, 'config.json')
self.log_file_name = os.path.join(self.base_dir, 'log')
... |
class InitWithFilesMixin:
def _init_state(self) -> None:
pass
def get_state_args(self):
pass | 3 | 0 | 16 | 0 | 11 | 5 | 1 | 0.45 | 0 | 0 | 0 | 1 | 2 | 9 | 2 | 2 | 33 | 1 | 22 | 12 | 19 | 10 | 13 | 12 | 10 | 1 | 0 | 0 | 2 |
23,512 | facebook/watchman | watchman/integration/lib/WatchmanInstance.py | integration.lib.WatchmanInstance.Instance | class Instance(_Instance, InitWithFilesMixin):
pass | class Instance(_Instance, InitWithFilesMixin):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
23,513 | facebook/watchman | watchman/integration/lib/WatchmanInstance.py | integration.lib.WatchmanInstance.InstanceWithStateDir | class InstanceWithStateDir(_Instance, InitWithDirMixin):
pass | class InstanceWithStateDir(_Instance, InitWithDirMixin):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 1 | 0 | 0 |
23,514 | facebook/watchman | watchman/integration/lib/WatchmanInstance.py | integration.lib.WatchmanInstance._Instance | import subprocess
import sys
import os
import time
import signal
import pywatchman
import json
class _Instance:
def __init__(self, config=None, start_timeout: float=60.0, debug_watchman: bool=False) -> None:
self.start_timeout = start_timeout
self._init_state()
self.proc = None
sel... |
class _Instance:
def __init__(self, config=None, start_timeout: float=60.0, debug_watchman: bool=False) -> None:
pass
def __del__(self) -> None:
pass
def __enter__(self) -> '_Instance':
pass
def __exit__(self, *exc_info) -> None:
pass
def getSockPath(self):
... | 18 | 1 | 8 | 0 | 7 | 1 | 2 | 0.14 | 0 | 8 | 3 | 2 | 17 | 4 | 17 | 17 | 156 | 24 | 116 | 42 | 96 | 16 | 101 | 36 | 83 | 6 | 0 | 2 | 33 |
23,515 | facebook/watchman | build/fbcode_builder/CMake/make_fbpy_archive.py | make_fbpy_archive.BadManifestError | class BadManifestError(UsageError):
def __init__(self, path, line_num, message):
full_msg = '%s:%s: %s' % (path, line_num, message)
super().__init__(full_msg)
self.path = path
self.line_num = line_num
self.raw_message = message | class BadManifestError(UsageError):
def __init__(self, path, line_num, message):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 3 | 1 | 13 | 7 | 0 | 7 | 6 | 5 | 0 | 7 | 6 | 5 | 1 | 4 | 0 | 1 |
23,516 | facebook/watchman | build/fbcode_builder/CMake/make_fbpy_archive.py | make_fbpy_archive.UsageError | class UsageError(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message | class UsageError(Exception):
def __init__(self, message):
pass
def __str__(self):
pass | 3 | 0 | 2 | 0 | 2 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 2 | 1 | 2 | 12 | 6 | 1 | 5 | 4 | 2 | 0 | 5 | 4 | 2 | 1 | 3 | 0 | 2 |
23,517 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.BSERv1Unsupported | class BSERv1Unsupported(WatchmanError):
pass | class BSERv1Unsupported(WatchmanError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
23,518 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.Bser2WithFallbackCodec | from . import capabilities, encoding
class Bser2WithFallbackCodec(BserCodec):
"""use BSER v2 encoding"""
def __init__(self, transport, value_encoding, value_errors):
super(Bser2WithFallbackCodec, self).__init__(transport, value_encoding, value_errors)
bserv2_key = 'required'
self.send(... |
class Bser2WithFallbackCodec(BserCodec):
'''use BSER v2 encoding'''
def __init__(self, transport, value_encoding, value_errors):
pass
def receive(self):
pass
def send(self, *args):
pass | 4 | 1 | 18 | 3 | 15 | 0 | 3 | 0.04 | 1 | 4 | 2 | 1 | 3 | 3 | 3 | 11 | 58 | 11 | 45 | 16 | 41 | 2 | 36 | 15 | 32 | 5 | 2 | 1 | 10 |
23,519 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.BserCodec | class BserCodec(Codec):
"""use the BSER encoding. This is the default, preferred codec"""
def __init__(self, transport, value_encoding, value_errors):
super(BserCodec, self).__init__(transport)
self._value_encoding = value_encoding
self._value_errors = value_errors
def _loads(self... | class BserCodec(Codec):
'''use the BSER encoding. This is the default, preferred codec'''
def __init__(self, transport, value_encoding, value_errors):
pass
def _loads(self, response):
pass
def receive(self):
pass
def send(self, *args):
pass | 5 | 1 | 8 | 1 | 7 | 0 | 2 | 0.07 | 1 | 3 | 1 | 2 | 4 | 2 | 4 | 8 | 37 | 7 | 29 | 14 | 24 | 2 | 25 | 13 | 20 | 4 | 1 | 1 | 7 |
23,520 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.CLIProcessTransport | import subprocess
class CLIProcessTransport(Transport):
"""open a pipe to the cli to talk to the service
This intended to be used only in the test harness!
The CLI is an oddball because we only support JSON input
and cannot send multiple commands through the same instance,
so we spawn a new proces... |
class CLIProcessTransport(Transport):
'''open a pipe to the cli to talk to the service
This intended to be used only in the test harness!
The CLI is an oddball because we only support JSON input
and cannot send multiple commands through the same instance,
so we spawn a new process for each command.... | 6 | 1 | 10 | 0 | 10 | 0 | 2 | 0.27 | 1 | 2 | 1 | 0 | 5 | 3 | 5 | 10 | 75 | 10 | 51 | 14 | 45 | 14 | 39 | 14 | 33 | 3 | 1 | 2 | 10 |
23,521 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.Codec | class Codec:
"""communication encoding for the watchman server"""
transport = None
def __init__(self, transport):
self.transport = transport
def receive(self):
raise NotImplementedError()
def send(self, *args):
raise NotImplementedError()
def setTimeout(self, value):
... | class Codec:
'''communication encoding for the watchman server'''
def __init__(self, transport):
pass
def receive(self):
pass
def send(self, *args):
pass
def setTimeout(self, value):
pass | 5 | 1 | 2 | 0 | 2 | 0 | 1 | 0.1 | 0 | 1 | 0 | 2 | 4 | 0 | 4 | 4 | 16 | 5 | 10 | 6 | 5 | 1 | 10 | 6 | 5 | 1 | 0 | 0 | 4 |
23,522 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.CommandError | class CommandError(WatchmanError):
"""error returned by watchman
self.msg is the message returned by watchman.
"""
def __init__(self, msg, cmd=None):
super(CommandError, self).__init__('watchman command error: %s' % (msg,), cmd) | class CommandError(WatchmanError):
'''error returned by watchman
self.msg is the message returned by watchman.
'''
def __init__(self, msg, cmd=None):
pass | 2 | 1 | 2 | 0 | 2 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 14 | 8 | 2 | 3 | 2 | 1 | 3 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
23,523 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.ImmutableBser2Codec | class ImmutableBser2Codec(Bser2WithFallbackCodec, ImmutableBserCodec):
"""use the BSER encoding, decoding values using the newer
immutable object support"""
pass | class ImmutableBser2Codec(Bser2WithFallbackCodec, ImmutableBserCodec):
'''use the BSER encoding, decoding values using the newer
immutable object support'''
pass | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 12 | 5 | 1 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
23,524 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.ImmutableBserCodec | class ImmutableBserCodec(BserCodec):
"""use the BSER encoding, decoding values using the newer
immutable object support"""
def _loads(self, response):
return bser.loads(response, False, value_encoding=self._value_encoding, value_errors=self._value_errors) | class ImmutableBserCodec(BserCodec):
'''use the BSER encoding, decoding values using the newer
immutable object support'''
def _loads(self, response):
pass | 2 | 1 | 7 | 0 | 7 | 0 | 1 | 0.25 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 9 | 11 | 1 | 8 | 3 | 6 | 2 | 3 | 2 | 1 | 1 | 2 | 0 | 1 |
23,525 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.JsonCodec | class JsonCodec(Codec):
"""Use json codec. This is here primarily for testing purposes"""
json = None
def __init__(self, transport):
super(JsonCodec, self).__init__(transport)
import json
self.json = json
def receive(self):
line = self.transport.readLine()
try:... | class JsonCodec(Codec):
'''Use json codec. This is here primarily for testing purposes'''
def __init__(self, transport):
pass
def receive(self):
pass
def send(self, *args):
pass | 4 | 1 | 9 | 0 | 5 | 3 | 1 | 0.56 | 1 | 2 | 0 | 0 | 3 | 0 | 3 | 7 | 33 | 5 | 18 | 9 | 13 | 10 | 18 | 8 | 13 | 2 | 1 | 1 | 4 |
23,526 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.SockPath | import os
class SockPath:
"""Describes how to connect to watchman"""
unix_domain = None
named_pipe = None
tcp_address = None
def __init__(self, unix_domain=None, named_pipe=None, sockpath=None, tcp_address=None):
if named_pipe is None and sockpath is not None and is_named_pipe_path(sockpat... |
class SockPath:
'''Describes how to connect to watchman'''
def __init__(self, unix_domain=None, named_pipe=None, sockpath=None, tcp_address=None):
pass
def legacy_sockpath(self):
'''Returns a sockpath suitable for passing to the watchman
CLI --sockname parameter'''
pass | 3 | 2 | 12 | 1 | 10 | 1 | 3 | 0.13 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 31 | 5 | 23 | 8 | 18 | 3 | 17 | 6 | 14 | 3 | 0 | 1 | 5 |
23,527 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.SocketConnectError | class SocketConnectError(WatchmanError):
def __init__(self, sockpath, exc):
super(SocketConnectError, self).__init__('unable to connect to %s: %s' % (sockpath, exc))
self.sockpath = sockpath
self.exc = exc | class SocketConnectError(WatchmanError):
def __init__(self, sockpath, exc):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 2 | 1 | 14 | 7 | 0 | 7 | 4 | 5 | 0 | 5 | 4 | 3 | 1 | 4 | 0 | 1 |
23,528 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.SocketTimeout | class SocketTimeout(WatchmanError):
"""A specialized exception raised for socket timeouts during communication to/from watchman.
This makes it easier to implement non-blocking loops as callers can easily distinguish
between a routine timeout and an actual error condition.
Note that catching WatchmanErr... | class SocketTimeout(WatchmanError):
'''A specialized exception raised for socket timeouts during communication to/from watchman.
This makes it easier to implement non-blocking loops as callers can easily distinguish
between a routine timeout and an actual error condition.
Note that catching WatchmanErro... | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 8 | 1 | 1 | 1 | 0 | 6 | 1 | 1 | 0 | 0 | 4 | 0 | 0 |
23,529 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.SocketTransport | import socket
class SocketTransport(Transport):
"""abstract socket transport"""
sock = None
timeout = None
def __init__(self):
pass
def close(self):
if self.sock:
self.sock.close()
self.sock = None
def setTimeout(self, value):
self.timeout = va... |
class SocketTransport(Transport):
'''abstract socket transport'''
def __init__(self):
pass
def close(self):
pass
def setTimeout(self, value):
pass
def readBytes(self, size):
pass
def write(self, data):
pass | 6 | 1 | 5 | 0 | 5 | 0 | 2 | 0.04 | 1 | 2 | 2 | 3 | 5 | 0 | 5 | 10 | 33 | 6 | 26 | 9 | 20 | 1 | 26 | 9 | 20 | 3 | 1 | 2 | 9 |
23,530 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.TcpSocketTransport | import socket
class TcpSocketTransport(SocketTransport):
"""TCP socket transport"""
def __init__(self, sockpath, timeout):
super(TcpSocketTransport, self).__init__()
self.sockpath = sockpath
self.timeout = timeout
try:
results = socket.getaddrinfo(self.sockpath.tcp_... |
class TcpSocketTransport(SocketTransport):
'''TCP socket transport'''
def __init__(self, sockpath, timeout):
pass | 2 | 1 | 28 | 2 | 24 | 2 | 3 | 0.12 | 1 | 5 | 1 | 0 | 1 | 3 | 1 | 11 | 31 | 3 | 25 | 9 | 23 | 3 | 18 | 8 | 16 | 3 | 2 | 1 | 3 |
23,531 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.Transport | class Transport:
"""communication transport to the watchman server"""
buf = None
def close(self):
"""tear it down"""
raise NotImplementedError()
def readBytes(self, size):
"""read size bytes"""
raise NotImplementedError()
def write(self, buf):
"""write some... | class Transport:
'''communication transport to the watchman server'''
def close(self):
'''tear it down'''
pass
def readBytes(self, size):
'''read size bytes'''
pass
def write(self, buf):
'''write some data'''
pass
def setTimeout(self, value):
... | 6 | 5 | 7 | 0 | 5 | 2 | 2 | 0.4 | 0 | 1 | 0 | 4 | 5 | 0 | 5 | 5 | 43 | 8 | 25 | 9 | 19 | 10 | 25 | 9 | 19 | 5 | 0 | 2 | 9 |
23,532 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.UnixSocketTransport | import socket
class UnixSocketTransport(SocketTransport):
"""local unix domain socket transport"""
def __init__(self, sockpath, timeout):
super(UnixSocketTransport, self).__init__()
self.sockpath = sockpath
self.timeout = timeout
sock = socket.socket(socket.AF_UNIX, socket.SOCK... |
class UnixSocketTransport(SocketTransport):
'''local unix domain socket transport'''
def __init__(self, sockpath, timeout):
pass | 2 | 1 | 13 | 1 | 12 | 0 | 2 | 0.08 | 1 | 3 | 1 | 0 | 1 | 3 | 1 | 11 | 16 | 2 | 13 | 7 | 11 | 1 | 13 | 6 | 11 | 2 | 2 | 1 | 2 |
23,533 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.UseAfterFork | class UseAfterFork(WatchmanError):
pass | class UseAfterFork(WatchmanError):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 4 | 0 | 0 |
23,534 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.WatchmanEnvironmentError | class WatchmanEnvironmentError(WatchmanError):
def __init__(self, msg, errno, errmsg, cmd=None):
super(WatchmanEnvironmentError, self).__init__('{0}: errno={1} errmsg={2}'.format(msg, errno, errmsg), cmd) | class WatchmanEnvironmentError(WatchmanError):
def __init__(self, msg, errno, errmsg, cmd=None):
pass | 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 14 | 5 | 0 | 5 | 2 | 3 | 0 | 3 | 2 | 1 | 1 | 4 | 0 | 1 |
23,535 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.WatchmanError | class WatchmanError(Exception):
def __init__(self, msg=None, cmd=None):
self.msg = msg
self.cmd = cmd
def setCommand(self, cmd):
self.cmd = cmd
def __str__(self):
if self.cmd:
return '%s, while executing %s' % (self.msg, self.cmd)
return self.msg | class WatchmanError(Exception):
def __init__(self, msg=None, cmd=None):
pass
def setCommand(self, cmd):
pass
def __str__(self):
pass | 4 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 6 | 3 | 2 | 3 | 13 | 12 | 2 | 10 | 6 | 6 | 0 | 10 | 6 | 6 | 2 | 3 | 1 | 4 |
23,536 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.WindowsNamedPipeTransport | import math
import os
class WindowsNamedPipeTransport(Transport):
"""connect to a named pipe"""
def __init__(self, sockpath, timeout):
self.sockpath = sockpath
self.timeout = int(math.ceil(timeout * 1000))
self._iobuf = None
path = os.fsencode(self.sockpath.named_pipe)
... |
class WindowsNamedPipeTransport(Transport):
'''connect to a named pipe'''
def __init__(self, sockpath, timeout):
pass
def _raise_win_err(self, msg, err):
pass
def _make_win_err(self, msg, err):
pass
def close(self):
pass
def setTimeout(self, value):
... | 8 | 2 | 22 | 4 | 16 | 3 | 4 | 0.19 | 1 | 5 | 3 | 0 | 7 | 7 | 7 | 12 | 164 | 32 | 111 | 28 | 103 | 21 | 87 | 28 | 79 | 10 | 1 | 2 | 26 |
23,537 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.WindowsUnixSocketTransport | class WindowsUnixSocketTransport(SocketTransport):
"""local unix domain socket transport on Windows"""
sock = None
timeout = None
def __init__(self, sockpath, timeout):
super(WindowsUnixSocketTransport, self).__init__()
self.sockpath = sockpath
self.timeout = timeout
soc... | class WindowsUnixSocketTransport(SocketTransport):
'''local unix domain socket transport on Windows'''
def __init__(self, sockpath, timeout):
pass | 2 | 1 | 15 | 1 | 14 | 0 | 3 | 0.06 | 1 | 4 | 3 | 0 | 1 | 1 | 1 | 11 | 21 | 3 | 17 | 7 | 15 | 1 | 17 | 6 | 15 | 3 | 2 | 2 | 3 |
23,538 | facebook/watchman | watchman/python/pywatchman/__init__.py | pywatchman.client | import inspect
import sys
import subprocess
from . import capabilities, encoding
import os
class client:
"""Handles the communication with the watchman service"""
sockpath = None
transport = None
sendCodec = None
recvCodec = None
sendConn = None
recvConn = None
subs = {}
sub_by_root... |
class client:
'''Handles the communication with the watchman service'''
def __init__(self, sockpath=None, tcpAddress=None, timeout=1.0, transport=None, sendEncoding=None, recvEncoding=None, useImmutableBser=False, valueEncoding=False, valueErrors=False, binpath=None):
pass
def _makeBSERCodec(self... | 21 | 7 | 16 | 2 | 12 | 3 | 4 | 0.24 | 0 | 20 | 15 | 0 | 18 | 4 | 18 | 18 | 355 | 58 | 242 | 73 | 209 | 59 | 198 | 58 | 177 | 13 | 0 | 3 | 70 |
23,539 | facebook/watchman | watchman/python/pywatchman/pybser.py | pywatchman.pybser.Bunser | import binascii
import struct
class Bunser:
def __init__(self, mutable=True, value_encoding=None, value_errors=None):
self.mutable = mutable
self.value_encoding = value_encoding
if value_encoding is None:
self.value_errors = None
elif value_errors is None:
s... |
class Bunser:
def __init__(self, mutable=True, value_encoding=None, value_errors=None):
pass
@staticmethod
def unser_int(buf, pos):
pass
def unser_utf8_string(self, buf, pos):
pass
def unser_bytestring(self, buf, pos):
pass
def unser_array(self, buf, pos):
... | 10 | 0 | 18 | 1 | 16 | 0 | 5 | 0.02 | 0 | 6 | 1 | 0 | 7 | 3 | 8 | 8 | 152 | 17 | 133 | 45 | 123 | 2 | 100 | 44 | 91 | 11 | 0 | 3 | 39 |
23,540 | facebook/watchman | watchman/python/pywatchman/pybser.py | pywatchman.pybser._BunserDict | class _BunserDict:
__slots__ = ('_keys', '_values')
def __init__(self, keys, values):
self._keys = keys
self._values = values
def __getattr__(self, name):
return self.__getitem__(name)
def __getitem__(self, key):
if isinstance(key, (int, long)):
return self... | class _BunserDict:
def __init__(self, keys, values):
pass
def __getattr__(self, name):
pass
def __getitem__(self, key):
pass
def __len__(self):
pass | 5 | 0 | 5 | 0 | 4 | 1 | 2 | 0.11 | 0 | 3 | 0 | 0 | 4 | 2 | 4 | 4 | 24 | 4 | 18 | 8 | 13 | 2 | 17 | 8 | 12 | 4 | 0 | 1 | 7 |
23,541 | facebook/watchman | watchman/python/pywatchman/pybser.py | pywatchman.pybser._bser_buffer | import ctypes
import collections.abc as collections_abc
import struct
class _bser_buffer:
def __init__(self, version):
self.bser_version = version
self.buf = ctypes.create_string_buffer(8192)
if self.bser_version == 1:
struct.pack_into(tobytes(len(EMPTY_HEADER)) + b's', self.bu... |
class _bser_buffer:
def __init__(self, version):
pass
def ensure_size(self, size):
pass
def append_long(self, val):
pass
def append_string(self, s):
pass
def append_recursive(self, val):
pass | 6 | 0 | 34 | 0 | 34 | 0 | 7 | 0 | 0 | 7 | 0 | 0 | 5 | 3 | 5 | 5 | 176 | 4 | 172 | 23 | 166 | 0 | 91 | 23 | 85 | 19 | 0 | 2 | 35 |
23,542 | facebook/watchman | watchman/python/pywatchman/windows.py | pywatchman.windows.OVERLAPPED | import ctypes.wintypes
import ctypes
class OVERLAPPED(ctypes.Structure):
_fields_ = [('Internal', ULONG_PTR), ('InternalHigh', ULONG_PTR), ('Offset', wintypes.DWORD), ('OffsetHigh', wintypes.DWORD), ('hEvent', wintypes.HANDLE)]
def __init__(self):
self.Internal = 0
self.InternalHigh = 0
... |
class OVERLAPPED(ctypes.Structure):
def __init__(self):
pass | 2 | 0 | 6 | 0 | 6 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 5 | 1 | 1 | 15 | 1 | 14 | 8 | 12 | 0 | 8 | 8 | 6 | 1 | 0 | 0 | 1 |
23,543 | facebook/watchman | watchman/python/pywatchman/windows.py | pywatchman.windows.SOCKADDR_UN | import ctypes.wintypes
import ctypes
class SOCKADDR_UN(ctypes.Structure):
_fields_ = [('sun_family', ctypes.c_ushort), ('sun_path', ctypes.c_char * 108)] |
class SOCKADDR_UN(ctypes.Structure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 2 | 2 | 1 | 0 | 2 | 2 | 1 | 0 | 0 | 0 | 0 |
23,544 | facebook/watchman | watchman/python/pywatchman/windows.py | pywatchman.windows.WSAData64 | import ctypes.wintypes
import ctypes
class WSAData64(ctypes.Structure):
_fields_ = [('wVersion', ctypes.c_ushort), ('wHighVersion', ctypes.c_ushort), ('iMaxSockets', ctypes.c_ushort), ('iMaxUdpDg', ctypes.c_ushort), ('lpVendorInfo', ctypes.c_char_p), ('szDescription', ctypes.c_ushort * WSADESCRIPTION_LEN), ('szSys... |
class WSAData64(ctypes.Structure):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0 | 10 | 2 | 9 | 0 | 2 | 2 | 1 | 0 | 0 | 0 | 0 |
23,545 | facebook/watchman | watchman/python/pywatchman/windows.py | pywatchman.windows.WindowsSocketException | class WindowsSocketException(Exception):
def __init__(self, code: int) -> None:
super(WindowsSocketException, self).__init__('Windows Socket Error: {}'.format(code)) | class WindowsSocketException(Exception):
def __init__(self, code: int) -> None:
pass | 2 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 1 | 2 | 0 | 0 | 1 | 0 | 1 | 11 | 5 | 0 | 5 | 2 | 3 | 0 | 3 | 2 | 1 | 1 | 3 | 0 | 1 |
23,546 | facebook/watchman | watchman/python/pywatchman/windows.py | pywatchman.windows.WindowsSocketHandle | import socket
import ctypes.wintypes
import os
import ctypes
class WindowsSocketHandle:
AF_UNIX = 1
SOCK_STREAM = 1
fd: int = -1
address: str = ''
@staticmethod
def _checkReturnCode(retcode):
if retcode == -1:
errcode = WSAGetLastError()
if errcode == WSAETIMEDO... |
class WindowsSocketHandle:
@staticmethod
def _checkReturnCode(retcode):
pass
def __init__(self):
pass
def fileno(self) -> int:
pass
def settimeout(self, timeout: int) -> None:
pass
def connect(self, address: str) -> None:
pass
def send(self, buf... | 13 | 0 | 6 | 0 | 6 | 0 | 2 | 0.04 | 0 | 7 | 3 | 0 | 10 | 0 | 11 | 11 | 87 | 13 | 71 | 27 | 58 | 3 | 55 | 26 | 43 | 3 | 0 | 2 | 17 |
23,547 | facebook/watchman | watchman/python/pywatchman_aio/__init__.py | pywatchman_aio.AIOClient | import os
import typing
from pywatchman import CommandError, encoding, WatchmanError
import asyncio
class AIOClient:
"""Create and manage an asyncio Watchman connection.
Example usage:
with await AIOClient.from_socket() as client:
res = await client.query(...)
# ... use res ...
... |
class AIOClient:
'''Create and manage an asyncio Watchman connection.
Example usage:
with await AIOClient.from_socket() as client:
res = await client.query(...)
# ... use res ...
await client.query(
'subscribe',
root_dir,
sub_name,
... | 21 | 10 | 8 | 1 | 6 | 1 | 2 | 0.38 | 0 | 7 | 5 | 0 | 17 | 7 | 18 | 18 | 190 | 33 | 114 | 42 | 93 | 43 | 107 | 38 | 87 | 5 | 0 | 3 | 38 |
23,548 | facebook/watchman | watchman/python/pywatchman_aio/__init__.py | pywatchman_aio.AsyncBserCodec | from pywatchman import CommandError, encoding, WatchmanError
class AsyncBserCodec(AsyncCodec):
"""Use the BSER encoding."""
async def receive(self):
sniff = await self.transport.read(SNIFF_LEN)
if not sniff:
raise WatchmanError('empty watchman response')
_1, _2, elen = bser... |
class AsyncBserCodec(AsyncCodec):
'''Use the BSER encoding.'''
async def receive(self):
pass
async def send(self, *args):
pass
def _loads(self, response):
'''Parse the BSER packet'''
pass | 4 | 2 | 10 | 0 | 9 | 0 | 2 | 0.07 | 1 | 4 | 1 | 0 | 3 | 0 | 3 | 7 | 34 | 3 | 29 | 13 | 25 | 2 | 24 | 12 | 20 | 4 | 1 | 1 | 6 |
23,549 | facebook/watchman | watchman/python/pywatchman_aio/__init__.py | pywatchman_aio.AsyncCodec | class AsyncCodec:
"""Communication encoding for the Watchman service."""
def __init__(self, transport):
self.transport = transport
async def receive(self):
"""Read from the underlying transport, parse and return the message."""
raise NotImplementedError()
async def send(self, ... | class AsyncCodec:
'''Communication encoding for the Watchman service.'''
def __init__(self, transport):
pass
async def receive(self):
'''Read from the underlying transport, parse and return the message.'''
pass
async def send(self, *args):
'''Send the given message via... | 5 | 4 | 3 | 0 | 2 | 1 | 1 | 0.44 | 0 | 1 | 0 | 1 | 4 | 1 | 4 | 4 | 17 | 4 | 9 | 6 | 4 | 4 | 9 | 6 | 4 | 1 | 0 | 0 | 4 |
23,550 | facebook/watchman | watchman/python/pywatchman_aio/__init__.py | pywatchman_aio.AsyncTransport | class AsyncTransport:
"""Communication transport to the Watchman Service."""
async def activate(self, **kwargs):
"""Make the transport ready for use. Optional for subclasses."""
pass
async def read(self, size):
"""Read 'size' bytes from the transport."""
raise NotImplemente... | class AsyncTransport:
'''Communication transport to the Watchman Service.'''
async def activate(self, **kwargs):
'''Make the transport ready for use. Optional for subclasses.'''
pass
async def read(self, size):
'''Read 'size' bytes from the transport.'''
pass
async def write(self, buf... | 5 | 5 | 3 | 0 | 2 | 1 | 1 | 0.56 | 0 | 1 | 0 | 1 | 4 | 0 | 4 | 4 | 18 | 4 | 9 | 5 | 4 | 5 | 9 | 5 | 4 | 1 | 0 | 0 | 4 |
23,551 | facebook/watchman | watchman/python/pywatchman_aio/__init__.py | pywatchman_aio.AsyncUnixSocketTransport | import asyncio
class AsyncUnixSocketTransport(AsyncTransport):
"""Local Unix domain socket transport supporting asyncio."""
def __init__(self):
self.sockname = None
self.reader = None
self.writer = None
async def activate(self, **kwargs):
reader, writer = await asyncio.ope... |
class AsyncUnixSocketTransport(AsyncTransport):
'''Local Unix domain socket transport supporting asyncio.'''
def __init__(self):
pass
async def activate(self, **kwargs):
pass
async def write(self, data):
pass
async def read(self, size):
pass
def close(self):... | 6 | 1 | 4 | 0 | 4 | 0 | 1 | 0.1 | 1 | 1 | 0 | 0 | 5 | 3 | 5 | 9 | 27 | 5 | 20 | 11 | 14 | 2 | 20 | 11 | 14 | 2 | 1 | 1 | 7 |
23,552 | facebook/watchman | watchman/python/pywatchman_aio/__init__.py | pywatchman_aio.ReceiveLoopError | class ReceiveLoopError(Exception):
pass | class ReceiveLoopError(Exception):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 2 | 0 | 2 | 1 | 1 | 0 | 2 | 1 | 1 | 0 | 3 | 0 | 0 |
23,553 | andymccurdy/redis-py | andymccurdy_redis-py/benchmarks/base.py | benchmarks.base.Benchmark | import itertools
import redis
import functools
import timeit
import sys
class Benchmark:
ARGUMENTS = ()
def __init__(self):
self._client = None
def get_client(self, **kwargs):
if self._client is None or kwargs:
defaults = {'db': 9}
defaults.update(kwargs)
... |
class Benchmark:
def __init__(self):
pass
def get_client(self, **kwargs):
pass
def setup(self, **kwargs):
pass
def run(self, **kwargs):
pass
def run_benchmark(self):
pass | 6 | 0 | 6 | 0 | 5 | 0 | 1 | 0.07 | 0 | 7 | 2 | 2 | 5 | 1 | 5 | 5 | 36 | 5 | 29 | 19 | 23 | 2 | 29 | 19 | 23 | 2 | 0 | 1 | 7 |
23,554 | andymccurdy/redis-py | andymccurdy_redis-py/benchmarks/command_packer_benchmark.py | benchmarks.command_packer_benchmark.CommandPackerBenchmark | from base import Benchmark
class CommandPackerBenchmark(Benchmark):
ARGUMENTS = ({'name': 'connection_class', 'values': [StringJoiningConnection, ListJoiningConnection]}, {'name': 'value_size', 'values': [10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000]})
def setup(self, connection_class, value_siz... |
class CommandPackerBenchmark(Benchmark):
def setup(self, connection_class, value_size):
pass
def run(self, connection_class, value_size):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 7 | 20 | 3 | 17 | 6 | 14 | 0 | 8 | 6 | 5 | 1 | 1 | 0 | 2 |
23,555 | andymccurdy/redis-py | andymccurdy_redis-py/benchmarks/command_packer_benchmark.py | benchmarks.command_packer_benchmark.ListJoiningConnection | from redis.connection import SYM_CRLF, SYM_DOLLAR, SYM_EMPTY, SYM_STAR, Connection
class ListJoiningConnection(Connection):
def send_packed_command(self, command, check_health=True):
if not self._sock:
self.connect()
try:
if isinstance(command, str):
command... |
class ListJoiningConnection(Connection):
def send_packed_command(self, command, check_health=True):
pass
def pack_command(self, *args):
pass | 3 | 0 | 18 | 1 | 18 | 0 | 5 | 0 | 1 | 5 | 0 | 0 | 2 | 0 | 2 | 52 | 38 | 2 | 36 | 9 | 33 | 0 | 30 | 8 | 27 | 7 | 3 | 2 | 10 |
23,556 | andymccurdy/redis-py | andymccurdy_redis-py/benchmarks/command_packer_benchmark.py | benchmarks.command_packer_benchmark.StringJoiningConnection | from redis.connection import SYM_CRLF, SYM_DOLLAR, SYM_EMPTY, SYM_STAR, Connection
class StringJoiningConnection(Connection):
def send_packed_command(self, command, check_health=True):
"""Send an already packed command to the Redis server"""
if not self._sock:
self.connect()
tr... |
class StringJoiningConnection(Connection):
def send_packed_command(self, command, check_health=True):
'''Send an already packed command to the Redis server'''
pass
def pack_command(self, *args):
'''Pack a series of arguments into a value Redis command'''
pass | 3 | 2 | 15 | 0 | 14 | 1 | 3 | 0.07 | 1 | 5 | 0 | 0 | 2 | 0 | 2 | 52 | 32 | 1 | 29 | 7 | 26 | 2 | 19 | 6 | 16 | 5 | 3 | 2 | 6 |
23,557 | andymccurdy/redis-py | andymccurdy_redis-py/benchmarks/socket_read_size.py | benchmarks.socket_read_size.SocketReadBenchmark | from redis.connection import PythonParser, _HiredisParser
from base import Benchmark
class SocketReadBenchmark(Benchmark):
ARGUMENTS = ({'name': 'parser', 'values': [PythonParser, _HiredisParser]}, {'name': 'value_size', 'values': [10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000]}, {'name': 'read_size',... |
class SocketReadBenchmark(Benchmark):
def setup(self, value_size, read_size, parser):
pass
def run(self, value_size, read_size, parser):
pass | 3 | 0 | 3 | 0 | 3 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 2 | 0 | 2 | 7 | 18 | 3 | 15 | 6 | 12 | 0 | 8 | 6 | 5 | 1 | 1 | 0 | 2 |
23,558 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/base.py | redis._parsers.base.AsyncBaseParser | from asyncio import IncompleteReadError, StreamReader, TimeoutError
from typing import Awaitable, Callable, List, Optional, Protocol, Union
from ..typing import EncodableT
from ..exceptions import AskError, AuthenticationError, AuthenticationWrongNumberOfArgsError, BusyLoadingError, ClusterCrossSlotError, ClusterDownEr... |
class AsyncBaseParser(BaseParser):
'''Base parsing class for the python-backed async parser'''
def __init__(self, socket_read_size: int):
pass
async def can_read_destructive(self) -> bool:
pass
async def read_response(self, disable_decoding: bool=False) -> Union[EncodableT, ResponseE... | 4 | 1 | 3 | 0 | 3 | 0 | 1 | 0.09 | 1 | 5 | 1 | 1 | 3 | 2 | 3 | 26 | 16 | 4 | 11 | 9 | 5 | 1 | 9 | 7 | 5 | 1 | 5 | 0 | 3 |
23,559 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/base.py | redis._parsers.base.BaseParser | from ..exceptions import AskError, AuthenticationError, AuthenticationWrongNumberOfArgsError, BusyLoadingError, ClusterCrossSlotError, ClusterDownError, ConnectionError, ExecAbortError, MasterDownError, ModuleError, MovedError, NoPermissionError, NoScriptError, OutOfMemoryError, ReadOnlyError, RedisError, ResponseError... |
class BaseParser(ABC):
@classmethod
def parse_error(cls, response):
'''Parse an error response'''
pass
def on_disconnect(self):
pass
def on_connect(self, connection):
pass | 5 | 1 | 5 | 0 | 4 | 0 | 2 | 0.11 | 1 | 3 | 1 | 2 | 2 | 0 | 3 | 23 | 52 | 3 | 44 | 8 | 39 | 5 | 15 | 7 | 11 | 3 | 4 | 2 | 5 |
23,560 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/base.py | redis._parsers.base._AsyncRESPBase | from .encoders import Encoder
from ..exceptions import AskError, AuthenticationError, AuthenticationWrongNumberOfArgsError, BusyLoadingError, ClusterCrossSlotError, ClusterDownError, ConnectionError, ExecAbortError, MasterDownError, ModuleError, MovedError, NoPermissionError, NoScriptError, OutOfMemoryError, ReadOnlyEr... |
class _AsyncRESPBase(AsyncBaseParser):
'''Base class for async resp parsing'''
def __init__(self, socket_read_size: int):
pass
def _clear(self):
pass
def on_connect(self, connection):
'''Called when the stream connects'''
pass
def on_disconnect(self):
'''... | 8 | 5 | 9 | 0 | 8 | 1 | 2 | 0.19 | 1 | 9 | 2 | 2 | 7 | 6 | 7 | 33 | 77 | 8 | 58 | 25 | 50 | 11 | 56 | 24 | 48 | 4 | 6 | 2 | 15 |
23,561 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/base.py | redis._parsers.base._RESPBase | from .socket import SERVER_CLOSED_CONNECTION_ERROR, SocketBuffer
class _RESPBase(BaseParser):
"""Base class for sync-based resp parsing"""
def __init__(self, socket_read_size):
self.socket_read_size = socket_read_size
self.encoder = None
self._sock = None
self._buffer = None
... |
class _RESPBase(BaseParser):
'''Base class for sync-based resp parsing'''
def __init__(self, socket_read_size):
pass
def __del__(self):
pass
def on_connect(self, connection):
'''Called when the socket connects'''
pass
def on_disconnect(self):
'''Called wh... | 6 | 3 | 5 | 0 | 5 | 0 | 1 | 0.12 | 1 | 2 | 1 | 2 | 5 | 4 | 5 | 28 | 33 | 5 | 25 | 10 | 19 | 3 | 23 | 10 | 17 | 2 | 5 | 1 | 7 |
23,562 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/commands.py | redis._parsers.commands.AbstractCommandsParser | from redis.utils import str_if_bytes
class AbstractCommandsParser:
def _get_pubsub_keys(self, *args):
"""
Get the keys from pubsub command.
Although PubSub commands have predetermined key locations, they are not
supported in the 'COMMAND's output, so the key positions are hardcoded... |
class AbstractCommandsParser:
def _get_pubsub_keys(self, *args):
'''
Get the keys from pubsub command.
Although PubSub commands have predetermined key locations, they are not
supported in the 'COMMAND's output, so the key positions are hardcoded
in this method
'''
... | 3 | 1 | 21 | 0 | 15 | 7 | 4 | 0.43 | 0 | 2 | 0 | 2 | 2 | 0 | 2 | 2 | 44 | 1 | 30 | 8 | 27 | 13 | 28 | 8 | 25 | 6 | 0 | 2 | 8 |
23,563 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/commands.py | redis._parsers.commands.AsyncCommandsParser | from typing import TYPE_CHECKING, Any, Dict, Optional, Tuple, Union
from redis.utils import str_if_bytes
from redis.exceptions import RedisError, ResponseError
class AsyncCommandsParser(AbstractCommandsParser):
"""
Parses Redis commands to get command keys.
COMMAND output is used to determine key location... |
class AsyncCommandsParser(AbstractCommandsParser):
'''
Parses Redis commands to get command keys.
COMMAND output is used to determine key locations.
Commands that do not have a predefined key location are flagged with 'movablekeys',
and these commands' keys are determined by the command 'COMMAND GE... | 5 | 2 | 21 | 2 | 16 | 4 | 5 | 0.45 | 1 | 7 | 2 | 0 | 4 | 2 | 4 | 6 | 109 | 15 | 65 | 21 | 60 | 29 | 50 | 20 | 45 | 13 | 1 | 5 | 19 |
23,564 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/commands.py | redis._parsers.commands.CommandsParser | from redis.utils import str_if_bytes
from redis.exceptions import RedisError, ResponseError
class CommandsParser(AbstractCommandsParser):
"""
Parses Redis commands to get command keys.
COMMAND output is used to determine key locations.
Commands that do not have a predefined key location are flagged wit... |
class CommandsParser(AbstractCommandsParser):
'''
Parses Redis commands to get command keys.
COMMAND output is used to determine key locations.
Commands that do not have a predefined key location are flagged with
'movablekeys', and these commands' keys are determined by the command
'COMMAND GET... | 5 | 3 | 25 | 2 | 17 | 6 | 5 | 0.49 | 1 | 4 | 2 | 0 | 4 | 1 | 4 | 6 | 115 | 11 | 70 | 22 | 65 | 34 | 55 | 21 | 50 | 13 | 1 | 5 | 21 |
23,565 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/encoders.py | redis._parsers.encoders.Encoder | from ..exceptions import DataError
class Encoder:
"""Encode strings to bytes-like and decode bytes-like to strings"""
__slots__ = ('encoding', 'encoding_errors', 'decode_responses')
def __init__(self, encoding, encoding_errors, decode_responses):
self.encoding = encoding
self.encoding_erro... |
class Encoder:
'''Encode strings to bytes-like and decode bytes-like to strings'''
def __init__(self, encoding, encoding_errors, decode_responses):
pass
def encode(self, value):
'''Return a bytestring or bytes-like representation of the value'''
pass
def decode(self, value, f... | 4 | 3 | 11 | 0 | 10 | 1 | 4 | 0.16 | 0 | 8 | 1 | 0 | 3 | 3 | 3 | 3 | 41 | 4 | 32 | 9 | 28 | 5 | 23 | 9 | 19 | 6 | 0 | 2 | 11 |
23,566 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/hiredis.py | redis._parsers.hiredis._AsyncHiredisParser | import asyncio
from .socket import NONBLOCKING_EXCEPTION_ERROR_NUMBERS, NONBLOCKING_EXCEPTIONS, SENTINEL, SERVER_CLOSED_CONNECTION_ERROR
from logging import getLogger
from ..exceptions import ConnectionError, InvalidResponse, RedisError
from ..utils import HIREDIS_AVAILABLE
from typing import Callable, List, Optional, ... |
class _AsyncHiredisParser(AsyncBaseParser, AsyncPushNotificationsParser):
'''Async implementation of parser class for connections using Hiredis'''
def __init__(self, socket_read_size: int):
pass
async def handle_pubsub_push_response(self, response):
pass
def on_connect(self, connecti... | 8 | 1 | 12 | 1 | 10 | 1 | 3 | 0.15 | 1 | 10 | 3 | 0 | 6 | 3 | 6 | 6 | 82 | 11 | 62 | 17 | 52 | 9 | 49 | 15 | 41 | 7 | 1 | 2 | 18 |
23,567 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/hiredis.py | redis._parsers.hiredis._HiredisParser | from ..exceptions import ConnectionError, InvalidResponse, RedisError
from ..utils import HIREDIS_AVAILABLE
from logging import getLogger
from .base import AsyncBaseParser, AsyncPushNotificationsParser, BaseParser, PushNotificationsParser
from .socket import NONBLOCKING_EXCEPTION_ERROR_NUMBERS, NONBLOCKING_EXCEPTIONS, ... |
class _HiredisParser(BaseParser, PushNotificationsParser):
'''Parser class for connections using Hiredis'''
def __init__(self, socket_read_size):
pass
def __del__(self):
pass
def handle_pubsub_push_response(self, response):
pass
def on_connect(self, connection, **kwargs)... | 9 | 1 | 14 | 1 | 12 | 1 | 4 | 0.13 | 1 | 7 | 2 | 0 | 7 | 6 | 7 | 7 | 110 | 13 | 86 | 21 | 77 | 11 | 73 | 20 | 64 | 8 | 1 | 2 | 27 |
23,568 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/hiredis.py | redis._parsers.hiredis._HiredisReaderArgs | from typing import Callable, List, Optional, TypedDict, Union
class _HiredisReaderArgs(TypedDict, total=False):
protocolError: Callable[[str], Exception]
replyError: Callable[[str], Exception]
encoding: Optional[str]
errors: Optional[str] |
class _HiredisReaderArgs(TypedDict, total=False):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 5 | 1 | 4 | 0 | 5 | 1 | 4 | 0 | 1 | 0 | 0 |
23,569 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/resp2.py | redis._parsers.resp2._AsyncRESP2Parser | from typing import Any, Union
from .base import _AsyncRESPBase, _RESPBase
from ..exceptions import ConnectionError, InvalidResponse, ResponseError
from ..typing import EncodableT
from .socket import SERVER_CLOSED_CONNECTION_ERROR
class _AsyncRESP2Parser(_AsyncRESPBase):
"""Async class for the RESP2 protocol"""
... |
class _AsyncRESP2Parser(_AsyncRESPBase):
'''Async class for the RESP2 protocol'''
async def read_response(self, disable_decoding: bool=False):
pass
async def _read_response(self, disable_decoding: bool=False) -> Union[EncodableT, ResponseError, None]:
pass | 3 | 1 | 29 | 1 | 22 | 8 | 7 | 0.36 | 1 | 7 | 2 | 0 | 2 | 1 | 2 | 35 | 62 | 4 | 44 | 11 | 39 | 16 | 32 | 8 | 29 | 10 | 7 | 2 | 13 |
23,570 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/resp2.py | redis._parsers.resp2._RESP2Parser | from ..exceptions import ConnectionError, InvalidResponse, ResponseError
from .base import _AsyncRESPBase, _RESPBase
from .socket import SERVER_CLOSED_CONNECTION_ERROR
class _RESP2Parser(_RESPBase):
"""RESP2 protocol implementation"""
def read_response(self, disable_decoding=False):
pos = self._buffer... |
class _RESP2Parser(_RESPBase):
'''RESP2 protocol implementation'''
def read_response(self, disable_decoding=False):
pass
def _read_response(self, disable_decoding=False):
pass | 3 | 1 | 28 | 2 | 21 | 6 | 8 | 0.28 | 1 | 5 | 1 | 0 | 2 | 0 | 2 | 30 | 60 | 5 | 43 | 9 | 40 | 12 | 33 | 8 | 30 | 11 | 6 | 2 | 15 |
23,571 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/resp3.py | redis._parsers.resp3._AsyncRESP3Parser | from .base import AsyncPushNotificationsParser, PushNotificationsParser, _AsyncRESPBase, _RESPBase
from ..typing import EncodableT
from .socket import SERVER_CLOSED_CONNECTION_ERROR
from ..exceptions import ConnectionError, InvalidResponse, ResponseError
from logging import getLogger
from typing import Any, Union
clas... |
class _AsyncRESP3Parser(_AsyncRESPBase, AsyncPushNotificationsParser):
def __init__(self, socket_read_size):
pass
async def handle_pubsub_push_response(self, response):
pass
async def read_response(self, disable_decoding: bool=False, push_request: bool=False):
pass
async def... | 5 | 0 | 19 | 0 | 14 | 4 | 4 | 0.28 | 1 | 11 | 2 | 0 | 7 | 3 | 7 | 40 | 138 | 9 | 102 | 23 | 90 | 29 | 64 | 18 | 56 | 19 | 7 | 2 | 28 |
23,572 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/resp3.py | redis._parsers.resp3._RESP3Parser | from logging import getLogger
from ..exceptions import ConnectionError, InvalidResponse, ResponseError
from .base import AsyncPushNotificationsParser, PushNotificationsParser, _AsyncRESPBase, _RESPBase
from .socket import SERVER_CLOSED_CONNECTION_ERROR
class _RESP3Parser(_RESPBase, PushNotificationsParser):
"""RES... |
class _RESP3Parser(_RESPBase, PushNotificationsParser):
'''RESP3 protocol implementation'''
def __init__(self, socket_read_size):
pass
def handle_pubsub_push_response(self, response):
pass
def read_response(self, disable_decoding=False, push_request=False):
pass
def _rea... | 5 | 1 | 17 | 0 | 14 | 3 | 4 | 0.26 | 1 | 9 | 1 | 0 | 7 | 2 | 7 | 35 | 131 | 10 | 97 | 19 | 89 | 25 | 65 | 18 | 57 | 19 | 6 | 2 | 30 |
23,573 | andymccurdy/redis-py | andymccurdy_redis-py/redis/_parsers/socket.py | redis._parsers.socket.SocketBuffer | from ..exceptions import ConnectionError, TimeoutError
from typing import Optional, Union
import io
import socket
from io import SEEK_END
class SocketBuffer:
def __init__(self, socket: socket.socket, socket_read_size: int, socket_timeout: float):
self._sock = socket
self.socket_read_size = socket_... |
class SocketBuffer:
def __init__(self, socket: socket.socket, socket_read_size: int, socket_timeout: float):
pass
def unread_bytes(self) -> int:
'''
Remaining unread length of buffer
'''
pass
def _read_from_socket(self, length: Optional[int]=None, timeout: Union[f... | 11 | 4 | 12 | 1 | 9 | 3 | 2 | 0.33 | 0 | 8 | 0 | 0 | 10 | 4 | 10 | 10 | 134 | 14 | 91 | 40 | 73 | 30 | 81 | 32 | 70 | 10 | 0 | 3 | 24 |
23,574 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.AsyncPubsubWorkerExceptionHandler | from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union, cast
class AsyncPubsubWorkerExceptionHandler(Protocol):
async def __call__(self, e: BaseException, pubsub: PubSub):
... |
class AsyncPubsubWorkerExceptionHandler(Protocol):
async def __call__(self, e: BaseException, pubsub: PubSub):
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 25 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
23,575 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.AsyncResponseCallbackProtocol | from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union, cast
class AsyncResponseCallbackProtocol(Protocol):
async def __call__(self, response: Any, **kwargs):
... |
class AsyncResponseCallbackProtocol(Protocol):
async def __call__(self, response: Any, **kwargs):
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 25 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
23,576 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.Monitor | from redis._parsers.helpers import _RedisCallbacks, _RedisCallbacksRESP2, _RedisCallbacksRESP3, bool_ok
from redis.exceptions import ConnectionError, ExecAbortError, PubSubError, RedisError, ResponseError, WatchError
from redis.asyncio.connection import Connection, ConnectionPool, SSLConnection, UnixDomainSocketConnect... |
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: ConnectionPool):
pass
async def connect(self):
... | 7 | 3 | 9 | 0 | 8 | 1 | 2 | 0.24 | 0 | 7 | 4 | 0 | 6 | 2 | 6 | 6 | 71 | 8 | 51 | 19 | 44 | 12 | 42 | 19 | 35 | 4 | 0 | 1 | 12 |
23,577 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.MonitorCommandInfo | from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union, cast
class MonitorCommandInfo(TypedDict):
time: float
db: int
client_address: str
client_port: str
client_type: ... |
class MonitorCommandInfo(TypedDict):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 | 7 | 1 | 6 | 0 | 7 | 1 | 6 | 0 | 1 | 0 | 0 |
23,578 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.Pipeline | from redis.utils import SSL_AVAILABLE, _set_info_logger, deprecated_args, deprecated_function, get_lib_version, safe_str, str_if_bytes, truncate_text
from redis.typing import ChannelT, EncodableT, KeyT
import inspect
from redis.asyncio.connection import Connection, ConnectionPool, SSLConnection, UnixDomainSocketConnect... |
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... | 26 | 12 | 13 | 1 | 9 | 3 | 3 | 0.39 | 1 | 20 | 6 | 1 | 25 | 9 | 25 | 281 | 370 | 48 | 234 | 84 | 192 | 91 | 186 | 65 | 160 | 16 | 11 | 4 | 67 |
23,579 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.PubSub | from redis.exceptions import ConnectionError, ExecAbortError, PubSubError, RedisError, ResponseError, WatchError
from redis.asyncio.connection import Connection, ConnectionPool, SSLConnection, UnixDomainSocketConnection
from redis.typing import ChannelT, EncodableT, KeyT
from redis.commands import AsyncCoreCommands, As... |
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.
'... | 29 | 20 | 16 | 1 | 11 | 4 | 3 | 0.38 | 0 | 15 | 6 | 0 | 25 | 13 | 25 | 25 | 439 | 44 | 288 | 92 | 244 | 110 | 207 | 73 | 181 | 16 | 0 | 3 | 77 |
23,580 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.PubsubWorkerExceptionHandler | from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union, cast
class PubsubWorkerExceptionHandler(Protocol):
def __call__(self, e: BaseException, pubsub: PubSub):
... |
class PubsubWorkerExceptionHandler(Protocol):
def __call__(self, e: BaseException, pubsub: PubSub):
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 1 | 0 | 1 | 25 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
23,581 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.Redis | import asyncio
import copy
from redis.asyncio.lock import Lock
from redis.client import EMPTY_RESPONSE, NEVER_DECODE, AbstractRedis, CaseInsensitiveDict
from redis.exceptions import ConnectionError, ExecAbortError, PubSubError, RedisError, ResponseError, WatchError
from redis.asyncio.retry import Retry
from redis.async... | null | 34 | 22 | 20 | 1 | 12 | 6 | 2 | 0.49 | 4 | 30 | 17 | 1 | 25 | 6 | 27 | 256 | 583 | 69 | 345 | 125 | 239 | 169 | 159 | 47 | 131 | 9 | 10 | 4 | 59 |
23,582 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/client.py | redis.asyncio.client.ResponseCallbackProtocol | from typing import TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, List, Mapping, MutableMapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union, cast
class ResponseCallbackProtocol(Protocol):
def __call__(self, response: Any, **kwargs):
... |
class ResponseCallbackProtocol(Protocol):
def __call__(self, response: Any, **kwargs):
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 25 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
23,583 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/cluster.py | redis.asyncio.cluster.ClusterNode | from redis.event import AfterAsyncClusterInstantiationEvent, EventDispatcher
import socket
from redis.client import EMPTY_RESPONSE, NEVER_DECODE, AbstractRedis
from redis.asyncio.connection import Connection, SSLConnection, parse_url
import collections
from redis.backoff import ExponentialWithJitterBackoff, NoBackoff
i... |
class ClusterNode:
'''
Create a new ClusterNode.
Each ClusterNode manages multiple :class:`~redis.asyncio.connection.Connection`
objects for the (host, port).
'''
def __init__(self, host: str, port: Union[str, int], server_type: Optional[str]=None, *, max_connections: int=2 ** 31, connection_c... | 13 | 3 | 15 | 1 | 12 | 1 | 3 | 0.14 | 0 | 14 | 6 | 0 | 11 | 11 | 11 | 11 | 195 | 30 | 145 | 52 | 118 | 20 | 95 | 36 | 83 | 6 | 0 | 3 | 28 |
23,584 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/cluster.py | redis.asyncio.cluster.ClusterPipeline | from redis.typing import AnyKeyT, EncodableT, KeyT
from typing import Any, Callable, Coroutine, Deque, Dict, Generator, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union
from redis.commands import READ_COMMANDS, AsyncRedisClusterCommands
from redis.cluster import PIPELINE_BLOCKED_COMMANDS, PRIMARY, REPLICA, SLO... |
class ClusterPipeline(AbstractRedis, AbstractRedisCluster, AsyncRedisClusterCommands):
'''
Create a new ClusterPipeline object.
Usage::
result = await (
rc.pipeline()
.set("A", 1)
.get("A")
.hset("K", "F", "V")
.hgetall("K")
.m... | 18 | 9 | 13 | 1 | 10 | 2 | 3 | 0.45 | 3 | 14 | 6 | 0 | 14 | 2 | 14 | 412 | 239 | 40 | 138 | 52 | 109 | 62 | 98 | 36 | 83 | 17 | 11 | 5 | 39 |
23,585 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/cluster.py | redis.asyncio.cluster.NodesManager | from redis.exceptions import AskError, BusyLoadingError, ClusterDownError, ClusterError, ConnectionError, CrossSlotTransactionError, DataError, ExecAbortError, InvalidPipelineStack, MaxConnectionsError, MovedError, RedisClusterException, RedisError, ResponseError, SlotNotCoveredError, TimeoutError, TryAgainError, Watch... |
class NodesManager:
def __init__(self, startup_nodes: List['ClusterNode'], require_full_coverage: bool, connection_kwargs: Dict[str, Any], dynamic_startup_nodes: bool=True, address_remap: Optional[Callable[[Tuple[str, int]], Tuple[str, int]]]=None, event_dispatcher: Optional[EventDispatcher]=None) -> None:
... | 11 | 1 | 30 | 2 | 23 | 5 | 5 | 0.21 | 0 | 18 | 9 | 0 | 9 | 10 | 9 | 9 | 293 | 25 | 224 | 68 | 195 | 46 | 141 | 48 | 131 | 20 | 0 | 6 | 46 |
23,586 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/cluster.py | redis.asyncio.cluster.PipelineCommand | from typing import Any, Callable, Coroutine, Deque, Dict, Generator, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union
class PipelineCommand:
def __init__(self, position: int, *args: Any, **kwargs: Any) -> None:
self.args = args
self.kwargs = kwargs
self.position = position
... |
class PipelineCommand:
def __init__(self, position: int, *args: Any, **kwargs: Any) -> None:
pass
def __repr__(self) -> str:
pass | 3 | 0 | 4 | 0 | 4 | 0 | 1 | 0 | 0 | 4 | 0 | 0 | 2 | 4 | 2 | 2 | 9 | 1 | 8 | 7 | 5 | 0 | 8 | 7 | 5 | 1 | 0 | 0 | 2 |
23,587 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/cluster.py | redis.asyncio.cluster.RedisCluster | from typing import Any, Callable, Coroutine, Deque, Dict, Generator, List, Mapping, Optional, Set, Tuple, Type, TypeVar, Union
from redis.utils import SSL_AVAILABLE, deprecated_args, deprecated_function, get_lib_version, safe_str, str_if_bytes, truncate_text
from redis.commands import READ_COMMANDS, AsyncRedisClusterCo... | null | 39 | 25 | 22 | 2 | 14 | 6 | 3 | 0.53 | 3 | 36 | 19 | 0 | 31 | 17 | 32 | 430 | 832 | 99 | 478 | 149 | 376 | 255 | 275 | 78 | 242 | 13 | 11 | 4 | 104 |
23,588 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.AbstractConnection | from redis.exceptions import AuthenticationError, AuthenticationWrongNumberOfArgsError, ConnectionError, DataError, RedisError, ResponseError, TimeoutError
from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
from ..event import AsyncAfterConnectionR... | null | 37 | 17 | 18 | 1 | 14 | 3 | 4 | 0.19 | 0 | 32 | 12 | 2 | 30 | 25 | 30 | 30 | 592 | 52 | 457 | 129 | 388 | 86 | 311 | 86 | 280 | 20 | 0 | 4 | 115 |
23,589 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.AsyncConnectCallbackProtocol | from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
class AsyncConnectCallbackProtocol(Protocol):
async def __call__(self, connection: 'AbstractConnection'):
... |
class AsyncConnectCallbackProtocol(Protocol):
async def __call__(self, connection: 'AbstractConnection'):
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 25 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
23,590 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.BlockingConnectionPool | from ..utils import deprecated_args, format_error_message
from redis.exceptions import AuthenticationError, AuthenticationWrongNumberOfArgsError, ConnectionError, DataError, RedisError, ResponseError, TimeoutError
import asyncio
from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, ... |
class BlockingConnectionPool(ConnectionPool):
'''
A blocking connection pool::
>>> from redis.asyncio import Redis, BlockingConnectionPool
>>> client = Redis.from_pool(BlockingConnectionPool())
It performs the same function as the default
:py:class:`~redis.asyncio.ConnectionPool` implem... | 5 | 3 | 12 | 0 | 11 | 1 | 2 | 0.82 | 1 | 7 | 2 | 0 | 3 | 2 | 3 | 19 | 73 | 12 | 34 | 15 | 23 | 28 | 23 | 7 | 19 | 3 | 1 | 3 | 5 |
23,591 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.ConnectCallbackProtocol | from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
class ConnectCallbackProtocol(Protocol):
def __call__(self, connection: 'AbstractConnection'):
... |
class ConnectCallbackProtocol(Protocol):
def __call__(self, connection: 'AbstractConnection'):
pass | 2 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 25 | 2 | 0 | 2 | 2 | 1 | 0 | 3 | 2 | 1 | 1 | 5 | 0 | 1 |
23,592 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.ConnectKwargs | from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
class ConnectKwargs(TypedDict, total=False):
username: str
password: str
connection_class: Type[AbstractConnection]
host: str
port: int
db: int
path: str |
class ConnectKwargs(TypedDict, total=False):
pass | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 | 8 | 1 | 7 | 0 | 8 | 1 | 7 | 0 | 1 | 0 | 0 |
23,593 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.Connection | from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
import asyncio
import socket
class Connection(AbstractConnection):
"""Manages TCP communication to and from a Redis server"""
def __init__(self, *, host: str='localhost', port: Union[str,... |
class Connection(AbstractConnection):
'''Manages TCP communication to and from a Redis server'''
def __init__(self, *, host: str='localhost', port: Union[str, int]=6379, socket_keepalive: bool=False, socket_keepalive_options: Optional[Mapping[int, Union[int, bytes]]]=None, socket_type: int=0, **kwargs):
... | 6 | 2 | 10 | 0 | 9 | 1 | 2 | 0.11 | 1 | 7 | 0 | 3 | 5 | 7 | 5 | 35 | 55 | 6 | 44 | 26 | 29 | 5 | 33 | 17 | 27 | 5 | 1 | 4 | 10 |
23,594 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.ConnectionPool | from itertools import chain
import asyncio
from redis.exceptions import AuthenticationError, AuthenticationWrongNumberOfArgsError, ConnectionError, DataError, RedisError, ResponseError, TimeoutError
import weakref
from ..event import AsyncAfterConnectionReleasedEvent, EventDispatcher
from ..utils import deprecated_args... | null | 19 | 11 | 12 | 1 | 7 | 3 | 2 | 0.55 | 0 | 17 | 6 | 2 | 15 | 8 | 16 | 16 | 216 | 33 | 118 | 40 | 95 | 65 | 87 | 34 | 70 | 4 | 0 | 2 | 30 |
23,595 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.RedisSSLContext | from ..utils import SSL_AVAILABLE
from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
from redis.exceptions import AuthenticationError, AuthenticationWrongNumberOfArgsError, ConnectionError, DataError, RedisError, ResponseError, TimeoutError
class ... |
class RedisSSLContext:
def __init__(self, keyfile: Optional[str]=None, certfile: Optional[str]=None, cert_reqs: Optional[Union[str, ssl.VerifyMode]]=None, ca_certs: Optional[str]=None, ca_data: Optional[str]=None, check_hostname: bool=False, min_version: Optional[TLSVersion]=None, ciphers: Optional[str]=None):
... | 3 | 0 | 24 | 0 | 24 | 0 | 5 | 0 | 0 | 5 | 1 | 0 | 2 | 9 | 2 | 2 | 61 | 2 | 59 | 25 | 46 | 0 | 32 | 15 | 29 | 6 | 0 | 2 | 10 |
23,596 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.SSLConnection | from redis.exceptions import AuthenticationError, AuthenticationWrongNumberOfArgsError, ConnectionError, DataError, RedisError, ResponseError, TimeoutError
from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
from ..utils import SSL_AVAILABLE
class ... |
class SSLConnection(Connection):
'''Manages SSL connections to and from the Redis server(s).
This class extends the Connection class, adding SSL functionality, and making
use of ssl.SSLContext (https://docs.python.org/3/library/ssl.html#ssl.SSLContext)
'''
def __init__(self, ssl_keyfile: Optional[... | 17 | 1 | 5 | 0 | 5 | 0 | 1 | 0.08 | 1 | 5 | 1 | 1 | 9 | 1 | 9 | 44 | 62 | 9 | 49 | 30 | 21 | 4 | 22 | 12 | 12 | 1 | 2 | 0 | 9 |
23,597 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection.UnixDomainSocketConnection | import asyncio
from typing import Any, Callable, Iterable, List, Mapping, Optional, Protocol, Set, Tuple, Type, TypedDict, TypeVar, Union
class UnixDomainSocketConnection(AbstractConnection):
"""Manages UDS communication to and from a Redis server"""
def __init__(self, *, path: str='', **kwargs):
self... |
class UnixDomainSocketConnection(AbstractConnection):
'''Manages UDS communication to and from a Redis server'''
def __init__(self, *, path: str='', **kwargs):
pass
def repr_pieces(self) -> Iterable[Tuple[str, Union[str, int]]]:
pass
async def _connect(self):
pass
def _h... | 5 | 1 | 4 | 0 | 4 | 0 | 1 | 0.06 | 1 | 3 | 0 | 0 | 4 | 3 | 4 | 34 | 22 | 4 | 17 | 10 | 12 | 1 | 17 | 10 | 12 | 2 | 1 | 1 | 5 |
23,598 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/connection.py | redis.asyncio.connection._Sentinel | import enum
class _Sentinel(enum.Enum):
sentinel = object() |
class _Sentinel(enum.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,599 | andymccurdy/redis-py | andymccurdy_redis-py/redis/asyncio/lock.py | redis.asyncio.lock.Lock | import asyncio
from redis.typing import Number
from typing import TYPE_CHECKING, Awaitable, Optional, Union
import threading
from redis.exceptions import LockError, LockNotOwnedError
from types import SimpleNamespace
import uuid
class Lock:
"""
A shared, distributed Lock. Using Redis for locking allows the Loc... |
class Lock:
'''
A shared, distributed Lock. Using Redis for locking allows the Lock
to be shared across processes and/or machines.
It's left to the user to resolve deadlock issues and make sure
multiple clients play nicely together.
'''
def __init__(self, redis: Union['Redis', 'RedisCluste... | 15 | 8 | 16 | 1 | 10 | 6 | 3 | 0.56 | 0 | 10 | 2 | 0 | 14 | 8 | 14 | 14 | 301 | 32 | 172 | 56 | 141 | 97 | 108 | 40 | 93 | 10 | 0 | 2 | 40 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.