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
apache__airflow
dev/breeze/src/airflow_breeze/utils/parallel.py
{ "start": 3692, "end": 3958 }
class ____(metaclass=ABCMeta): @abstractmethod def get_best_matching_lines(self, output: Output) -> list[str] | None: """ Return best matching lines of the output. :return: array of lines to print """
AbstractProgressInfoMatcher
python
walkccc__LeetCode
solutions/1476. Subrectangle Queries/1476.py
{ "start": 0, "end": 517 }
class ____: def __init__(self, rectangle: list[list[int]]): self.rectangle = rectangle self.updates = [] def updateSubrectangle(self, row1: int, col1: int, row2: int, col2: int, newValue: int) -> None: self.updates.append((row1, col1, row2, col2, newValue)) def getValue(self...
SubrectangleQueries
python
jmcnamara__XlsxWriter
xlsxwriter/test/comparison/test_chart_size04.py
{ "start": 315, "end": 1392 }
class ____(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.set_filename("chart_size04.xlsx") def test_create_file(self): """Test XlsxWriter chartarea properties.""" workbook = Workbook(self.got_filename)...
TestCompareXLSXFiles
python
mlflow__mlflow
mlflow/spark/__init__.py
{ "start": 44357, "end": 54631 }
class ____: """ Wrapper around Spark MLlib PipelineModel providing interface for scoring pandas DataFrame. """ def __init__(self, spark, spark_model, signature): self.spark = spark self.spark_model = spark_model self.signature = signature def get_raw_model(self): ""...
_PyFuncModelWrapper
python
airbytehq__airbyte
airbyte-integrations/connectors/source-github/source_github/github_schema.py
{ "start": 1229609, "end": 1229876 }
class ____(sgqlc.types.Type, Node, AuditEntry, EnterpriseAuditEntryData, OrganizationAuditEntryData): """Audit log entry for a members_can_delete_repos.disable event.""" __schema__ = github_schema __field_names__ = ()
MembersCanDeleteReposDisableAuditEntry
python
networkx__networkx
networkx/classes/tests/test_graph_historical.py
{ "start": 108, "end": 258 }
class ____(HistoricalTests): @classmethod def setup_class(cls): HistoricalTests.setup_class() cls.G = nx.Graph
TestGraphHistorical
python
conda__conda
conda/models/dist.py
{ "start": 715, "end": 855 }
class ____(NamedTuple): name: str version: str build_string: str build_number: str dist_name: str fmt: str
DistDetails
python
airbytehq__airbyte
airbyte-integrations/connectors/source-github/source_github/github_schema.py
{ "start": 48746, "end": 49283 }
class ____(sgqlc.types.Enum): """The reason an outside collaborator was removed from an Organization. Enumeration Choices: * `SAML_EXTERNAL_IDENTITY_MISSING`: SAML external identity missing * `TWO_FACTOR_REQUIREMENT_NON_COMPLIANCE`: The organization required 2FA of its billing managers and t...
OrgRemoveOutsideCollaboratorAuditEntryReason
python
pytorch__pytorch
torch/ao/nn/intrinsic/modules/fused.py
{ "start": 9891, "end": 10317 }
class ____(_FusedModule): r"""This is a sequential container which calls the Conv2d, add, Relu. During quantization this will be replaced with the corresponding fused module.""" def __init__(self, conv, add, relu): super().__init__(conv) self.add = add self.relu = relu def forw...
ConvAddReLU2d
python
huggingface__transformers
src/transformers/models/zoedepth/modeling_zoedepth.py
{ "start": 19878, "end": 23127 }
class ____(nn.Module): def __init__(self, config, n_bins=16, mlp_dim=256, min_depth=1e-3, max_depth=10): """Bin center regressor network. Can be "normed" or "unnormed". If "normed", bin centers are bounded on the (min_depth, max_depth) interval. Args: config (`int`): ...
ZoeDepthSeedBinRegressor
python
apache__thrift
lib/py/src/server/TServer.py
{ "start": 1033, "end": 3016 }
class ____(object): """Base interface for a server, which must have a serve() method. Three constructors for all servers: 1) (processor, serverTransport) 2) (processor, serverTransport, transportFactory, protocolFactory) 3) (processor, serverTransport, inputTransportFactory, outputTransport...
TServer
python
wandb__wandb
tests/system_tests/test_importers/test_mlflow/conftest.py
{ "start": 1394, "end": 9414 }
class ____: # experiments and metrics n_experiments: int n_runs_per_experiment: int n_steps_per_run: int # artifacts n_artifacts: int n_root_files: int n_subdirs: int n_subdir_files: int # batching logging_batch_size: int = 50 @property def total_runs(self): ...
MlflowLoggingConfig
python
ray-project__ray
rllib/utils/schedules/piecewise_schedule.py
{ "start": 439, "end": 4172 }
class ____(Schedule): """Implements a Piecewise Scheduler.""" def __init__( self, endpoints: List[Tuple[int, float]], framework: Optional[str] = None, interpolation: Callable[ [TensorType, TensorType, TensorType], TensorType ] = _linear_interpolation, ...
PiecewiseSchedule
python
catalyst-team__catalyst
catalyst/contrib/datasets/imagenette.py
{ "start": 942, "end": 1470 }
class ____(ImageClassificationDataset): """ `Imagenette <https://github.com/fastai/imagenette#imagenette-1>`_ Dataset with images resized so that the shortest size is 320 px. .. note:: catalyst[cv] required for this dataset. """ name = "imagenette2-320" resources = [ ( ...
Imagenette320
python
Lightning-AI__lightning
tests/tests_pytorch/plugins/test_amp_plugins.py
{ "start": 884, "end": 1944 }
class ____(MixedPrecision): pass @RunIf(mps=False) @mock.patch.dict( os.environ, { "CUDA_VISIBLE_DEVICES": "0,1", "SLURM_NTASKS": "2", "SLURM_NTASKS_PER_NODE": "1", "SLURM_JOB_NAME": "SOME_NAME", "SLURM_NODEID": "0", "LOCAL_RANK": "0", "SLURM_PROCID"...
MyAMP
python
astropy__astropy
astropy/io/fits/diff.py
{ "start": 42833, "end": 45994 }
class ____(ImageDataDiff): """ `RawDataDiff` is just a special case of `ImageDataDiff` where the images are one-dimensional, and the data is treated as a 1-dimensional array of bytes instead of pixel values. This is used to compare the data of two non-standard extension HDUs that were not recognize...
RawDataDiff
python
prompt-toolkit__python-prompt-toolkit
src/prompt_toolkit/input/base.py
{ "start": 2587, "end": 4030 }
class ____(Input): """ Input for use in a `DummyApplication` If used in an actual application, it will make the application render itself once and exit immediately, due to an `EOFError`. """ def fileno(self) -> int: raise NotImplementedError def typeahead_hash(self) -> str: ...
DummyInput
python
getsentry__sentry
tests/sentry/runner/commands/test_init.py
{ "start": 105, "end": 1029 }
class ____(CliTestCase): command = init def test_simple(self) -> None: with self.runner.isolated_filesystem(): rv = self.invoke("config") assert rv.exit_code == 0, rv.output contents = os.listdir("config") assert set(contents) == {"sentry.conf.py", "confi...
InitTest
python
google__jax
docs/autodidax.py
{ "start": 25723, "end": 25806 }
class ____: pass not_mapped = NotMapped() BatchAxis = Union[NotMapped, int]
NotMapped
python
wandb__wandb
wandb/automations/_filters/run_metrics.py
{ "start": 4931, "end": 6969 }
class ____(BaseMetricFilter): # from: RunMetricChangeFilter """Filter that compares a **change** in a metric value to a user-defined threshold. The change is calculated over "tumbling" windows, i.e. the difference between the current window and the non-overlapping prior window. """ name: str ...
MetricChangeFilter
python
rapidsai__cudf
cpp/scripts/gdb-pretty-printers.py
{ "start": 547, "end": 1000 }
class ____(gdb.printing.PrettyPrinter): """Print a cudf::host_span""" def __init__(self, val): self.val = val self.pointer = val["_data"] self.size = int(val["_size"]) def children(self): return HostIterator(self.pointer, self.size) def to_string(self): return ...
CudfHostSpanPrinter
python
google__jax
jax/_src/pallas/mosaic_gpu/lowering.py
{ "start": 6690, "end": 12954 }
class ____(Protocol): def __call__( self, ctx: ResourceEstimatorContext, *args: Any, **params: Any ) -> Resources: ... _resource_estimators: dict[jax_core.Primitive, ResourceEstimator] = {} def _register_resource_estimator(primitive: jax_core.Primitive): def deco(fn): _resource_estimators[primi...
ResourceEstimator
python
encode__httpx
httpx/_exceptions.py
{ "start": 3754, "end": 3848 }
class ____(NetworkError): """ Failed to receive data from the network. """
ReadError
python
scikit-learn__scikit-learn
sklearn/ensemble/_bagging.py
{ "start": 8550, "end": 23682 }
class ____(BaseEnsemble, metaclass=ABCMeta): """Base class for Bagging meta-estimator. Warning: This class should not be used directly. Use derived classes instead. """ _parameter_constraints: dict = { "estimator": [HasMethods(["fit", "predict"]), None], "n_estimators": [Interval(I...
BaseBagging
python
django-guardian__django-guardian
example_project/articles/tests.py
{ "start": 372, "end": 3840 }
class ____(TestCase): def setUp(self): self.article = Article.objects.create(title="foo-title", slug="foo-slug", content="bar-content") self.factory = RequestFactory() self.user = get_user_model().objects.create_user("joe", "joe@doe.com", "doe") self.client.login(username="joe", pass...
ViewUserTestCase
python
getsentry__sentry
src/sentry/runner/commands/backup.py
{ "start": 7733, "end": 8059 }
class ____(Printer): """ A printer that only asks for confirmations, and is otherwise silent. """ def confirm( self, text: str, *, default: bool | None = None, err: bool = False, ) -> bool: return click.confirm(text, default=default, err=err)
InputOnlyPrinter
python
zarr-developers__zarr-python
src/zarr/core/indexing.py
{ "start": 41324, "end": 46673 }
class ____(Indexer): sel_shape: tuple[int, ...] selection: CoordinateSelectionNormalized sel_sort: npt.NDArray[np.intp] | None chunk_nitems_cumsum: npt.NDArray[np.intp] chunk_rixs: npt.NDArray[np.intp] chunk_mixs: tuple[npt.NDArray[np.intp], ...] shape: tuple[int, ...] chunk_shape: tuple...
CoordinateIndexer
python
scipy__scipy
scipy/interpolate/tests/test_bsplines.py
{ "start": 65121, "end": 71946 }
class ____: # # Test make_lsq_spline # rng = np.random.RandomState(1234) n, k = 13, 3 x = np.sort(rng.random(n)) y = rng.random(n) t = _augknt(np.linspace(x[0], x[-1], 7), k) @parametrize_lsq_methods def test_lstsq(self, method): # check LSQ construction vs a full matrix...
TestLSQ
python
pytorch__pytorch
test/torch_np/numpy_tests/core/test_numeric.py
{ "start": 26880, "end": 34529 }
class ____(TestCase): def check_promotion_cases(self, promote_func): # tests that the scalars get coerced correctly. b = np.bool_(0) i8, i16, i32, i64 = np.int8(0), np.int16(0), np.int32(0), np.int64(0) u8 = np.uint8(0) f32, f64 = np.float32(0), np.float64(0) c64, c12...
TestTypes
python
wandb__wandb
wandb/vendor/pygments/formatters/img.py
{ "start": 1420, "end": 7329 }
class ____(object): """ Manages a set of fonts: normal, italic, bold, etc... """ def __init__(self, font_name, font_size=14): self.font_name = font_name self.font_size = font_size self.fonts = {} self.encoding = None if sys.platform.startswith('win'): ...
FontManager
python
rapidsai__cudf
python/cudf/cudf/core/dtypes.py
{ "start": 5273, "end": 12720 }
class ____(_BaseDtype): """ Type for categorical data with the categories and orderedness. Parameters ---------- categories : sequence, optional Must be unique, and must not contain any nulls. The categories are stored in an Index, and if an index is provided the dtype of th...
CategoricalDtype
python
pytest-dev__pytest
src/_pytest/reports.py
{ "start": 16483, "end": 23230 }
class ____(TerminalRepr): def __init__(self, msg: str) -> None: self.longrepr = msg def toterminal(self, out: TerminalWriter) -> None: out.line(self.longrepr, red=True) def pytest_report_to_serializable( report: CollectReport | TestReport, ) -> dict[str, Any] | None: if isinstance(rep...
CollectErrorRepr
python
explosion__spaCy
spacy/lang/fo/__init__.py
{ "start": 375, "end": 471 }
class ____(Language): lang = "fo" Defaults = FaroeseDefaults __all__ = ["Faroese"]
Faroese
python
allegroai__clearml
clearml/backend_api/services/v2_23/queues.py
{ "start": 58854, "end": 61173 }
class ____(Request): """ Gets the next task from the top of the queue (FIFO). The task entry is removed from the queue. :param queue: Queue id :type queue: str :param get_task_info: If set then additional task info is returned :type get_task_info: bool :param task: Task company ID :type...
GetNextTaskRequest
python
dagster-io__dagster
python_modules/dagster-graphql/dagster_graphql/schema/roots/mutation.py
{ "start": 32186, "end": 32746 }
class ____(graphene.Mutation): """Toggle asset auto materializing on or off.""" Output = graphene.NonNull(graphene.Boolean) class Meta: name = "SetAutoMaterializedPausedMutation" class Arguments: paused = graphene.Argument(graphene.NonNull(graphene.Boolean)) @capture_error @c...
GrapheneSetAutoMaterializePausedMutation
python
walkccc__LeetCode
solutions/2192. All Ancestors of a Node in a Directed Acyclic Graph/2192-2.py
{ "start": 0, "end": 674 }
class ____: def getAncestors(self, n: int, edges: list[list[int]]) -> list[list[int]]: ans = [set() for _ in range(n)] graph = [[] for _ in range(n)] inDegrees = [0] * n # Build the graph. for u, v in edges: graph[u].append(v) inDegrees[v] += 1 # Perform topological sorting. ...
Solution
python
tensorflow__tensorflow
tensorflow/python/kernel_tests/nn_ops/morphological_ops_test.py
{ "start": 12198, "end": 20997 }
class ____(test.TestCase): def _VerifyValues(self, image, kernel, strides, rates, padding, out, use_gpu): """Verifies the output values of the erosion function. Args: image: Input tensor with shape: [batch, in_height, in_width, channels]. kernel: Filter tensor with shape: [filter_height, filter_...
ErosionTest
python
realpython__materials
gemini-cli/todolist/src/todolist/exporter.py
{ "start": 282, "end": 417 }
class ____(TypedDict, total=False): indent: int | str | None separators: tuple[str, str] | None sort_keys: bool
FormatOptions
python
tensorflow__tensorflow
tensorflow/python/training/server_lib.py
{ "start": 18031, "end": 21276 }
class ____: """Represent a collection of device filters for the remote workers in cluster. NOTE: this is an experimental API and subject to changes. Set device filters for selective jobs and tasks. For each remote worker, the device filters are a list of strings. When any filters are present, the remote wor...
ClusterDeviceFilters
python
getsentry__sentry
src/sentry_plugins/heroku/plugin.py
{ "start": 5175, "end": 7807 }
class ____(CorePluginMixin, ReleaseTrackingPlugin): author = "Sentry Team" author_url = "https://github.com/getsentry" title = "Heroku" slug = "heroku" description = "Integrate Heroku release tracking." required_field = "repository" feature_descriptions = [ FeatureDescription( ...
HerokuPlugin
python
pytorch__pytorch
torch/ao/quantization/fx/_model_report/model_report_visualizer.py
{ "start": 411, "end": 32667 }
class ____: r""" The ModelReportVisualizer class aims to provide users a way to visualize some of the statistics that were generated by the ModelReport API. However, at a higher level, the class aims to provide some level of visualization of statistics to PyTorch in order to make it easier to parse data...
ModelReportVisualizer
python
plotly__plotly.py
plotly/graph_objs/image/_legendgrouptitle.py
{ "start": 233, "end": 2925 }
class ____(_BaseTraceHierarchyType): _parent_path_str = "image" _path_str = "image.legendgrouptitle" _valid_props = {"font", "text"} @property def font(self): """ Sets this legend group's title font. The 'font' property is an instance of Font that may be specified a...
Legendgrouptitle
python
mlflow__mlflow
tests/tensorflow/test_tensorflow2_autolog.py
{ "start": 17795, "end": 52385 }
class ____: def __init__(self, data, target, batch_size): self.data = data self.target = target self.batch_size = batch_size self.ptr = 0 def __next__(self): if self.ptr >= len(self.data): raise StopIteration idx = self.ptr % len(self.data) se...
__GeneratorClassMultiInput
python
airbytehq__airbyte
airbyte-integrations/connectors/destination-chroma/destination_chroma/indexer.py
{ "start": 684, "end": 5108 }
class ____(Indexer): def __init__(self, config: ChromaIndexingConfigModel): super().__init__(config) self.collection_name = config.collection_name def check(self): collection_name_validation_error = is_valid_collection_name(self.collection_name) if collection_name_validation_err...
ChromaIndexer
python
gevent__gevent
src/greentest/3.14/test__interpreters.py
{ "start": 3743, "end": 3976 }
class ____(TestBase): def test_import_in_interpreter(self): _run_output( _interpreters.create(), 'import _interpreters', ) ################################## # interpreter tests
ModuleTests
python
weaviate__weaviate-python-client
weaviate/client.py
{ "start": 9216, "end": 9835 }
class ____: def __init__( self, ) -> None: raise ValueError( """ Python client v3 `weaviate.Client(...)` has been removed. Upgrade your code to use Python client v4 `weaviate.WeaviateClient` connections and methods. - For Python Client v4 usage, see: https://weaviate.io/develope...
Client
python
apache__airflow
providers/opensearch/tests/system/opensearch/example_opensearch.py
{ "start": 1613, "end": 4310 }
class ____(Document): log_group_id = Integer() logger = Text() message = Text() class Index: name = INDEX_NAME def save(self, **kwargs): super().save(**kwargs) def load_connections(): # Connections needed for this example dag to finish from airflow.models import Connectio...
LogDocument
python
chroma-core__chroma
chromadb/test/conftest.py
{ "start": 27770, "end": 28126 }
class ____(AsyncAdminClient): pass @pytest.fixture(scope="function") def api(system: System) -> Generator[ServerAPI, None, None]: system.reset_state() api = system.instance(ServerAPI) if isinstance(api, AsyncFastAPI): transformed = async_class_to_sync(api) yield transformed else: ...
AsyncAdminClientSync
python
kamyu104__LeetCode-Solutions
Python/find-the-maximum-length-of-a-good-subsequence-i.py
{ "start": 665, "end": 1180 }
class ____(object): def maximumLength(self, nums, k): """ :type nums: List[int] :type k: int :rtype: int """ dp = [collections.defaultdict(int) for _ in xrange(k+1)] result = [0]*(k+1) for x in nums: for i in reversed(xrange(k+1)): ...
Solution2
python
pypa__pip
src/pip/_vendor/urllib3/exceptions.py
{ "start": 1657, "end": 2194 }
class ____(RequestError): """Raised when the maximum number of retries is exceeded. :param pool: The connection pool :type pool: :class:`~urllib3.connectionpool.HTTPConnectionPool` :param string url: The requested Url :param exceptions.Exception reason: The underlying error """ def __init...
MaxRetryError
python
openai__gym
gym/envs/mujoco/humanoidstandup_v4.py
{ "start": 109, "end": 21674 }
class ____(MujocoEnv, utils.EzPickle): """ ### Description This environment is based on the environment introduced by Tassa, Erez and Todorov in ["Synthesis and stabilization of complex behaviors through online trajectory optimization"](https://ieeexplore.ieee.org/document/6386025). The 3D bipedal ...
HumanoidStandupEnv
python
ansible__ansible
test/lib/ansible_test/_util/controller/sanity/yamllint/yamllinter.py
{ "start": 675, "end": 2320 }
class ____(SafeConstructor): """Yaml Safe Constructor that knows about Ansible tags.""" def construct_yaml_unsafe(self, node): """Construct an unsafe tag.""" return self._resolve_and_construct_object(node) def construct_yaml_vault(self, node): """Construct a vault tag.""" c...
TestConstructor
python
wandb__wandb
wandb/apis/paginator.py
{ "start": 621, "end": 720 }
class ____(Protocol): def execute(self, *args: Any, **kwargs: Any) -> dict[str, Any]: ...
_Client
python
ray-project__ray
python/ray/train/v2/_internal/execution/storage.py
{ "start": 1238, "end": 10599 }
class ____(LocalFileSystem): """LocalFileSystem wrapper to exclude files according to patterns. Args: root_path: Root path to strip when matching with the exclude pattern. Ex: root_path="/tmp/a/b/c", exclude=["*a*"], will exclude /tmp/a/b/c/_a_.txt but not ALL of /tmp/a/*. ...
_ExcludingLocalFilesystem
python
tensorflow__tensorflow
tensorflow/tools/compatibility/all_renames_v2_test.py
{ "start": 888, "end": 1219 }
class ____(test_util.TensorFlowTestCase): def test_no_identity_renames(self): identity_renames = [ old_name for old_name, new_name in all_renames_v2.symbol_renames.items() if old_name == new_name ] self.assertEmpty(identity_renames) if __name__ == "__main__": test_lib.main()
AllRenamesV2Test
python
eriklindernoren__ML-From-Scratch
mlfromscratch/deep_learning/layers.py
{ "start": 17213, "end": 18978 }
class ____(Layer): """Adds rows and columns of constant values to the input. Expects the input to be of shape (batch_size, channels, height, width) Parameters: ----------- padding: tuple The amount of padding along the height and width dimension of the input. If (pad_h, pad_w) the s...
ConstantPadding2D
python
py-pdf__pypdf
pypdf/_protocols.py
{ "start": 1432, "end": 1714 }
class ____(PdfCommonDocProtocol, Protocol): @property @abstractmethod def xref(self) -> dict[int, dict[int, Any]]: ... # pragma: no cover @property @abstractmethod def trailer(self) -> dict[str, Any]: ... # pragma: no cover
PdfReaderProtocol
python
apache__airflow
providers/edge3/src/airflow/providers/edge3/worker_api/datamodels.py
{ "start": 3712, "end": 4027 }
class ____(BaseModel): """Queues that a worker supports to run jobs on.""" queues: Annotated[ list[str] | None, Field( None, description="List of queues the worker is pulling jobs from. If not provided, worker pulls from all queues.", ), ]
WorkerQueuesBase
python
google__jax
tests/lax_numpy_indexing_test.py
{ "start": 1603, "end": 18044 }
class ____(typing.NamedTuple): shape: tuple[int, ...] indexer: Any out_shape: tuple[int, ...] | None = None def check_grads(f, args, order, atol=None, rtol=None, eps=None): # TODO(mattjj,dougalm): add higher-order check default_tol = 1e-6 if config.enable_x64.value else 1e-2 atol = atol or default_tol r...
IndexSpec
python
google__flatbuffers
grpc/examples/python/greeter/greeter_grpc.fb.py
{ "start": 529, "end": 1433 }
class ____(object): """Interface exported by the server.""" def SayHello(self, request, context): context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def SayManyHellos(self, request, context): context...
GreeterServicer
python
explosion__spaCy
spacy/lang/ko/__init__.py
{ "start": 684, "end": 3063 }
class ____(DummyTokenizer): def __init__(self, vocab: Vocab): self.vocab = vocab self._mecab = try_mecab_import() # type: ignore[func-returns-value] self._mecab_tokenizer = None @property def mecab_tokenizer(self): # This is a property so that initializing a pipeline with b...
KoreanTokenizer
python
pytorch__pytorch
torch/utils/data/datapipes/datapipe.py
{ "start": 10131, "end": 10223 }
class ____(IterDataPipe): def _is_dfpipe(self) -> bool: return True
DFIterDataPipe
python
walkccc__LeetCode
solutions/48. Rotate Image/48-2.py
{ "start": 0, "end": 404 }
class ____: def rotate(self, matrix: list[list[int]]) -> None: for mn in range(len(matrix) // 2): mx = len(matrix) - mn - 1 for i in range(mn, mx): offset = i - mn top = matrix[mn][i] matrix[mn][i] = matrix[mx - offset][mn] matrix[mx - offset][mn] = matrix[mx][mx - offs...
Solution
python
great-expectations__great_expectations
contrib/great_expectations_zipcode_expectations/great_expectations_zipcode_expectations/expectations/expect_column_values_to_be_valid_oregon_zip.py
{ "start": 1735, "end": 4062 }
class ____(ColumnMapExpectation): """Expect values in this column to be valid Oregon zipcodes. See https://pypi.org/project/zipcodes/ for more information. """ # These examples will be shown in the public gallery. # They will also be executed as unit tests for your Expectation. examples = [ ...
ExpectColumnValuesToBeValidOregonZip
python
pytorch__pytorch
test/dynamo/test_graph_deduplication.py
{ "start": 17221, "end": 50910 }
class ____(torch.nn.Module): def forward(self, primals_1: "f32[10, 10]", primals_2: "f32[10, 20]"): add: "f32[10, 20]" = torch.ops.aten.add.Tensor(primals_2, 2); primals_2 = None sum_1: "f32[]" = torch.ops.aten.sum.default(add); add = None partitioned_fw_subgraph_0_0 = self.partitioned_f...
GraphModule
python
eventlet__eventlet
tests/timer_test.py
{ "start": 113, "end": 1018 }
class ____(TestCase): def test_copy(self): t = timer.Timer(0, lambda: None) t2 = t.copy() assert t.seconds == t2.seconds assert t.tpl == t2.tpl assert t.called == t2.called def test_schedule(self): hub = hubs.get_hub() # clean up the runloop, preventing s...
TestTimer
python
run-llama__llama_index
llama-index-integrations/tools/llama-index-tools-brightdata/tests/test_tools_brightdata.py
{ "start": 243, "end": 2662 }
class ____(unittest.TestCase): def test_class_inheritance(self): """Test that BrightDataToolSpec inherits from BaseToolSpec.""" names_of_base_classes = [b.__name__ for b in BrightDataToolSpec.__mro__] self.assertIn(BaseToolSpec.__name__, names_of_base_classes) def test_initialization(se...
TestBrightDataToolSpec
python
apache__airflow
providers/amazon/src/airflow/providers/amazon/aws/hooks/batch_waiters.py
{ "start": 1466, "end": 10958 }
class ____(BatchClientHook): """ A utility to manage waiters for AWS Batch services. .. code-block:: python import random from airflow.providers.amazon.aws.operators.batch_waiters import BatchWaiters # to inspect default waiters waiters = BatchWaiters() config = wa...
BatchWaitersHook
python
spack__spack
var/spack/test_repos/spack_repo/builtin_mock/packages/wrong_variant_in_depends_on/package.py
{ "start": 216, "end": 511 }
class ____(Package): """This package has a wrong variant spelled in a depends_on.""" homepage = "http://www.example.com" url = "http://www.example.com/b-1.0.tar.gz" version("1.0", md5="0123456789abcdef0123456789abcdef") depends_on("pkg-b+doesnotexist")
WrongVariantInDependsOn
python
kamyu104__LeetCode-Solutions
Python/get-the-maximum-score.py
{ "start": 33, "end": 814 }
class ____(object): def maxSum(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: int """ MOD = 10**9+7 i, j = 0, 0 result, sum1, sum2 = 0, 0, 0, while i != len(nums1) or j != len(nums2): if i != len(nums...
Solution
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/protocol43.py
{ "start": 551, "end": 872 }
class ____(Protocol): def __add__(self: A, other: A) -> A: ... T2 = TypeVar("T2", bound=HasAdd2) def merge_element_lists2(a: Sequence[T2], b: Sequence[T2]) -> Sequence[T2]: retval: Sequence[T2] = [] for a_elem in a: for b_elem in b: retval.append(a_elem + b_elem) return retval
HasAdd2
python
rapidsai__cudf
python/cudf_polars/cudf_polars/experimental/rapidsmpf/utils.py
{ "start": 2116, "end": 3915 }
class ____: """ A pair of channels for metadata and table data. This abstraction ensures that metadata and data are kept separate, avoiding ordering issues and making the code more type-safe. Attributes ---------- metadata : Channel for metadata. data : Channel for tabl...
ChannelPair
python
ethereum__web3.py
ens/base_ens.py
{ "start": 568, "end": 3490 }
class ____: w3: Union["AsyncWeb3[Any]", "Web3"] = None ens: Union["Contract", "AsyncContract"] = None _resolver_contract: type["Contract"] | type["AsyncContract"] = None _reverse_resolver_contract: type["Contract"] | type["AsyncContract"] = None @property def strict_bytes_type_checking(self) ->...
BaseENS
python
ray-project__ray
python/ray/tune/stopper/stopper.py
{ "start": 1723, "end": 3079 }
class ____(Stopper): """Combine several stoppers via 'OR'. Args: *stoppers: Stoppers to be combined. Examples: >>> import numpy as np >>> from ray import tune >>> from ray.tune.stopper import ( ... CombinedStopper, ... MaximumIterationStopper, ...
CombinedStopper
python
h5py__h5py
h5py/tests/test_file.py
{ "start": 29623, "end": 30739 }
class ____(TestCase): """ Feature: Create file that switches on SWMR mode """ def test_file_mode_generalizes(self): fname = self.mktemp() fid = File(fname, 'w', libver='latest') g = fid.create_group('foo') # fid and group member file attribute should have the same m...
TestSWMRMode
python
eriklindernoren__ML-From-Scratch
mlfromscratch/deep_learning/optimizers.py
{ "start": 869, "end": 1580 }
class ____(): def __init__(self, learning_rate=0.001, momentum=0.4): self.learning_rate = learning_rate self.momentum = momentum self.w_updt = np.array([]) def update(self, w, grad_func): # Calculate the gradient of the loss a bit further down the slope from w approx_fu...
NesterovAcceleratedGradient
python
pennersr__django-allauth
allauth/headless/account/views.py
{ "start": 7234, "end": 8579 }
class ____(APIView): input_class = VerifyPhoneInput def handle(self, request, *args, **kwargs): self.stage = LoginStageController.enter(request, PhoneVerificationStage.key) if self.stage: self.process = ( flows.phone_verification.PhoneVerificationStageProcess.resume(...
VerifyPhoneView
python
django__django
tests/i18n/test_extraction.py
{ "start": 42812, "end": 43915 }
class ____(ExtractorTests): PO_FILE_PT = "locale/pt/LC_MESSAGES/django.po" PO_FILE_DE = "locale/de/LC_MESSAGES/django.po" PO_FILE_KO = "locale/ko/LC_MESSAGES/django.po" LOCALES = ["pt", "de", "ch"] def test_multiple_locales(self): management.call_command("makemessages", locale=["pt", "de"],...
MultipleLocaleExtractionTests
python
pandas-dev__pandas
asv_bench/benchmarks/io/json.py
{ "start": 6359, "end": 9004 }
class ____(BaseIO): fname = "__test__.json" def setup(self): N = 10**5 ncols = 5 index = date_range("20000101", periods=N, freq="h") timedeltas = timedelta_range(start=1, periods=N, freq="s") datetimes = date_range(start=1, periods=N, freq="s") ints = np.random.r...
ToJSONLines
python
openai__openai-python
src/openai/types/responses/tool_choice_shell_param.py
{ "start": 220, "end": 353 }
class ____(TypedDict, total=False): type: Required[Literal["shell"]] """The tool to call. Always `shell`."""
ToolChoiceShellParam
python
jmcnamara__XlsxWriter
xlsxwriter/test/comparison/test_chart_bar09.py
{ "start": 315, "end": 1363 }
class ____(ExcelComparisonTest): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.set_filename("chart_bar09.xlsx") def test_create_file(self): """Test the creation of a simple XlsxWriter file.""" workbook = Workbook(self.got_f...
TestCompareXLSXFiles
python
kamyu104__LeetCode-Solutions
Python/find-the-integer-added-to-array-i.py
{ "start": 37, "end": 246 }
class ____(object): def addedInteger(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: int """ return max(nums2)-max(nums1)
Solution
python
astropy__astropy
astropy/coordinates/tests/test_representation_arithmetic.py
{ "start": 41302, "end": 43671 }
class ____: """Test copied from SphericalDifferential, so less extensive.""" def setup_method(self): s = CylindricalRepresentation( rho=[1, 2, 3] * u.kpc, phi=[0.0, 90.0, 315.0] * u.deg, z=[3, 2, 1] * u.kpc ) self.s = s self.e = s.unit_vectors() self.sf = s.s...
TestCylindricalDifferential
python
davidhalter__jedi
test/completion/arrays.py
{ "start": 1991, "end": 2349 }
class ____(): def __init__(self): self.a = (str()).upper() #? str() C().a # ----------------- # imbalanced sides # ----------------- (f, g) = (1,) #? int() f #? [] g. (f, g, h) = (1,'') #? int() f #? str() g #? [] h. (f1, g1) = 1 #? [] f1. #? [] g1. (f, g) = (1,'',1.0) #? int() f #? str() g # --------...
C
python
airbytehq__airbyte
airbyte-integrations/connectors/source-github/source_github/github_schema.py
{ "start": 1047520, "end": 1048187 }
class ____(sgqlc.types.Type): """Autogenerated return type of UpdateTopics""" __schema__ = github_schema __field_names__ = ("client_mutation_id", "invalid_topic_names", "repository") client_mutation_id = sgqlc.types.Field(String, graphql_name="clientMutationId") """A unique identifier for the clien...
UpdateTopicsPayload
python
HypothesisWorks__hypothesis
hypothesis-python/src/hypothesis/extra/django/_impl.py
{ "start": 1727, "end": 8977 }
class ____(HypothesisTestCase, dst.StaticLiveServerTestCase): pass @defines_strategy() def from_model( model: type[ModelT], /, **field_strategies: st.SearchStrategy | EllipsisType ) -> st.SearchStrategy[ModelT]: """Return a strategy for examples of ``model``. .. warning:: Hypothesis creates s...
StaticLiveServerTestCase
python
kamyu104__LeetCode-Solutions
Python/minimum-number-of-coins-for-fruits.py
{ "start": 1300, "end": 1655 }
class ____(object): def minimumCoins(self, prices): """ :type prices: List[int] :rtype: int """ dp = [float("inf")]*(len(prices)+1) dp[0] = 0 for i in xrange(len(prices)): for j in xrange(i//2, i+1): dp[i+1] = min(dp[i+1], dp[j]+pri...
Solution3
python
fluentpython__example-code
20-descriptor/descriptorkinds_dump.py
{ "start": 4669, "end": 4846 }
class ____: # <4> """an overriding descriptor without ``__get__``""" def __set__(self, instance, value): print_args('set', self, instance, value)
OverridingNoGet
python
Textualize__textual
tests/test_on.py
{ "start": 4038, "end": 9002 }
class ____(Widget): @dataclass class Parent(Message): sender: MessageSender @property def control(self) -> MessageSender: return self.sender class Child(Parent): pass def post_parent(self) -> None: self.post_message(self.Parent(self)) def post_...
MessageSender
python
rapidsai__cudf
python/cudf_polars/cudf_polars/dsl/ir.py
{ "start": 97820, "end": 98603 }
class ____(IR): """Slice a dataframe.""" __slots__ = ("length", "offset") _non_child = ("schema", "offset", "length") offset: int """Start of the slice.""" length: int | None """Length of the slice.""" def __init__(self, schema: Schema, offset: int, length: int | None, df: IR): ...
Slice
python
wandb__wandb
wandb/vendor/watchdog_0_9_0/wandb_watchdog/observers/kqueue.py
{ "start": 9976, "end": 12033 }
class ____(object): """ A kevent descriptor convenience data structure to keep together: * kevent * directory status * path * file descriptor :param path: Path string for which a kevent descriptor will be created. :param is_directory: ``True`` if the pa...
KeventDescriptor
python
kamyu104__LeetCode-Solutions
Python/minimum-number-of-operations-to-make-all-array-elements-equal-to-1.py
{ "start": 78, "end": 724 }
class ____(object): def minOperations(self, nums): """ :type nums: List[int] :rtype: int """ def gcd(a, b): while b: a, b = b, a%b return a cnt = nums.count(1) if cnt: return len(nums)-cnt result = f...
Solution
python
getsentry__sentry
src/sentry/api/serializers/models/event.py
{ "start": 4933, "end": 5520 }
class ____(TypedDict): id: str groupID: str | None eventID: str projectID: str message: str | None title: str location: str | None user: EventUserApiContext | None tags: list[EventTag] platform: str dateReceived: datetime | None contexts: dict[str, Any] | None size: i...
BaseEventSerializerResponse
python
mlflow__mlflow
mlflow/legacy_databricks_cli/configure/provider.py
{ "start": 6827, "end": 7224 }
class ____: """ Responsible for providing hostname and authentication information to make API requests against the Databricks REST API. This method should generally return None if it cannot provide credentials, in order to facilitate chanining of providers. """ __metaclass__ = ABCMeta ...
DatabricksConfigProvider
python
spyder-ide__spyder
spyder/plugins/application/container.py
{ "start": 3228, "end": 33847 }
class ____(PluginMainContainer): sig_report_issue_requested = Signal() """ Signal to request reporting an issue to Github. """ sig_load_log_file = Signal(str) """ Signal to load a log file """ sig_new_file_requested = Signal() """ Signal to request that a new file be creat...
ApplicationContainer
python
pennersr__django-allauth
allauth/account/views.py
{ "start": 18829, "end": 20162 }
class ____(AjaxCapableProcessFormViewMixin, NextRedirectMixin, FormView): template_name = "account/password_set." + app_settings.TEMPLATE_EXTENSION form_class = SetPasswordForm def get_form_class(self): return get_form_class(app_settings.FORMS, "set_password", self.form_class) @sensitive_post_...
PasswordSetView
python
Textualize__textual
src/textual/highlight.py
{ "start": 324, "end": 4835 }
class ____: """Contains the style definition for user with the highlight method.""" STYLES: dict[TokenType, str] = { Token.Comment: "$text 60%", Token.Error: "$text-error on $error-muted", Token.Generic.Strong: "bold", Token.Generic.Emph: "italic", Token.Generic.Error: "...
HighlightTheme
python
langchain-ai__langchain
libs/core/langchain_core/tracers/core.py
{ "start": 885, "end": 23330 }
class ____(ABC): """Abstract base class for tracers. This class provides common methods, and reusable methods for tracers. """ log_missing_parent: bool = True def __init__( self, *, _schema_format: Literal[ "original", "streaming_events", "original+chat" ...
_TracerCore
python
weaviate__weaviate-python-client
weaviate/backup/backup_location.py
{ "start": 418, "end": 550 }
class ____(_BackupLocationConfig): """The dynamic location of a backup for S3.""" path: str bucket: str
_BackupLocationS3
python
plotly__plotly.py
plotly/graph_objs/bar/marker/colorbar/_tickformatstop.py
{ "start": 233, "end": 8529 }
class ____(_BaseTraceHierarchyType): _parent_path_str = "bar.marker.colorbar" _path_str = "bar.marker.colorbar.tickformatstop" _valid_props = {"dtickrange", "enabled", "name", "templateitemname", "value"} @property def dtickrange(self): """ range [*min*, *max*], where "min", "ma...
Tickformatstop