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
streamlit__streamlit
lib/streamlit/components/types/base_custom_component.py
{ "start": 899, "end": 1046 }
class ____(StreamlitAPIException): """Class for exceptions generated during custom component marshalling.""" pass
MarshallComponentException
python
astropy__astropy
astropy/table/tests/test_table.py
{ "start": 53238, "end": 53763 }
class ____: def test_iterator(self, table_types): d = np.array( [ (2, 1), (3, 6), (4, 5), ], dtype=[("a", "i4"), ("b", "i4")], ) t = table_types.Table(d) if t.masked: with pytest.raises(Va...
TestIterator
python
qdrant__qdrant-client
qdrant_client/qdrant_client.py
{ "start": 705, "end": 106860 }
class ____(QdrantFastembedMixin): """Entry point to communicate with Qdrant service via REST or gRPC API. It combines interface classes and endpoint implementation. Additionally, it provides custom implementations for frequently used methods like initial collection upload. All methods in QdrantClient ...
QdrantClient
python
huggingface__transformers
examples/pytorch/speech-pretraining/run_wav2vec2_pretraining_no_trainer.py
{ "start": 9810, "end": 32762 }
class ____: """ Data collator that will dynamically pad the inputs received and prepare masked indices for self-supervised pretraining. Args: model (:class:`~transformers.Wav2Vec2ForPreTraining`): The Wav2Vec2 model used for pretraining. The data collator needs to have access ...
DataCollatorForWav2Vec2Pretraining
python
doocs__leetcode
solution/0100-0199/0136.Single Number/Solution.py
{ "start": 0, "end": 101 }
class ____: def singleNumber(self, nums: List[int]) -> int: return reduce(xor, nums)
Solution
python
walkccc__LeetCode
solutions/3284. Sum of Consecutive Subarrays/3284.py
{ "start": 0, "end": 513 }
class ____: def getSum(self, nums: list[int]) -> int: def getSum(diff: int) -> int: """Returns the sum of all subarrays with a difference of `diff`.""" res = nums[0] summ = nums[0] count = 1 for prev, num in itertools.pairwise(nums): if num == prev + diff: count += ...
Solution
python
run-llama__llama_index
llama-index-integrations/storage/chat_store/llama-index-storage-chat-store-upstash/llama_index/storage/chat_store/upstash/base.py
{ "start": 741, "end": 11420 }
class ____(BaseChatStore): """ Upstash chat store for storing and retrieving chat messages using Redis. This class implements the BaseChatStore interface and provides methods for managing chat messages in an Upstash Redis database. """ _sync_redis_client: SyncRedis = PrivateAttr() _async_r...
UpstashChatStore
python
scipy__scipy
scipy/stats/_continuous_distns.py
{ "start": 196349, "end": 199068 }
class ____(rv_continuous): r"""A left-skewed Levy continuous random variable. %(before_notes)s See Also -------- levy, levy_stable Notes ----- The probability density function for `levy_l` is: .. math:: f(x) = \frac{1}{|x| \sqrt{2\pi |x|}} \exp{ \left(-\frac{1}{2|x|} \rig...
levy_l_gen
python
numba__numba
numba/cuda/simulator/api.py
{ "start": 549, "end": 1164 }
class ____(object): ''' The stream API is supported in the simulator - however, all execution occurs synchronously, so synchronization requires no operation. ''' @contextmanager def auto_synchronize(self): yield def synchronize(self): pass def synchronize(): pass def...
stream
python
pappasam__jedi-language-server
jedi_language_server/initialization_options.py
{ "start": 2220, "end": 2340 }
class ____: enable: bool = True disable: HoverDisable = field(default_factory=HoverDisable) @light_dataclass
Hover
python
sqlalchemy__sqlalchemy
test/orm/test_query.py
{ "start": 147946, "end": 160433 }
class ____(QueryTest, AssertsCompiledSQL): __dialect__ = "default" def test_basic(self): User = self.classes.User eq_( [User(id=7), User(id=8), User(id=9), User(id=10)], fixture_session().query(User).order_by(User.id).distinct().all(), ) eq_( ...
DistinctTest
python
huggingface__transformers
tests/models/informer/test_modeling_informer.py
{ "start": 1479, "end": 7699 }
class ____: def __init__( self, parent, batch_size=13, prediction_length=7, context_length=14, cardinality=19, embedding_dimension=5, num_time_features=4, is_training=True, hidden_size=16, num_hidden_layers=2, num_attent...
InformerModelTester
python
sqlalchemy__sqlalchemy
lib/sqlalchemy/dialects/postgresql/ranges.py
{ "start": 31682, "end": 31820 }
class ____(AbstractMultiRange[datetime]): """Represent the PostgreSQL TSRANGE type.""" __visit_name__ = "TSMULTIRANGE"
TSMULTIRANGE
python
plotly__plotly.py
plotly/graph_objs/table/header/_line.py
{ "start": 233, "end": 4141 }
class ____(_BaseTraceHierarchyType): _parent_path_str = "table.header" _path_str = "table.header.line" _valid_props = {"color", "colorsrc", "width", "widthsrc"} @property def color(self): """ The 'color' property is a color and may be specified as: - A hex string (e.g. '#f...
Line
python
getsentry__sentry
tests/sentry/web/frontend/test_auth_saml2.py
{ "start": 1760, "end": 11484 }
class ____(AuthProviderTestCase): provider = DummySAML2Provider provider_name = "saml2_dummy" def setUp(self) -> None: self.user = self.create_user("rick@onehundredyears.com") self.organization = self.create_organization(owner=self.user, name="saml2-org") self.auth_provider_inst = A...
AuthSAML2Test
python
joke2k__faker
faker/exceptions.py
{ "start": 0, "end": 94 }
class ____(Exception): """The base exception for all Faker exceptions."""
BaseFakerException
python
getsentry__sentry
src/sentry/workflow_engine/transformers.py
{ "start": 4900, "end": 7392 }
class ____(ConfigTransformer): """Transforms target_type field between integer and string representations.""" def __init__(self, api_schema: dict[str, Any]): self.api_schema = api_schema self.action_target_to_string = dict(ActionTarget.as_choices()) self.action_target_from_string = {v: ...
TargetTypeConfigTransformer
python
pdm-project__pdm
src/pdm/exceptions.py
{ "start": 1409, "end": 1542 }
class ____(PdmUsageError, KeyError): def __str__(self) -> str: return f"No such config key: {self.args[0]!r}"
NoConfigError
python
mlflow__mlflow
examples/evaluation/evaluate_with_custom_metrics_comprehensive.py
{ "start": 987, "end": 2662 }
class ____: def __init__(self, x): self.x = x def custom_artifact(eval_df, builtin_metrics, _artifacts_dir): example_np_arr = np.array([1, 2, 3]) example_df = pd.DataFrame({"test": [2.2, 3.1], "test2": [3, 2]}) example_dict = {"hello": "there", "test_list": [0.1, 0.3, 4]} example_dict.upda...
ExampleClass
python
doocs__leetcode
solution/1400-1499/1448.Count Good Nodes in Binary Tree/Solution.py
{ "start": 192, "end": 588 }
class ____: def goodNodes(self, root: TreeNode) -> int: def dfs(root: TreeNode, mx: int): if root is None: return nonlocal ans if mx <= root.val: ans += 1 mx = root.val dfs(root.left, mx) dfs(root.rig...
Solution
python
pytorch__pytorch
test/dynamo/test_python_dispatcher.py
{ "start": 2388, "end": 4832 }
class ____(torch.nn.Module): def forward(self, L_x_: "f32[2, 3]"): l_x_ = L_x_ sub: "f32[2, 3]" = l_x_ - 1; l_x_ = None sin: "f32[2, 3]" = torch.sin(sub); sub = None return (sin,) """, # NOQA: B950 ) @unittest.skipIf(not TEST_CUDA and not TEST_XPU, "requires cuda or ...
GraphModule
python
scipy__scipy
scipy/signal/tests/test_windows.py
{ "start": 1987, "end": 2493 }
class ____: def test_basic(self, xp): xp_assert_close(windows.bartlett(6, xp=xp), xp.asarray([0, 0.4, 0.8, 0.8, 0.4, 0], dtype=xp.float64)) xp_assert_close(windows.bartlett(7, xp=xp), xp.asarray([0, 1/3, 2/3, 1.0, 2/3, 1/3, 0], dtype=xp.float64)) ...
TestBartlett
python
python-pillow__Pillow
Tests/test_imagefile.py
{ "start": 492, "end": 7388 }
class ____: def test_parser(self) -> None: def roundtrip(format: str) -> tuple[Image.Image, Image.Image]: im = hopper("L").resize((1000, 1000), Image.Resampling.NEAREST) if format in ("MSP", "XBM"): im = im.convert("1") test_file = BytesIO() ...
TestImageFile
python
huggingface__transformers
src/transformers/models/yoso/configuration_yoso.py
{ "start": 781, "end": 6419 }
class ____(PreTrainedConfig): r""" This is the configuration class to store the configuration of a [`YosoModel`]. It is used to instantiate an YOSO model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar configurat...
YosoConfig
python
tensorflow__tensorflow
tensorflow/python/ops/image_ops_test.py
{ "start": 155235, "end": 160292 }
class ____(test_util.TensorFlowTestCase): def _ResizeImageWithPad(self, x, target_height, target_width, use_tensor_inputs): if use_tensor_inputs: target_height = ops.convert_to_tensor(target_height) target_width = ops.convert_to_tensor(target_width) x_tensor = ops.conv...
ResizeImageWithPadV1Test
python
getsentry__sentry
tests/sentry/integrations/github/test_webhooks.py
{ "start": 13750, "end": 26837 }
class ____(APITestCase): def setUp(self) -> None: self.url = "/extensions/github/webhook/" self.secret = "b3002c3e321d4b7880360d397db2ccfd" options.set("github-app.webhook-secret", self.secret) def _create_integration_and_send_push_event(self): future_expires = datetime.now().re...
PushEventWebhookTest
python
tensorflow__tensorflow
tensorflow/lite/python/metrics/metrics_nonportable_test.py
{ "start": 2100, "end": 5145 }
class ____(test_util.TensorFlowTestCase): def test_TFLiteMetrics_creation_no_arg_success(self): metrics.TFLiteMetrics() def test_TFLiteMetrics_creation_arg_success(self): metrics.TFLiteMetrics('hash', '/path/to/model') def test_TFLiteMetrics_creation_fails_with_only_hash(self): with self.assertRais...
MetricsNonportableTest
python
doocs__leetcode
solution/1200-1299/1254.Number of Closed Islands/Solution.py
{ "start": 0, "end": 557 }
class ____: def closedIsland(self, grid: List[List[int]]) -> int: def dfs(i: int, j: int) -> int: res = int(0 < i < m - 1 and 0 < j < n - 1) grid[i][j] = 1 for a, b in pairwise(dirs): x, y = i + a, j + b if 0 <= x < m and 0 <= y < n and gri...
Solution
python
catalyst-team__catalyst
examples/detection/models/yolo_x.py
{ "start": 5919, "end": 9310 }
class ____(nn.Module): # number of blocks from dark2 to dark5. depth2blocks = {21: [1, 2, 2, 1], 53: [2, 8, 8, 4]} def __init__( self, depth, in_channels=3, stem_out_channels=32, out_features=("dark3", "dark4", "dark5"), ): """ Args: d...
Darknet
python
airbytehq__airbyte
airbyte-integrations/connectors/source-github/source_github/github_schema.py
{ "start": 931935, "end": 932373 }
class ____(sgqlc.types.Type): """Information extracted from a repository's `CODEOWNERS` file.""" __schema__ = github_schema __field_names__ = ("errors",) errors = sgqlc.types.Field( sgqlc.types.non_null(sgqlc.types.list_of(sgqlc.types.non_null("RepositoryCodeownersError"))), graphql_name="error...
RepositoryCodeowners
python
facebook__pyre-check
tools/upgrade/errors.py
{ "start": 17272, "end": 26371 }
class ____: error_comments: List[List[str]] opened_expressions: int is_active: bool def __init__(self) -> None: self.error_comments = [] self.opened_expressions = 0 self.is_active = False def ready_to_suppress(self) -> bool: # Line break block has been filled and th...
LineBreakBlock
python
PyCQA__pylint
tests/functional/n/none_dunder_protocols.py
{ "start": 225, "end": 278 }
class ____(type): __contains__ = None
MetaContainer
python
django__django
tests/forms_tests/tests/test_media.py
{ "start": 3657, "end": 32502 }
class ____(SimpleTestCase): """Tests for the media handling on widgets and forms""" def test_construction(self): # Check construction of media objects m = Media( css={"all": ("path/to/css1", "/path/to/css2")}, js=( "/path/to/js1", "http://...
FormsMediaTestCase
python
django__django
django/contrib/postgres/operations.py
{ "start": 3195, "end": 3323 }
class ____(CreateExtension): def __init__(self, hints=None): super().__init__("pgcrypto", hints=hints)
CryptoExtension
python
chroma-core__chroma
chromadb/test/ef/test_custom_ef.py
{ "start": 427, "end": 1000 }
class ____(EmbeddingFunction[Embeddable]): def __call__(self, input: Embeddable) -> Embeddings: return cast(Embeddings, np.array([1, 2, 3]).tolist()) def __init__(self, *args: Any, **kwargs: Any) -> None: pass @staticmethod def name() -> str: return "custom_embedding_function" ...
CustomEmbeddingFunction
python
kamyu104__LeetCode-Solutions
Python/longest-duplicate-substring.py
{ "start": 457, "end": 1576 }
class ____(object): def longestDupSubstring(self, S): """ :type S: str :rtype: str """ M = 10**9+7 D = 26 def check(S, L): p = pow(D, L, M) curr = reduce(lambda x, y: (D*x+ord(y)-ord('a')) % M, S[:L], 0) lookup = collection...
Solution
python
wandb__wandb
wandb/vendor/pygments/lexers/lisp.py
{ "start": 12877, "end": 16554 }
class ____(RegexLexer): """ Lexer for `Hy <http://hylang.org/>`_ source code. .. versionadded:: 2.0 """ name = 'Hy' aliases = ['hylang'] filenames = ['*.hy'] mimetypes = ['text/x-hy', 'application/x-hy'] special_forms = ( 'cond', 'for', '->', '->>', 'car', 'cdr', 'f...
HyLexer
python
huggingface__transformers
tests/models/clvp/test_modeling_clvp.py
{ "start": 15094, "end": 20710 }
class ____(ModelTesterMixin, unittest.TestCase): all_model_classes = (ClvpModelForConditionalGeneration,) if is_torch_available() else () # Doesn't run generation tests. There are interface mismatches when using `generate` -- TODO @gante all_generative_model_classes = () test_resize_embeddings = False ...
ClvpModelForConditionalGenerationTest
python
ZoranPandovski__al-go-rithms
machine_learning/sentiment_analysis_twitter/python/sentiment_analysis.py
{ "start": 88, "end": 3004 }
class ____(object): ''' Generic Twitter Class for sentiment analysis. ''' def __init__(self): ''' Class constructor or initialization method. ''' consumer_key = 'XXXXXXXXXXXXXXXXXXXXXXXX' consumer_secret = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX' access_token = 'XXX...
TwitterClient
python
numba__numba
numba/cuda/tests/cudapy/cache_usecases.py
{ "start": 99, "end": 1167 }
class ____: """ Provide a way to call a kernel as if it were a function. This allows the CUDA cache tests to closely match the CPU cache tests, and also to support calling cache use cases as njitted functions. The class wraps a function that takes an array for the return value and arguments, an...
UseCase
python
cython__cython
Cython/Shadow.py
{ "start": 3985, "end": 5761 }
class ____: undeclared = unreachable = maybe_uninitialized = unused = \ unused_arg = unused_result = \ lambda _: _EmptyDecoratorAndManager() _cython_inline = None def inline(f, *args, **kwds): if isinstance(f, str): global _cython_inline if _cython_inline is None: ...
warn
python
facebook__pyre-check
client/find_directories.py
{ "start": 7166, "end": 11509 }
class ____(enum.Enum): """ We support three different ways of handling third-party stubs, which are traditionally found in subdirectories of `typeshed/stubs`: - They can be omitted entirely, so that typeshed only has stdlib stubs - They can live in subdirectories of `typeshed/stubs` - Or they c...
TypeshedLayout
python
doocs__leetcode
solution/2100-2199/2167.Minimum Time to Remove All Cars Containing Illegal Goods/Solution.py
{ "start": 0, "end": 417 }
class ____: def minimumTime(self, s: str) -> int: n = len(s) pre = [0] * (n + 1) suf = [0] * (n + 1) for i, c in enumerate(s): pre[i + 1] = pre[i] if c == '0' else min(pre[i] + 2, i + 1) for i in range(n - 1, -1, -1): suf[i] = suf[i + 1] if s[i] == '0'...
Solution
python
altair-viz__altair
altair/vegalite/v6/schema/core.py
{ "start": 867459, "end": 873213 }
class ____(VegaLiteSchema): """ PointSelectionConfigWithoutType schema wrapper. Parameters ---------- clear : str, bool, dict, :class:`Stream`, :class:`EventStream`, :class:`MergedStream`, :class:`DerivedStream` Clears the selection, emptying it of all values. This property can be a `Event ...
PointSelectionConfigWithoutType
python
jazzband__prettytable
tests/test_prettytable.py
{ "start": 1001, "end": 4361 }
class ____: def test_none_char_valid_option(self) -> None: PrettyTable(["Field 1", "Field 2", "Field 3"], none_format="") def test_none_char_invalid_option(self) -> None: with pytest.raises(TypeError) as exc: PrettyTable(["Field 1", "Field 2", "Field 3"], none_format=2) asse...
TestNoneOption
python
tensorflow__tensorflow
tensorflow/python/autograph/pyct/static_analysis/liveness_test.py
{ "start": 2668, "end": 13744 }
class ____(LivenessAnalyzerTestBase): def test_live_out_try_block(self): def test_fn(x, a, b, c): # pylint:disable=unused-argument if a > 0: try: pass except: # pylint:disable=bare-except pass return x node = self._parse_and_analyze(test_fn) fn_body = n...
LivenessAnalyzerTest
python
django__django
django/forms/widgets.py
{ "start": 12222, "end": 12328 }
class ____(Input): input_type = "color" template_name = "django/forms/widgets/color.html"
ColorInput
python
readthedocs__readthedocs.org
dockerfiles/settings/build.py
{ "start": 49, "end": 450 }
class ____(DockerBaseSettings): @property def DATABASES(self): # noqa return {} DONT_HIT_DB = True SHOW_DEBUG_TOOLBAR = False # The secret key is not needed from the builders. # If you get an error about it missing, you may be doing # something that shouldn't be done from the build...
BuildDevSettings
python
more-itertools__more-itertools
tests/test_more.py
{ "start": 5363, "end": 5826 }
class ____(TestCase): """Tests for ``nth_or_last()``""" def test_basic(self): self.assertEqual(mi.nth_or_last(range(3), 1), 1) self.assertEqual(mi.nth_or_last(range(3), 3), 2) def test_default_value(self): default = 42 self.assertEqual(mi.nth_or_last(range(0), 3, default), ...
NthOrLastTests
python
sqlalchemy__sqlalchemy
test/typing/plain_files/orm/relationship.py
{ "start": 3749, "end": 5220 }
class ____(Employee): engineer_info: Mapped[str] __mapper_args__ = {"polymorphic_identity": "engineer"} if typing.TYPE_CHECKING: assert_type(User.extra, InstrumentedAttribute[str | None]) assert_type(User.extra_name, InstrumentedAttribute[str | None]) assert_type(Address.email, InstrumentedAttr...
Engineer
python
allegroai__clearml
clearml/backend_api/services/v2_20/workers.py
{ "start": 13886, "end": 24379 }
class ____(NonStrictDataModel): """ :param id: Worker ID :type id: str :param user: Associated user (under whose credentials are used by the worker daemon) :type user: IdNameEntry :param company: Associated company :type company: IdNameEntry :param ip: IP of the worker :type ip: str ...
Worker
python
numpy__numpy
numpy/_core/tests/test_overrides.py
{ "start": 16015, "end": 16440 }
class ____: def test_repr(self): # gh-12162: should still be defined even if __array_function__ doesn't # implement np.array_repr() class MyArray(np.ndarray): def __array_function__(*args, **kwargs): return NotImplemented array = np.array(1).view(MyArra...
TestNDArrayMethods
python
great-expectations__great_expectations
great_expectations/expectations/metrics/column_aggregate_metric_provider.py
{ "start": 10083, "end": 12613 }
class ____(TableMetricProvider): """Base class for all Column Aggregate Metrics, which define metrics to be calculated in aggregate from a given column. An example of this is `column.mean`, which returns the mean of a given column. Args: metric_name (str): A name identifying the metric. Me...
ColumnAggregateMetricProvider
python
matplotlib__matplotlib
lib/mpl_toolkits/axes_grid1/mpl_axes.py
{ "start": 1847, "end": 4251 }
class ____(Artist): def __init__(self, axis, axisnum, spine): self._axis = axis self._axisnum = axisnum self.line = spine if isinstance(axis, XAxis): self._axis_direction = ["bottom", "top"][axisnum-1] elif isinstance(axis, YAxis): self._axis_directio...
SimpleAxisArtist
python
pennersr__django-allauth
tests/apps/socialaccount/providers/windowslive/tests.py
{ "start": 250, "end": 1055 }
class ____(OAuth2TestsMixin, TestCase): provider_id = WindowsLiveProvider.id def get_mocked_response(self): return MockedResponse( HTTPStatus.OK, """ { "first_name": "James", "last_name": "Smith", "name": "James Smith", "locale": "...
WindowsLiveTests
python
django__django
tests/admin_inlines/admin.py
{ "start": 10011, "end": 10130 }
class ____(admin.TabularInline): model = SomeChildModel form = ChildHiddenFieldForm
ChildHiddenFieldTabularInline
python
tensorflow__tensorflow
tensorflow/python/data/experimental/kernel_tests/iterator_model_ops_test.py
{ "start": 1137, "end": 3858 }
class ____(test_base.DatasetTestBase, parameterized.TestCase): @combinations.generate(test_base.v2_eager_only_combinations()) def test_get_model_proto_not_empty(self): options = dataset_ops.options_lib.Options() options.autotune.enabled = True dataset = dataset_ops.Dataset.range(100000) dataset = ...
IteratorModelOpsTest
python
mkdocs__mkdocs
mkdocs/tests/theme_tests.py
{ "start": 426, "end": 4252 }
class ____(unittest.TestCase): def test_simple_theme(self): theme = Theme(name='mkdocs') self.assertEqual( theme.dirs, [os.path.join(theme_dir, 'mkdocs'), mkdocs_templates_dir], ) self.assertEqual(theme.static_templates, {'404.html', 'sitemap.xml'}) se...
ThemeTests
python
sqlalchemy__sqlalchemy
test/orm/test_unitofworkv2.py
{ "start": 26145, "end": 27527 }
class ____( fixtures.DeclarativeMappedTest, testing.AssertsExecutionResults, ): @classmethod def setup_classes(cls): Base = cls.DeclarativeBasic class A(Base): __tablename__ = "a" id = Column(Integer, primary_key=True) bs = relationship("B", back_po...
RaiseLoadIgnoredTest
python
google__jax
tests/dtypes_test.py
{ "start": 23127, "end": 33276 }
class ____(jtu.JaxTestCase): def testIsSubdtypeExtended(self): self.assertTrue(dtypes.issubdtype(dtypes.extended, dtypes.extended)) self.assertTrue(dtypes.issubdtype(dtypes.extended, np.generic)) self.assertFalse(dtypes.issubdtype(dtypes.extended, np.number)) self.assertTrue(jnp.issubdtype(dtypes.pr...
ExtendedDTypeTest
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/genericType28.py
{ "start": 2558, "end": 2617 }
class ____(Contra_TA[Co_TA[T_contra]]): ...
CoToContra_WithTA
python
keras-team__keras
keras/src/layers/regularization/activity_regularization.py
{ "start": 177, "end": 1283 }
class ____(Layer): """Layer that applies an update to the cost function based input activity. Args: l1: L1 regularization factor (positive float). l2: L2 regularization factor (positive float). Input shape: Arbitrary. Use the keyword argument `input_shape` (tuple of integer...
ActivityRegularization
python
huggingface__transformers
src/transformers/models/owlv2/modeling_owlv2.py
{ "start": 51385, "end": 52126 }
class ____(nn.Module): def __init__(self, config: Owlv2Config, out_dim: int = 4): super().__init__() width = config.vision_config.hidden_size self.dense0 = nn.Linear(width, width) self.dense1 = nn.Linear(width, width) self.gelu = nn.GELU() self.dense2 = nn.Linear(wid...
Owlv2BoxPredictionHead
python
airbytehq__airbyte
airbyte-integrations/bases/connector-acceptance-test/unit_tests/test_utils.py
{ "start": 4971, "end": 6066 }
class ____: def __init__(self, status: dict, iter_logs: Iterable): self.wait = Mock(return_value=status) self.logs = Mock(return_value=iter(iter_logs)) self.remove = Mock() class Image: pass self.image = Image() def binary_generator(lengths, last_line=None): ...
MockContainer
python
tqdm__tqdm
tqdm/utils.py
{ "start": 3473, "end": 3992 }
class ____(object): """Assumes child has self._comparable attr/@property""" def __lt__(self, other): return self._comparable < other._comparable def __le__(self, other): return (self < other) or (self == other) def __eq__(self, other): return self._comparable == other._comparab...
Comparable
python
allegroai__clearml
clearml/utilities/pyhocon/config_parser.py
{ "start": 28902, "end": 29631 }
class ____(TokenConverter): """Parse a list [elt1, etl2, ...] """ def __init__(self, expr=None): super(ListParser, self).__init__(expr) self.saveAsList = True def postParse(self, instring, loc, token_list): """Create a list from the tokens :param instring: :par...
ListParser
python
walkccc__LeetCode
solutions/2751. Robot Collisions/2751.py
{ "start": 47, "end": 122 }
class ____: index: int position: int health: int direction: str
Robot
python
huggingface__transformers
src/transformers/models/cwm/modeling_cwm.py
{ "start": 13121, "end": 14950 }
class ____(GradientCheckpointingLayer): def __init__(self, config: CwmConfig, layer_idx: int): super().__init__() self.hidden_size = config.hidden_size self.self_attn = CwmAttention(config=config, layer_idx=layer_idx) self.mlp = CwmMLP(config) self.input_layernorm = CwmRMSNo...
CwmDecoderLayer
python
kubernetes-client__python
kubernetes/client/models/v1_ingress.py
{ "start": 383, "end": 7106 }
class ____(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attri...
V1Ingress
python
PrefectHQ__prefect
src/prefect/settings/models/results.py
{ "start": 332, "end": 1633 }
class ____(PrefectBaseSettings): """ Settings for controlling result storage behavior """ model_config: ClassVar[SettingsConfigDict] = build_settings_config(("results",)) default_serializer: str = Field( default="pickle", description="The default serializer to use when not otherwis...
ResultsSettings
python
python__mypy
mypyc/irbuild/for_helpers.py
{ "start": 22389, "end": 24779 }
class ____(ForGenerator): """Generate IR for a for loop over an arbitrary iterable (the general case).""" def need_cleanup(self) -> bool: # Create a new cleanup block for when the loop is finished. return True def init(self, expr_reg: Value, target_type: RType) -> None: # Define ta...
ForIterable
python
sqlalchemy__sqlalchemy
test/base/test_concurrency.py
{ "start": 960, "end": 5260 }
class ____(fixtures.TestBase): __requires__ = ("greenlet",) @async_test async def test_ok(self): eq_(await greenlet_spawn(go, run1, run2), 3) @async_test async def test_async_error(self): async def err(): raise ValueError("an error") with expect_raises_message(...
TestAsyncioCompat
python
dagster-io__dagster
python_modules/dagster/dagster/_core/snap/node.py
{ "start": 2795, "end": 3309 }
class ____: mapped_node_name: str mapped_output_name: str external_output_name: str def build_output_mapping_snap(output_mapping: OutputMapping) -> OutputMappingSnap: return OutputMappingSnap( mapped_node_name=output_mapping.maps_from.node_name, mapped_output_name=output_mapping.maps_f...
OutputMappingSnap
python
sphinx-doc__sphinx
tests/test_ext_intersphinx/test_ext_intersphinx_cache.py
{ "start": 4786, "end": 11071 }
class ____(IntersphinxProject): name = 'spam' port = 9341 # needed since otherwise it's an automatic port def __init__( self, version: int, route: str, *, item_name: str = 'ham', domain_name: str = 'py', object_type: str = 'module', ) -> None: ...
SingleEntryProject
python
pytransitions__transitions
transitions/extensions/nesting.py
{ "start": 6484, "end": 9135 }
class ____(State): """A state which allows substates. Attributes: states (OrderedDict): A list of substates of the current state. events (dict): A list of events defined for the nested state. initial (list, str, NestedState or Enum): (Name of a) child or list of children that should be e...
NestedState
python
explosion__spaCy
spacy/lang/eu/__init__.py
{ "start": 294, "end": 387 }
class ____(Language): lang = "eu" Defaults = BasqueDefaults __all__ = ["Basque"]
Basque
python
spyder-ide__spyder
spyder/plugins/maininterpreter/plugin.py
{ "start": 724, "end": 3779 }
class ____(SpyderPluginV2): """ Main interpreter Plugin. """ NAME = "main_interpreter" REQUIRES = [Plugins.Preferences] CONTAINER_CLASS = MainInterpreterContainer CONF_WIDGET_CLASS = MainInterpreterConfigPage CONF_SECTION = NAME CONF_FILE = False CAN_BE_DISABLED = False # -...
MainInterpreter
python
tensorflow__tensorflow
tensorflow/python/keras/metrics.py
{ "start": 42692, "end": 48162 }
class ____(Metric): """Computes the precision of the predictions with respect to the labels. The metric creates two local variables, `true_positives` and `false_positives` that are used to compute the precision. This value is ultimately returned as `precision`, an idempotent operation that simply divides `true...
Precision
python
pytorch__pytorch
test/dynamo/cpython/3_13/test_raise.py
{ "start": 1790, "end": 1925 }
class ____: def __enter__(self): return self def __exit__(self, exc_type, exc_value, exc_tb): return True
Context
python
PyCQA__pylint
doc/data/messages/u/unsubscriptable-object/good.py
{ "start": 0, "end": 165 }
class ____: def __init__(self): self.colors = ["red", "orange", "yellow"] def __getitem__(self, idx): return self.colors[idx] Fruit()[1]
Fruit
python
sqlalchemy__sqlalchemy
lib/sqlalchemy/dialects/postgresql/ext.py
{ "start": 11170, "end": 11980 }
class ____(_regconfig_fn): """The PostgreSQL ``to_tsvector`` SQL function. This function applies automatic casting of the REGCONFIG argument to use the :class:`_postgresql.REGCONFIG` datatype automatically, and applies a return type of :class:`_postgresql.TSVECTOR`. Assuming the PostgreSQL dialect...
to_tsvector
python
huggingface__transformers
src/transformers/models/unispeech_sat/modular_unispeech_sat.py
{ "start": 6015, "end": 9566 }
class ____(PreTrainedModel): config: UniSpeechSatConfig base_model_prefix = "unispeech_sat" main_input_name = "input_values" input_modalities = "audio" supports_gradient_checkpointing = True _supports_flash_attn = True _supports_sdpa = True _supports_flex_attn = True @torch.no_grad(...
UniSpeechSatPreTrainedModel
python
readthedocs__readthedocs.org
readthedocs/rtd_tests/tests/test_project_views.py
{ "start": 25447, "end": 25824 }
class ____(TestCase): def test_project_filtering_work_with_tags_with_space_in_name(self): pip = get(Project, slug="pip", privacy_level=PUBLIC) pip.tags.add("tag with space") response = self.client.get("/projects/tags/tag-with-space/") self.assertContains(response, '"/projects/pip/"')...
TestTags
python
scikit-learn__scikit-learn
sklearn/preprocessing/_function_transformer.py
{ "start": 737, "end": 16790 }
class ____(TransformerMixin, BaseEstimator): """Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (and optionally y) arguments to a user-defined function or function object and returns the result of this function. This is useful for stateless transformations such...
FunctionTransformer
python
spack__spack
lib/spack/spack/install_test.py
{ "start": 7663, "end": 29271 }
class ____: """The class that manages stand-alone (post-install) package tests.""" def __init__(self, pkg: "spack.package_base.PackageBase") -> None: """ Args: pkg: package being tested Raises: ValueError: if the package is not concrete """ if no...
PackageTest
python
gevent__gevent
src/greentest/3.13/test_threading.py
{ "start": 71652, "end": 72599 }
class ____(lock_tests.RLockTests): locktype = staticmethod(threading._CRLock) def test_signature(self): # gh-102029 with warnings.catch_warnings(record=True) as warnings_log: threading.RLock() self.assertEqual(warnings_log, []) arg_types = [ ((1,), {}), ...
CRLockTests
python
getsentry__sentry
src/sentry/hybridcloud/rpc/service.py
{ "start": 15670, "end": 15790 }
class ____(Exception): """Indicate that an RPC service or method name could not be resolved."""
RpcResolutionException
python
wandb__wandb
wandb/sdk/artifacts/_generated/fragments.py
{ "start": 303, "end": 443 }
class ____(GQLResult): typename__: Typename[Literal["ArtifactAlias"]] = "ArtifactAlias" id: GQLId alias: str
ArtifactAliasFragment
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/dataclassTransform1.py
{ "start": 1643, "end": 1799 }
class ____: id: int name: str # This should generate an error because a non-frozen class # cannot inherit from a frozen class. @create_model
Customer3
python
explosion__spaCy
spacy/lang/te/__init__.py
{ "start": 216, "end": 309 }
class ____(Language): lang = "te" Defaults = TeluguDefaults __all__ = ["Telugu"]
Telugu
python
airbytehq__airbyte
airbyte-integrations/connectors/source-webflow/source_webflow/auth.py
{ "start": 182, "end": 705 }
class ____: """ Mixin class for providing additional HTTP header for specifying the "accept-version" """ def __init__(self, *, accept_version_header: str = "accept-version", accept_version: str, **kwargs): super().__init__(**kwargs) self.accept_version = accept_version self.acce...
WebflowAuthMixin
python
huggingface__transformers
src/transformers/models/phi4_multimodal/modeling_phi4_multimodal.py
{ "start": 48397, "end": 49138 }
class ____(nn.Module): def __init__(self, hidden_size, eps=1e-6): """ Phi4MultimodalRMSNorm is equivalent to T5LayerNorm """ super().__init__() self.weight = nn.Parameter(torch.ones(hidden_size)) self.variance_epsilon = eps def forward(self, hidden_states): ...
Phi4MultimodalRMSNorm
python
sqlalchemy__sqlalchemy
lib/sqlalchemy/dialects/postgresql/json.py
{ "start": 2942, "end": 7597 }
class ____(sqltypes.JSON): """Represent the PostgreSQL JSON type. :class:`_postgresql.JSON` is used automatically whenever the base :class:`_types.JSON` datatype is used against a PostgreSQL backend, however base :class:`_types.JSON` datatype does not provide Python accessors for PostgreSQL-specifi...
JSON
python
charliermarsh__ruff
crates/ty_python_semantic/resources/corpus/77_class__class__param.py
{ "start": 0, "end": 78 }
class ____: def x(self): def f(__class__): __class__
Outer
python
sympy__sympy
sympy/printing/c.py
{ "start": 26721, "end": 27011 }
class ____(C99CodePrinter): @requires(headers={'stdalign.h'}) def _print_alignof(self, expr): arg, = expr.args return 'alignof(%s)' % self._print(arg) c_code_printers = { 'c89': C89CodePrinter, 'c99': C99CodePrinter, 'c11': C11CodePrinter }
C11CodePrinter
python
kubernetes-client__python
kubernetes/client/models/resource_v1_resource_claim.py
{ "start": 383, "end": 7632 }
class ____(object): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. """ """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attri...
ResourceV1ResourceClaim
python
matplotlib__matplotlib
doc/sphinxext/redirect_from.py
{ "start": 1683, "end": 2523 }
class ____(Domain): """ The sole purpose of this domain is a parallel_read_safe data store for the redirects mapping. """ name = 'redirect_from' label = 'redirect_from' @property def redirects(self): """The mapping of the redirects.""" return self.data.setdefault('redire...
RedirectFromDomain
python
pypa__twine
twine/exceptions.py
{ "start": 1721, "end": 1926 }
class ____(TwineException): """A package file was provided that could not be found on the file system. This is only used when attempting to register a package_file. """ pass
PackageNotFound
python
jazzband__django-polymorphic
example/orders/admin.py
{ "start": 203, "end": 298 }
class ____(StackedPolymorphicInline.Child): model = CreditCardPayment
CreditCardPaymentInline
python
scipy__scipy
scipy/sparse/tests/test_64bit.py
{ "start": 9180, "end": 12975 }
class ____: # classes that use get_index_dtype MAT_CLASSES = [ bsr_matrix, coo_matrix, csc_matrix, csr_matrix, dia_matrix, bsr_array, coo_array, csc_array, csr_array, dia_array, ] def _compare_index_dtype(self, m, dtype): dtype = np.dtype(dtype) if m.format in ['csc', 'c...
Test64BitTools