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
pypa__setuptools
setuptools/_vendor/importlib_metadata/_adapters.py
{ "start": 80, "end": 2317 }
class ____(email.message.Message): multiple_use_keys = set( map( FoldedCase, [ 'Classifier', 'Obsoletes-Dist', 'Platform', 'Project-URL', 'Provides-Dist', 'Provides-Extra', ...
Message
python
airbytehq__airbyte
airbyte-integrations/connectors/destination-deepset/destination_deepset/api.py
{ "start": 598, "end": 777 }
class ____(APIError): """Raised when the server is unable to successfully upload the file.""" def __str__(self) -> str: return "File upload failed."
FileUploadError
python
wandb__wandb
wandb/vendor/pygments/lexers/jvm.py
{ "start": 51009, "end": 54630 }
class ____(RegexLexer): """ For `Golo <http://golo-lang.org/>`_ source code. .. versionadded:: 2.0 """ name = 'Golo' filenames = ['*.golo'] aliases = ['golo'] tokens = { 'root': [ (r'[^\S\n]+', Text), (r'#.*$', Comment), (r'(\^|\.\.\.|:|\?...
GoloLexer
python
apache__airflow
airflow-ctl/src/airflowctl/api/datamodels/generated.py
{ "start": 2087, "end": 2881 }
class ____(BaseModel): """ Serializer for individual bulk action responses. Represents the outcome of a single bulk operation (create, update, or delete). The response includes a list of successful keys and any errors encountered during the operation. This structure helps users understand which key...
BulkActionResponse
python
tensorflow__tensorflow
tensorflow/python/kernel_tests/linalg/determinant_op_test.py
{ "start": 8095, "end": 9849 }
class ____(test.Benchmark): shapes = [ (4, 4), (10, 10), (16, 16), (101, 101), (256, 256), (1000, 1000), (1024, 1024), (2048, 2048), (513, 4, 4), (513, 16, 16), (513, 256, 256), ] def _GenerateMatrix(self, shape): batch_shape = shape[:-2] ...
MatrixDeterminantBenchmark
python
walkccc__LeetCode
solutions/1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold/1343.py
{ "start": 0, "end": 313 }
class ____: def numOfSubarrays(self, arr: list[int], k: int, threshold: int) -> int: ans = 0 windowSum = 0 for i in range(len(arr)): windowSum += arr[i] if i >= k: windowSum -= arr[i - k] if i >= k - 1 and windowSum // k >= threshold: ans += 1 return ans
Solution
python
huggingface__transformers
src/transformers/models/swiftformer/modeling_swiftformer.py
{ "start": 13779, "end": 15073 }
class ____(PreTrainedModel): config: SwiftFormerConfig base_model_prefix = "swiftformer" main_input_name = "pixel_values" input_modalities = ("image",) supports_gradient_checkpointing = True _no_split_modules = ["SwiftFormerEncoderBlock"] @torch.no_grad() def _init_weights(self, module:...
SwiftFormerPreTrainedModel
python
chroma-core__chroma
chromadb/execution/expression/operator.py
{ "start": 9608, "end": 9786 }
class ____(Where): """Equality comparison""" key: str value: Any def to_dict(self) -> Dict[str, Any]: return {self.key: {"$eq": self.value}} @dataclass
Eq
python
pydantic__pydantic
tests/mypy/outputs/mypy-plugin-strict_ini/plugin_fail.py
{ "start": 5207, "end": 5422 }
class ____(BaseModel): x: str = Field(..., alias='y') z: int AliasModel(y=1, z=2) # MYPY: error: Argument "y" to "AliasModel" has incompatible type "int"; expected "str" [arg-type] x_alias = 'y'
AliasModel
python
ray-project__ray
rllib/policy/eager_tf_policy_v2.py
{ "start": 1809, "end": 36066 }
class ____(Policy): """A TF-eager / TF2 based tensorflow policy. This class is intended to be used and extended by sub-classing. """ def __init__( self, observation_space: gym.spaces.Space, action_space: gym.spaces.Space, config: AlgorithmConfigDict, **kwargs, ...
EagerTFPolicyV2
python
dask__dask
dask/dataframe/backends.py
{ "start": 17026, "end": 26381 }
class ____(SimpleSizeof, dict): def __sizeof__(self) -> int: """ The result of the shuffle split are typically small dictionaries (#keys << 100; typically <= 32) The splits are often non-uniformly distributed. Some of the splits may even be empty. Sampling the dictionary for ...
ShuffleGroupResult
python
HypothesisWorks__hypothesis
hypothesis-python/tests/cover/test_lookup.py
{ "start": 29680, "end": 30292 }
class ____: def __init__(self, value=-1) -> None: pass @pytest.mark.parametrize( "typ,repr_", [ (int, "integers()"), (list[str], "lists(text())"), (_List[str], "lists(text())"), ("not a type", "from_type('not a type')"), (random.Random, "randoms()"), ...
_EmptyClass
python
pydantic__pydantic
tests/test_validate_call.py
{ "start": 37300, "end": 37805 }
class ____[T]: def g(self): @validate_call(validate_return=True) def inner(a: T) -> T: ... def h[S](self): @validate_call(validate_return=True) def inner(a: T) -> S: ... """ ) A = module.A a = A[int]() with pytest.raises(NameError): a.g() wit...
A
python
django__django
tests/custom_lookups/tests.py
{ "start": 1826, "end": 2069 }
class ____(models.Transform): lookup_name = "lastdigit" def as_sql(self, compiler, connection): lhs, lhs_params = compiler.compile(self.lhs) return "SUBSTR(CAST(%s AS CHAR(2)), 2, 1)" % lhs, lhs_params
LastDigitTransform
python
pydantic__pydantic
tests/mypy/modules/plugin_fail.py
{ "start": 3666, "end": 3854 }
class ____(BaseModel, alias_generator=lambda x: x + '_'): x: int KwargsAliasGeneratorModel(x=1) KwargsAliasGeneratorModel(x_=1) KwargsAliasGeneratorModel(z=1)
KwargsAliasGeneratorModel
python
pytorch__pytorch
torch/_inductor/codegen/debug_utils.py
{ "start": 1175, "end": 1873 }
class ____(Enum): # OFF: No intermediate tensor value debug info will be printed or saved. OFF = "0" # LEVEL 1: Save all intermediate tensor values to individual `.pt` files. No debug printing will be displayed. SAVE_ONLY = "1" # LEVEL 2: Print all intermediate tensor values by default to the consol...
IntermediateValueDebuggingLevel
python
pyqtgraph__pyqtgraph
pyqtgraph/flowchart/library/Display.py
{ "start": 6183, "end": 10274 }
class ____(CtrlNode): """Generates a scatter plot from a record array or nested dicts""" nodeName = 'ScatterPlot' uiTemplate = [ ('x', 'combo', {'values': [], 'index': 0}), ('y', 'combo', {'values': [], 'index': 0}), ('sizeEnabled', 'check', {'value': False}), ('size', 'combo...
ScatterPlot
python
pallets__flask
src/flask/blueprints.py
{ "start": 456, "end": 4541 }
class ____(SansioBlueprint): def __init__( self, name: str, import_name: str, static_folder: str | os.PathLike[str] | None = None, static_url_path: str | None = None, template_folder: str | os.PathLike[str] | None = None, url_prefix: str | None = None, ...
Blueprint
python
django__django
tests/delete/models.py
{ "start": 4810, "end": 4926 }
class ____(models.Model): m = models.ForeignKey(M, models.CASCADE) r = models.ForeignKey(R, models.CASCADE)
MR
python
xlwings__xlwings
xlwings/constants.py
{ "start": 78052, "end": 78156 }
class ____: xlVerbOpen = 2 # from enum XlOLEVerb xlVerbPrimary = 1 # from enum XlOLEVerb
OLEVerb
python
huggingface__transformers
src/transformers/models/exaone4/modeling_exaone4.py
{ "start": 13761, "end": 15551 }
class ____(GradientCheckpointingLayer): def __init__(self, config: Exaone4Config, layer_idx: int): super().__init__() self.hidden_size = config.hidden_size self.self_attn = Exaone4Attention(config=config, layer_idx=layer_idx) self.mlp = Exaone4MLP(config) self.post_attention...
Exaone4DecoderLayer
python
tensorflow__tensorflow
tensorflow/dtensor/python/tests/spmd_test.py
{ "start": 186767, "end": 190432 }
class ____(test_util.DTensorBaseTest): def setUp(self): super(DTensorRelayoutTest, self).setUp() self.skipForDeviceType(['TPU'], 'all tests require 8 TPU cores.', unless_device_count_equals_to=8) global_ids = test_util.create_device_ids_array((2, 4)...
DTensorRelayoutTest
python
matplotlib__matplotlib
lib/matplotlib/projections/polar.py
{ "start": 27914, "end": 54915 }
class ____(Axes): """ A polar graph projection, where the input dimensions are *theta*, *r*. Theta starts pointing east and goes anti-clockwise. """ name = 'polar' def __init__(self, *args, theta_offset=0, theta_direction=1, rlabel_position=22.5, **kwargs): ...
PolarAxes
python
realpython__materials
python-serialize/tabular-data/csv-demo/models.py
{ "start": 223, "end": 1048 }
class ____(NamedTuple): id: int name: str email: str language: Language registered_at: datetime @classmethod def fake(cls): language = random.choice(list(Language)) generator = Faker(language) return cls( generator.pyint(), generator.name(), ...
User
python
bokeh__bokeh
src/bokeh/colors/groups.py
{ "start": 2823, "end": 3718 }
class ____(ColorGroup): ''' CSS "Brown" Color Group as defined by https://www.w3schools.com/colors/colors_groups.asp .. bokeh-color:: cornsilk .. bokeh-color:: blanchedalmond .. bokeh-color:: bisque .. bokeh-color:: navajowhite .. bokeh-color:: wheat .. bokeh-color:: burlywood .. bokeh-...
brown
python
apache__airflow
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_backfills.py
{ "start": 2947, "end": 3704 }
class ____: @provide_session def _create_dag_models(self, *, count=1, dag_id_prefix="TEST_DAG", is_paused=False, session=None): bundle_name = "dags-folder" orm_dag_bundle = DagBundleModel(name=bundle_name) session.add(orm_dag_bundle) session.flush() dags = [] for...
TestBackfillEndpoint
python
allegroai__clearml
clearml/utilities/requests_toolbelt/_compat.py
{ "start": 2143, "end": 9956 }
class ____(MutableMapping): """ :param headers: An iterable of field-value pairs. Must not contain multiple field names when compared case-insensitively. :param kwargs: Additional field-value pairs to pass in to ``dict.update``. A ``dict`` like container for storing HTTP Header...
HTTPHeaderDict
python
graphql-python__graphene
graphene/types/inputfield.py
{ "start": 130, "end": 2752 }
class ____(MountedType): """ Makes a field available on an ObjectType in the GraphQL schema. Any type can be mounted as a Input Field except Interface and Union: - Object Type - Scalar Type - Enum Input object types also can't have arguments on their input fields, unlike regular ``graphene...
InputField
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/paramSpec19.py
{ "start": 1892, "end": 2063 }
class ____(Protocol[P]): def __call__(self, /, *args: P.args, **kwargs: P.kwargs) -> None: ... list_of_handler_protocols: list[HandlerProtocol[...]] = []
HandlerProtocol
python
dateutil__dateutil
tests/test_tz.py
{ "start": 28168, "end": 29998 }
class ____(unittest.TestCase): def testEquality(self): tz1 = tz.tzlocal() tz2 = tz.tzlocal() # Explicitly calling == and != here to ensure the operators work self.assertTrue(tz1 == tz2) self.assertFalse(tz1 != tz2) def testInequalityFixedOffset(self): tzl = tz.t...
TzLocalTest
python
coleifer__peewee
tests/base_models.py
{ "start": 2267, "end": 2430 }
class ____(TestModel): name = CharField() dflt1 = IntegerField(default=1) dflt2 = IntegerField(default=lambda: 2) dfltn = IntegerField(null=True)
DfltM
python
Pylons__pyramid
src/pyramid/interfaces.py
{ "start": 627, "end": 955 }
class ____(Interface): """ An event type that is emitted after :app:`Pyramid` attempted to find a route but before it calls any traversal or view code. See the documentation attached to :class:`pyramid.events.Routefound` for more information. """ request = Attribute('The request object')
IBeforeTraversal
python
conda__conda
conda/core/solve.py
{ "start": 1658, "end": 57248 }
class ____: """ A high-level API to conda's solving logic. Three public methods are provided to access a solution in various forms. * :meth:`solve_final_state` * :meth:`solve_for_diff` * :meth:`solve_for_transaction` """ _index: ReducedIndex | None _r: Resolve | None def...
Solver
python
boto__boto3
tests/functional/test_crt.py
{ "start": 2017, "end": 5306 }
class ____: @requires_crt() @MockOptimizedInstance() def test_create_transfer_manager_on_optimized_instance(self): client = create_mock_client() config = TransferConfig() transfer_manager = create_transfer_manager(client, config) assert isinstance(transfer_manager, CRTTransfe...
TestS3TransferWithCRT
python
sympy__sympy
sympy/vector/vector.py
{ "start": 14856, "end": 15412 }
class ____(BasisDependentMul, Vector): """ Class to denote products of scalars and BaseVectors. """ def __new__(cls, *args, **options): obj = BasisDependentMul.__new__(cls, *args, **options) return obj @property def base_vector(self): """ The BaseVector involved in the ...
VectorMul
python
bokeh__bokeh
src/bokeh/models/graphs.py
{ "start": 3666, "end": 3953 }
class ____(GraphCoordinates): ''' Node coordinate expression obtained from ``LayoutProvider`` ''' # explicit __init__ to support Init signatures def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) @abstract
EdgeCoordinates
python
scipy__scipy
scipy/optimize/tests/test_linprog.py
{ "start": 87308, "end": 90533 }
class ____: method = "interior-point" # the following tests don't need to be performed separately for # sparse presolve, sparse after presolve, and dense def test_solver_select(self): # check that default solver is selected as expected if has_cholmod: options = {'sparse': Tr...
TestLinprogIPSpecific
python
encode__django-rest-framework
tests/test_response.py
{ "start": 8436, "end": 8858 }
class ____(TestCase): """ Tests that covers #122. """ def test_only_html_renderer(self): """ Test if no infinite recursion occurs. """ self.client.get('/html') def test_html_renderer_is_first(self): """ Test if no infinite recursion occurs. ""...
Issue122Tests
python
huggingface__transformers
src/transformers/pipelines/text_generation.py
{ "start": 541, "end": 24901 }
class ____(Pipeline): """ Language generation pipeline using any `ModelWithLMHead` or `ModelForCausalLM`. This pipeline predicts the words that will follow a specified text prompt. When the underlying model is a conversational model, it can also accept one or more chats, in which case the pipeline will ...
TextGenerationPipeline
python
pytorch__pytorch
test/jit/test_exception.py
{ "start": 170, "end": 5970 }
class ____(TestCase): def test_pyop_exception_message(self): class Foo(torch.jit.ScriptModule): def __init__(self) -> None: super().__init__() self.conv = nn.Conv2d(1, 10, kernel_size=5) @torch.jit.script_method def forward(self, x): ...
TestException
python
facebook__pyre-check
client/backend_arguments.py
{ "start": 3152, "end": 5198 }
class ____: source_root: Path artifact_root: Path checked_directory: Path targets: Sequence[str] = dataclasses.field(default_factory=list) targets_fallback_sources: Optional[Sequence[search_path.Element]] = None mode: Optional[str] = None isolation_prefix: Optional[str] = None bxl_builde...
BuckSourcePath
python
pytorch__pytorch
test/dynamo/test_subclasses.py
{ "start": 49580, "end": 68745 }
class ____(torch.nn.Module): def forward(self, L_x_: "f32[3, 4]"): l_x_ = L_x_ wrap_body_0 = self.wrap_body_0 wrap = torch.ops.higher_order.wrap(wrap_body_0, l_x_); wrap_body_0 = l_x_ = None getitem: "f32[3, 4]" = wrap[0]; wrap = None return (getitem,) class wrap_body...
GraphModule
python
pyqtgraph__pyqtgraph
pyqtgraph/widgets/DataFilterWidget.py
{ "start": 184, "end": 1176 }
class ____(ptree.ParameterTree): """ This class allows the user to filter multi-column data sets by specifying multiple criteria Wraps methods from DataFilterParameter: setFields, generateMask, filterData, and describe. """ sigFilterChanged = QtCore.Signal(object) def __in...
DataFilterWidget
python
numpy__numpy
numpy/ma/tests/test_subclassing.py
{ "start": 3174, "end": 4548 }
class ____(SubArray): def __str__(self): return f'myprefix {self.view(SubArray)} mypostfix' def __repr__(self): # Return a repr that does not start with 'name(' return f'<{self.__class__.__name__} {self}>' def _validate_input(self, value): if not isinstance(value, Complica...
ComplicatedSubArray
python
django__django
django/template/backends/jinja2.py
{ "start": 1803, "end": 2730 }
class ____: def __init__(self, template, backend): self.template = template self.backend = backend self.origin = Origin( name=template.filename, template_name=template.name, ) def render(self, context=None, request=None): if context is None: ...
Template
python
sphinx-doc__sphinx
sphinx/environment/__init__.py
{ "start": 3076, "end": 35485 }
class ____: """The environment in which the ReST files are translated. Stores an inventory of cross-file targets and provides doctree transformations to resolve links to them. """ # --------- ENVIRONMENT INITIALIZATION ------------------------------------- srcdir = _StrPathProperty() doctr...
BuildEnvironment
python
ray-project__ray
python/ray/serve/exceptions.py
{ "start": 202, "end": 279 }
class ____(Exception): pass @PublicAPI(stability="alpha")
RayServeException
python
bokeh__bokeh
src/bokeh/models/annotations/html/labels.py
{ "start": 5818, "end": 8783 }
class ____(HTMLAnnotation, DataAnnotation): ''' Render multiple text labels as annotations. ``LabelSet`` will render multiple text labels at given ``x`` and ``y`` coordinates, which can be in either screen (pixel) space, or data (axis range) space. In this case (as opposed to the single ``Label`` model...
HTMLLabelSet
python
getsentry__sentry
src/sentry/api/endpoints/organization_plugins_index.py
{ "start": 684, "end": 2198 }
class ____(OrganizationEndpoint): owner = ApiOwner.INTEGRATIONS publish_status = { "GET": ApiPublishStatus.PRIVATE, } def get(self, request: Request, organization: Organization) -> Response: all_plugins = {p.slug: p for p in plugins.all()} if "plugins" in request.GET: ...
OrganizationPluginsEndpoint
python
google__flatbuffers
python/flatbuffers/builder.py
{ "start": 1837, "end": 1962 }
class ____(RuntimeError): """Error caused by not calling `Finish` before calling `Output`.""" pass
BuilderNotFinishedError
python
great-expectations__great_expectations
contrib/great_expectations_geospatial_expectations/great_expectations_geospatial_expectations/expectations/expect_column_values_geometry_to_intersect_shape.py
{ "start": 3296, "end": 10544 }
class ____(ColumnMapExpectation): """Expect that column values as geometries intersect a given reference shape. expect_column_values_geometry_to_intersect_shape is a \ [Column Map Expectation](https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_colum...
ExpectColumnValuesGeometryToIntersectShape
python
pytorch__pytorch
test/distributed/fsdp/test_fsdp_dtensor_state_dict.py
{ "start": 2064, "end": 13054 }
class ____(DTensorTestBase): def _create_model(self, is_even_sharded_model, device_mesh=None): dummy_model = ( TestDummyModel() if is_even_sharded_model else TestDummyModelUneven() ) model = FSDP(dummy_model.to(device_type), device_mesh=device_mesh) optim = torch.optim.Ad...
TestFSDPWithDeviceMeshAndDTensor
python
huggingface__transformers
src/transformers/models/video_llama_3/modular_video_llama_3.py
{ "start": 66426, "end": 74592 }
class ____(Qwen2VLVideoProcessor): use_token_compression = True image_mean = IMAGENET_STANDARD_MEAN image_std = IMAGENET_STANDARD_STD temporal_patch_size = 1 max_frames = 180 return_metadata = True valid_kwargs = VideoLlama3VideoProcessorInitKwargs model_input_names = ["pixel_values_vide...
VideoLlama3VideoProcessor
python
pallets__werkzeug
src/werkzeug/wsgi.py
{ "start": 10226, "end": 11762 }
class ____: """This class can be used to convert a :class:`file`-like object into an iterable. It yields `buffer_size` blocks until the file is fully read. You should not use this class directly but rather use the :func:`wrap_file` function that uses the WSGI server's file wrapper support if i...
FileWrapper
python
pytorch__pytorch
test/dynamo/test_streams.py
{ "start": 15635, "end": 16236 }
class ____(torch.nn.Module): def forward(self, primals_1: "f32[2, 2]", primals_2: "f32[2, 2]"): # Annotation: {'stream': 1} mul: "f32[2, 2]" = torch.ops.aten.mul.Tensor(primals_1, 2); primals_1 = None add: "f32[2, 2]" = torch.ops.aten.add.Tensor(mul, primals_2) # Annotation: {'stre...
GraphModule
python
tensorflow__tensorflow
tensorflow/python/keras/layers/convolutional.py
{ "start": 114570, "end": 119165 }
class ____(Layer): """Zero-padding layer for 2D input (e.g. picture). This layer can add rows and columns of zeros at the top, bottom, left and right side of an image tensor. Examples: >>> input_shape = (1, 1, 2, 2) >>> x = np.arange(np.prod(input_shape)).reshape(input_shape) >>> print(x) [[[[0 1] ...
ZeroPadding2D
python
numba__numba
numba/cuda/tests/cudapy/test_boolean.py
{ "start": 194, "end": 547 }
class ____(CUDATestCase): def test_boolean(self): func = cuda.jit('void(float64[:], bool_)')(boolean_func) A = np.array([0], dtype='float64') func[1, 1](A, True) self.assertTrue(A[0] == 123) func[1, 1](A, False) self.assertTrue(A[0] == 321) if __name__ == '__main__'...
TestCudaBoolean
python
walkccc__LeetCode
solutions/2656. Maximum Sum With Exactly K Elements/2656.py
{ "start": 0, "end": 117 }
class ____: def maximizeSum(self, nums: list[int], k: int) -> int: return max(nums) * k + k * (k - 1) // 2
Solution
python
tensorflow__tensorflow
tensorflow/python/util/fast_module_type_test.py
{ "start": 1391, "end": 3180 }
class ____(test.TestCase): def testAttributeAccessBeforeSuperInitDoesNotCrash(self): # Tests that the attribute access before super().__init__() does not crash. module = EarlyAttrAccessModule("early_attr") self.assertEqual(1, module.some_attr) def testMissingModuleNameCallDoesNotCrash(self): with ...
FastModuleTypeTest
python
getsentry__sentry
src/sentry/replays/endpoints/project_replay_viewed_by.py
{ "start": 1387, "end": 6994 }
class ____(ProjectEndpoint): owner = ApiOwner.REPLAY publish_status = {"GET": ApiPublishStatus.PUBLIC, "POST": ApiPublishStatus.PRIVATE} permission_classes = (ProjectEventPermission,) @extend_schema( operation_id="List Users Who Have Viewed a Replay", parameters=[ GlobalPara...
ProjectReplayViewedByEndpoint
python
PyCQA__pylint
tests/functional/i/inner_classes.py
{ "start": 137, "end": 361 }
class ____: """docstring""" def __init__(self): self.__setattr__('a', 'b') def one_public(self): """docstring""" pass def another_public(self): """docstring""" pass
Aaa
python
numba__numba
numba/core/typing/builtins.py
{ "start": 4360, "end": 5570 }
class ____(AbstractTemplate): """ Given a heterogeneous pair, return the second element. """ key = "pair_second" def generic(self, args, kws): assert not kws [pair] = args if isinstance(pair, types.Pair): return signature(pair.second_type, pair) def choose_resu...
PairSecond
python
google__jax
tests/lax_scipy_special_functions_test.py
{ "start": 5839, "end": 16656 }
class ____(jtu.JaxTestCase): def _GetArgsMaker(self, rng, shapes, dtypes): return lambda: [rng(shape, dtype) for shape, dtype in zip(shapes, dtypes)] @parameterized.named_parameters(itertools.chain.from_iterable( map(_pretty_special_fun_name, jtu.sample_product_testcases( [dict(op=rec.name, rng_fact...
LaxScipySpecialFunctionsTest
python
has2k1__plotnine
plotnine/facets/layout.py
{ "start": 563, "end": 8967 }
class ____: """ Layout of entire plot """ # facet facet: facet # coordinate system coord: coord # A dataframe with the layout information of the plot layout: pd.DataFrame # List of x scales panel_scales_x: Scales # List of y scales panel_scales_y: Scales # R...
Layout
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/classVar7.py
{ "start": 106, "end": 555 }
class ____: a: ClassVar b: ClassVar = 2 c: ClassVar d: ClassVar d = 3 @classmethod def m1(cls) -> None: cls.c = "" reveal_type(A.a, expected_text="Unknown") A.a = 3 A.a = "" reveal_type(A.b, expected_text="int") A.b = 2 # This should generate an error A.b = "" reveal_type(A.c,...
A
python
spack__spack
lib/spack/spack/fetch_strategy.py
{ "start": 2614, "end": 5917 }
class ____: """Superclass of all fetch strategies.""" #: The URL attribute must be specified either at the package class #: level, or as a keyword argument to ``version()``. It is used to #: distinguish fetchers for different versions in the package DSL. url_attr: Optional[str] = None #: Opti...
FetchStrategy
python
apache__airflow
task-sdk/tests/task_sdk/dags/super_basic_run.py
{ "start": 920, "end": 1282 }
class ____(BaseOperator): def execute(self, context): task_id = context["task_instance"].task_id print(f"Hello World {task_id}!") assert context["task_instance"].try_number == 1 assert context["dag"].dag_id == "super_basic_run" @dag() def super_basic_run(): CustomOperator(task_...
CustomOperator
python
pypa__pip
src/pip/_vendor/pygments/lexers/python.py
{ "start": 28897, "end": 30360 }
class ____(RegexLexer): name = 'Python console session' aliases = ['pycon', 'python-console'] mimetypes = ['text/x-python-doctest'] """Auxiliary lexer for `PythonConsoleLexer`. Code tokens are output as ``Token.Other.Code``, traceback tokens as ``Token.Other.Traceback``. """ tokens = {...
_PythonConsoleLexerBase
python
hynek__structlog
src/structlog/twisted.py
{ "start": 6558, "end": 8500 }
class ____: """ Wrap a log *observer* and render non-`JSONRenderer` entries to JSON. Args: observer (ILogObserver): Twisted log observer to wrap. For example :class:`PlainFileObserver` or Twisted's stock `FileLogObserver <https://docs.twisted.org/en/stable/api/ ...
JSONLogObserverWrapper
python
huggingface__transformers
tests/models/gemma3n/test_processing_gemma3n.py
{ "start": 1136, "end": 2126 }
class ____(ProcessorTesterMixin, unittest.TestCase): processor_class = Gemma3nProcessor model_id = "hf-internal-testing/namespace-google-repo_name-gemma-3n-E4B-it" def prepare_image_inputs(self, batch_size: int | None = None, nested: bool = False): return super().prepare_image_inputs(batch_size=bat...
Gemma3nProcessorTest
python
langchain-ai__langchain
libs/core/tests/unit_tests/example_selectors/test_similarity.py
{ "start": 395, "end": 8308 }
class ____(VectorStore): def __init__(self, init_arg: str | None = None): self.texts: list[str] = [] self.metadatas: list[dict] = [] self._embeddings: Embeddings | None = None self.init_arg = init_arg @property def embeddings(self) -> Embeddings | None: return self._...
DummyVectorStore
python
walkccc__LeetCode
solutions/565. Array Nesting/565.py
{ "start": 0, "end": 340 }
class ____: def arrayNesting(self, nums: list[int]) -> int: ans = 0 for num in nums: if num == -1: continue index = num count = 0 while nums[index] != -1: cache = index index = nums[index] nums[cache] = -1 count += 1 ans = max(ans, count) ...
Solution
python
huggingface__transformers
src/transformers/models/funnel/modeling_funnel.py
{ "start": 32537, "end": 33326 }
class ____(ModelOutput): r""" loss (*optional*, returned when `labels` is provided, `torch.FloatTensor` of shape `(1,)`): Total loss of the ELECTRA-style objective. logits (`torch.FloatTensor` of shape `(batch_size, sequence_length)`): Prediction scores of the head (scores for each token bef...
FunnelForPreTrainingOutput
python
apache__airflow
providers/google/tests/unit/google/cloud/links/test_dataplex.py
{ "start": 9769, "end": 10875 }
class ____: @pytest.mark.db_test def test_get_link(self, create_task_instance_of_operator, session, mock_supervisor_comms): expected_url = EXPECTED_DATAPLEX_CATALOG_ENTRY_TYPE_LINK link = DataplexCatalogEntryTypeLink() ti = create_task_instance_of_operator( DataplexCatalogGet...
TestDataplexCatalogEntryTypeLink
python
streamlit__streamlit
lib/streamlit/elements/lib/policies.py
{ "start": 3108, "end": 6877 }
class ____(StreamlitAPIWarning): def __init__(self) -> None: super().__init__( """ Your script uses a widget command in a cached function (function decorated with `@st.cache_data` or `@st.cache_resource`). This code will only be called when we detect a cache "miss", which can lead to unexpected ...
CachedWidgetWarning
python
google__jax
jax/experimental/mosaic/gpu/core.py
{ "start": 8492, "end": 8571 }
class ____: num_barriers: int = 1 @dataclasses.dataclass(frozen=True)
TMABarrier
python
google__pytype
pytype/abstract/abstract_utils.py
{ "start": 3595, "end": 3806 }
class ____(AsInstance): """Specially mark return values, to handle Never properly.""" # For lazy evaluation of ParameterizedClass.formal_type_parameters @dataclasses.dataclass(eq=True, frozen=True)
AsReturnValue
python
dagster-io__dagster
python_modules/libraries/dagster-airbyte/dagster_airbyte/managed/generated/sources.py
{ "start": 152088, "end": 153687 }
class ____(GeneratedAirbyteSource): class AuthenticateViaRetentlyOAuth: @public def __init__( self, client_id: str, client_secret: str, refresh_token: str, auth_type: Optional[str] = None, ): self.auth_type = check.opt_s...
RetentlySource
python
prabhupant__python-ds
data_structures/bst/convert_bst_to_right_node_tree.py
{ "start": 0, "end": 430 }
class ____(): def __init__(self, val): self.val = val self.left = None self.right = None def increasing_bst(root): def inorder(node): if node: yield from inorder(node.left) yield node.val yield from inorder(node.right) ans = curr = Node(...
Node
python
huggingface__transformers
src/transformers/models/siglip/configuration_siglip.py
{ "start": 783, "end": 5416 }
class ____(PreTrainedConfig): r""" This is the configuration class to store the configuration of a [`SiglipTextModel`]. It is used to instantiate a Siglip text encoder according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a simi...
SiglipTextConfig
python
weaviate__weaviate-python-client
weaviate/collections/queries/fetch_objects/generate/executor.py
{ "start": 869, "end": 10725 }
class ____( Generic[ConnectionType, Properties, References], _BaseExecutor[ConnectionType] ): @overload def fetch_objects( self, *, single_prompt: Union[str, _SinglePrompt, None] = None, grouped_task: Union[str, _GroupedTask, None] = None, grouped_properties: Optional...
_FetchObjectsGenerateExecutor
python
google__pytype
pytype/pyc/opcodes.py
{ "start": 1174, "end": 4561 }
class ____: """An opcode without arguments.""" __slots__ = ( "line", "endline", "col", "endcol", "index", "prev", "next", "target", "end_async_for_target", "block_target", "code", "annotation", "folded", "metadata", "push_exc...
Opcode
python
ray-project__ray
python/ray/_private/thirdparty/pynvml/pynvml.py
{ "start": 59778, "end": 60035 }
class ____(Structure): _fields_ = [ ('pid', c_uint), ('usedGpuMemory', c_ulonglong), ('gpuInstanceId', c_uint), ('computeInstanceId', c_uint), ('usedGpuCcProtectedMemory', c_ulonglong), ]
c_nvmlProcessDetail_v1_t
python
langchain-ai__langchain
libs/langchain/langchain_classic/smith/evaluation/runner_utils.py
{ "start": 37540, "end": 37772 }
class ____(TypedDict, total=False): """A dictionary of the results for a single example row.""" feedback: list[EvaluationResult] | None execution_time: float | None run_id: str | None @dataclasses.dataclass
_RowResult
python
great-expectations__great_expectations
tests/integration/fluent/test_integration_datasource.py
{ "start": 3433, "end": 20168 }
class ____: def test_success_with_partitioners(self, empty_data_context): context = empty_data_context datasource = sqlite_datasource(context, "yellow_tripdata.db") passenger_count_value = 5 asset = datasource.add_query_asset( name="query_asset", query=f" SE...
TestQueryAssets
python
Textualize__textual
tests/test_masked_input.py
{ "start": 270, "end": 7266 }
class ____(App[None]): def __init__(self, template: str, placeholder: str = ""): super().__init__() self.messages: list[InputEvent] = [] self.template = template self.placeholder = placeholder def compose(self) -> ComposeResult: yield MaskedInput( template=se...
InputApp
python
walkccc__LeetCode
solutions/655. Print Binary Tree/655.py
{ "start": 0, "end": 643 }
class ____: def printTree(self, root: TreeNode | None) -> list[list[str]]: def maxHeight(root: TreeNode | None) -> int: if not root: return 0 return 1 + max(maxHeight(root.left), maxHeight(root.right)) def dfs(root: TreeNode | None, row: int, left: int, right: int) -> None: if not r...
Solution
python
davidhalter__jedi
jedi/inference/compiled/access.py
{ "start": 4652, "end": 18914 }
class ____: def __init__(self, inference_state, obj): self._inference_state = inference_state self._obj = obj def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self.get_repr()) def _create_access(self, obj): return create_access(self._inference_state, obj) ...
DirectObjectAccess
python
Pylons__pyramid
src/pyramid/httpexceptions.py
{ "start": 17631, "end": 18007 }
class ____(_HTTPMove): """ subclass of :class:`~_HTTPMove` This indicates that the requested resource resides temporarily under a different URI. code: 302, title: Found """ code = 302 title = 'Found' explanation = 'The resource was found at' # This one is safe after a POST (the ...
HTTPFound
python
scipy__scipy
scipy/stats/tests/test_distributions.py
{ "start": 189089, "end": 191318 }
class ____: def test_pdf_unity_area(self): from scipy.integrate import simpson # PDF should integrate to one p = stats.genexpon.pdf(np.arange(0, 10, 0.01), 0.5, 0.5, 2.0) assert_almost_equal(simpson(p, dx=0.01), 1, 1) def test_cdf_bounds(self): # CDF should always be pos...
TestGenExpon
python
pytorch__pytorch
torch/utils/mkldnn.py
{ "start": 6428, "end": 8244 }
class ____(torch.jit.ScriptModule): def __init__(self, dense_module, dtype) -> None: super().__init__() self.register_buffer('weight', dense_module.weight.to_mkldnn(dtype)) @torch.jit.script_method def __getstate__(self): return (self.weight.to_dense(), self.training) @torch.ji...
MkldnnPrelu
python
rapidsai__cudf
python/cudf/cudf/core/dtypes.py
{ "start": 30682, "end": 30786 }
class ____(DecimalDtype): name = "decimal128" MAX_PRECISION = 38 ITEMSIZE = 16
Decimal128Dtype
python
huggingface__transformers
src/transformers/models/led/modeling_led.py
{ "start": 39739, "end": 42424 }
class ____(GradientCheckpointingLayer): def __init__(self, config: LEDConfig, layer_id: int): super().__init__() self.embed_dim = config.d_model self.self_attn = LEDEncoderAttention(config, layer_id) self.self_attn_layer_norm = nn.LayerNorm(self.embed_dim) self.dropout = conf...
LEDEncoderLayer
python
doocs__leetcode
lcof/面试题68 - I. 二叉搜索树的最近公共祖先/Solution.py
{ "start": 164, "end": 524 }
class ____: def lowestCommonAncestor( self, root: TreeNode, p: TreeNode, q: TreeNode ) -> TreeNode: while 1: if root.val < p.val and root.val < q.val: root = root.right elif root.val > p.val and root.val > q.val: root = root.left ...
Solution
python
walkccc__LeetCode
solutions/3350. Adjacent Increasing Subarrays Detection II/3350.py
{ "start": 0, "end": 455 }
class ____: # Similar to 3349. Adjacent Increasing Subarrays Detection I def maxIncreasingSubarrays(self, nums: list[int]) -> int: ans = 0 increasing = 1 prevIncreasing = 0 for a, b in itertools.pairwise(nums): if b > a: increasing += 1 else: prevIncreasing = increasing ...
Solution
python
huggingface__transformers
src/transformers/models/granitemoehybrid/modular_granitemoehybrid.py
{ "start": 3810, "end": 3957 }
class ____(BambaRMSNormGated): def __init__(self, hidden_size, eps=1e-6): super().__init__(hidden_size, eps)
GraniteMoeHybridRMSNormGated
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/index1.py
{ "start": 1524, "end": 1741 }
class ____(Generic[T]): def __getitem__(self, args: int) -> Self: ... def get(self, index: int) -> Self: reveal_type(self[index], expected_text="Self@ClassF[T@ClassF]") return self[index]
ClassF
python
hynek__structlog
tests/processors/test_processors.py
{ "start": 20947, "end": 21821 }
class ____: def test_rename_once(self): """ Renaming event to something else works. """ assert {"msg": "hi", "foo": "bar"} == EventRenamer("msg")( None, None, {"event": "hi", "foo": "bar"} ) def test_rename_twice(self): """ Renaming both from ...
TestRenameKey
python
pytorch__pytorch
test/dynamo/cpython/3_13/test_heapq.py
{ "start": 13363, "end": 17323 }
class ____: def test_non_sequence(self): for f in (self.module.heapify, self.module.heappop): self.assertRaises((TypeError, AttributeError), f, 10) for f in (self.module.heappush, self.module.heapreplace, self.module.nlargest, self.module.nsmallest): self.a...
_TestErrorHandling
python
scipy__scipy
scipy/io/tests/test_idl.py
{ "start": 15000, "end": 18972 }
class ____: # Test that structures are correctly read in def test_scalars(self): s = readsav(path.join(DATA_PATH, 'struct_pointers.sav'), verbose=False) assert_identical(s.pointers.g, np.array(np.float32(4.), dtype=np.object_)) assert_identical(s.pointers.h, np.array(np.float32(4.), dty...
TestPointerStructures