language stringclasses 1
value | repo stringclasses 346
values | path stringlengths 6 201 | class_span dict | source stringlengths 21 2.38M | target stringlengths 1 96 |
|---|---|---|---|---|---|
python | getsentry__sentry | tests/sentry/auth/test_system.py | {
"start": 253,
"end": 821
} | class ____(TestCase):
def test_is_system_auth(self) -> None:
token = SystemToken()
assert is_system_auth(token)
assert not is_system_auth({})
@django_db_all
@control_silo_test
def test_system_token_option() -> None:
from sentry import options
options.delete("sentry:system-token")
... | TestSystemAuth |
python | getsentry__sentry | src/sentry/insights/__init__.py | {
"start": 82,
"end": 3033
} | class ____(NamedTuple):
"""Interface for detecting relevant Insights modules for a span.
Spans in transactions have a different schema than spans from Kafka. Going through this interface
makes the classification schema-agnostic.
"""
op: str | None
category: str | None
description: str | No... | FilterSpan |
python | run-llama__llama_index | llama-index-integrations/readers/llama-index-readers-patentsview/llama_index/readers/patentsview/base.py | {
"start": 251,
"end": 1454
} | class ____(BaseReader):
"""
Patentsview reader.
Read patent abstract.
"""
def __init__(self) -> None:
"""Initialize with request body."""
self.json = {"q": {"patent_id": None}, "f": ["patent_abstract"]}
def load_data(self, patent_number: List[str]) -> List[Document]:
... | PatentsviewReader |
python | doocs__leetcode | solution/1600-1699/1632.Rank Transform of a Matrix/Solution.py | {
"start": 0,
"end": 614
} | class ____:
def __init__(self, n):
self.p = list(range(n))
self.size = [1] * n
def find(self, x):
if self.p[x] != x:
self.p[x] = self.find(self.p[x])
return self.p[x]
def union(self, a, b):
pa, pb = self.find(a), self.find(b)
if pa != pb:
... | UnionFind |
python | spyder-ide__spyder | external-deps/spyder-kernels/spyder_kernels/console/outstream.py | {
"start": 434,
"end": 2587
} | class ____(OutStream):
"""Subclass of OutStream that represents a TTY."""
def __init__(self, session, pub_thread, name, pipe=None, echo=None, *,
watchfd=True):
super().__init__(session, pub_thread, name, pipe,
echo=echo, watchfd=watchfd, isatty=True)
def _... | TTYOutStream |
python | scipy__scipy | scipy/signal/tests/test_upfirdn.py | {
"start": 2493,
"end": 4879
} | class ____:
"""Test _UpFIRDn object"""
def __init__(self, up, down, h, x_dtype, *, xp=None):
if xp is None:
xp = np_compat
self.up = up
self.down = down
self.h = np.atleast_1d(h)
self.x_dtype = x_dtype
self.rng = np.random.RandomState(17)
self.... | UpFIRDnCase |
python | weaviate__weaviate-python-client | weaviate/exceptions.py | {
"start": 4430,
"end": 4601
} | class ____(WeaviateBaseError):
"""Occurs when an HTTP request unexpectedly returns an empty response."""
EmptyResponseException = EmptyResponseError
| EmptyResponseError |
python | sqlalchemy__sqlalchemy | lib/sqlalchemy/event/attr.py | {
"start": 19680,
"end": 21549
} | class ____(_CompoundListener[_ET]):
__slots__ = "parent_dispatch", "name", "local", "parent_listeners"
parent_dispatch: _DispatchCommon[_ET]
name: str
local: _InstanceLevelDispatch[_ET]
parent_listeners: Collection[_ListenerFnType]
def __init__(
self,
parent_dispatch: _Dispatch... | _JoinedListener |
python | apache__airflow | devel-common/src/docs/build_docs.py | {
"start": 6335,
"end": 30533
} | class ____(NamedTuple):
"""Result of spellcheck."""
package_name: str
log_file_name: Path
spelling_errors: list[SpellingError]
build_errors: list[DocBuildError]
def perform_docs_build_for_single_package(build_specification: BuildSpecification) -> BuildDocsResult:
"""Performs single package do... | SpellCheckResult |
python | pytorch__pytorch | test/quantization/core/test_workflow_ops.py | {
"start": 11540,
"end": 53276
} | class ____(TestCase):
@given(device=st.sampled_from(['cpu', 'cuda'] if torch.cuda.is_available() else ['cpu']),
X=hu.tensor(shapes=hu.array_shapes(1, 5,),
qparams=hu.qparams(dtypes=torch.quint8)))
def test_forward_per_tensor(self, device, X):
r"""Tests the forward path ... | TestFakeQuantizeOps |
python | doocs__leetcode | solution/3200-3299/3239.Minimum Number of Flips to Make Binary Grid Palindromic I/Solution.py | {
"start": 0,
"end": 446
} | class ____:
def minFlips(self, grid: List[List[int]]) -> int:
m, n = len(grid), len(grid[0])
cnt1 = cnt2 = 0
for row in grid:
for j in range(n // 2):
if row[j] != row[n - j - 1]:
cnt1 += 1
for j in range(n):
for i in range(m... | Solution |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.