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
tensorflow__tensorflow
tensorflow/python/data/ops/load_op.py
{ "start": 7619, "end": 9572 }
class ____(dataset_ops.DatasetSource): """A dataset for listing snapshot chunk files. It supports listing partially written snapshots. When a snapshot is being written, it returns the currently available chunk files. """ def __init__(self, snapshot_path: str): self._snapshot_path = snapshot_path var...
_ListSnapshotChunksDataset
python
realpython__materials
pygame-a-primer/py_tut_with_images.py
{ "start": 1729, "end": 2585 }
class ____(pygame.sprite.Sprite): def __init__(self): super(Enemy, self).__init__() self.surf = pygame.image.load("missile.png").convert() self.surf.set_colorkey((255, 255, 255), RLEACCEL) # The starting position is randomly generated, as is the speed self.rect = self.surf.ge...
Enemy
python
getsentry__sentry
src/sentry/auth/services/auth/model.py
{ "start": 678, "end": 956 }
class ____(RpcModel): id: int = -1 organization_id: int = -1 key: str = Field(repr=False, default="") status: int = 0 allowed_origins: list[str] = Field(default_factory=list) label: str = "" scope_list: list[str] = Field(default_factory=list)
RpcApiKey
python
pytorch__pytorch
torch/nn/modules/instancenorm.py
{ "start": 4167, "end": 7754 }
class ____(_InstanceNorm): r"""Applies Instance Normalization. This operation applies Instance Normalization over a 2D (unbatched) or 3D (batched) input as described in the paper `Instance Normalization: The Missing Ingredient for Fast Stylization <https://arxiv.org/abs/1607.08022>`__. .. math...
InstanceNorm1d
python
django__django
tests/template_tests/filter_tests/test_join.py
{ "start": 2884, "end": 3626 }
class ____(SimpleTestCase): def test_list(self): self.assertEqual(join([0, 1, 2], "glue"), "0glue1glue2") def test_autoescape(self): self.assertEqual( join(["<a>", "<img>", "</a>"], "<br>"), "&lt;a&gt;&lt;br&gt;&lt;img&gt;&lt;br&gt;&lt;/a&gt;", ) def test_au...
FunctionTests
python
dagster-io__dagster
python_modules/automation/automation_tests/dagster_docs_tests/test_fixtures/test_public_class.py
{ "start": 2123, "end": 2498 }
class ____: """Another public class to test multiple classes.""" @public def another_public_method(self): """Another public method that should be validated.""" return "another_public" def another_non_public_method(self): """Another non-public method that should NOT be validated...
AnotherPublicClass
python
airbytehq__airbyte
airbyte-ci/connectors/connectors_qa/src/connectors_qa/checks/metadata.py
{ "start": 436, "end": 504 }
class ____(Check): category = CheckCategory.METADATA
MetadataCheck
python
eventlet__eventlet
eventlet/zipkin/_thrift/zipkinCore/ttypes.py
{ "start": 5852, "end": 8873 }
class ____: """ Attributes: - key - value - annotation_type - host """ thrift_spec = ( None, # 0 (1, TType.STRING, 'key', None, None, ), # 1 (2, TType.STRING, 'value', None, None, ), # 2 (3, TType.I32, 'annotation_type', None, None, ), # 3 (4, TType.STRUCT, 'host', (Endpoint, En...
BinaryAnnotation
python
Pylons__pyramid
tests/test_path.py
{ "start": 5508, "end": 6385 }
class ____(unittest.TestCase): def _getTargetClass(self): from pyramid.path import Resolver return Resolver def _makeOne(self, package): return self._getTargetClass()(package) def test_get_package_caller_package(self): from pyramid.path import CALLER_PACKAGE import...
TestResolver
python
pallets__werkzeug
examples/coolmagic/utils.py
{ "start": 2217, "end": 2382 }
class ____(BaseResponse): """ The concrete response object for the WSGI application. """ charset = "utf-8" default_mimetype = "text/html"
Response
python
apache__airflow
providers/amazon/tests/unit/amazon/aws/operators/test_emr_serverless.py
{ "start": 14085, "end": 45474 }
class ____: def setup_method(self): self.mock_context = mock.MagicMock() @mock.patch.object(EmrServerlessHook, "get_waiter") @mock.patch.object(EmrServerlessHook, "conn") def test_job_run_app_started(self, mock_conn, mock_get_waiter): mock_get_waiter().wait.return_value = True m...
TestEmrServerlessStartJobOperator
python
mlflow__mlflow
tests/store/artifact/test_http_artifact_repo.py
{ "start": 1560, "end": 16345 }
class ____: def __init__(self, name, mode): self.name = name self.mode = mode def __eq__(self, other): return self.name == other.name and self.mode == other.mode @pytest.fixture def http_artifact_repo(): artifact_uri = "http://test.com/api/2.0/mlflow-artifacts/artifacts" retur...
FileObjectMatcher
python
rq__rq
tests/fixtures.py
{ "start": 5055, "end": 6116 }
class ____: pass def kill_horse(horse_pid_key: str, connection_kwargs: dict, interval: float = 1.5): """ Kill the worker horse process by its PID stored in a Redis key. :param horse_pid_key: Redis key where the horse PID is stored :param connection_kwargs: Connection parameters for Redis :para...
DummyQueue
python
walkccc__LeetCode
solutions/1105. Filling Bookcase Shelves/1105.py
{ "start": 0, "end": 586 }
class ____: def minHeightShelves(self, books: list[list[int]], shelfWidth: int) -> int: # dp[i] := the minimum height to place the first i books dp = [0] + [math.inf] * len(books) for i in range(len(books)): sumThickness = 0 maxHeight = 0 # Place books[j..i] on a new shelf. for j ...
Solution
python
getsentry__sentry
tests/sentry/core/endpoints/test_project_users.py
{ "start": 364, "end": 6105 }
class ____(APITestCase, SnubaTestCase): endpoint = "sentry-api-0-project-users" method = "get" def setUp(self) -> None: super().setUp() self.project = self.create_project( organization=self.organization, date_added=(timezone.now() - timedelta(hours=2)) ) timesta...
EventUserProjectUsersTest
python
miyuchina__mistletoe
mistletoe/contrib/scheme.py
{ "start": 1511, "end": 1693 }
class ____: def __init__(self, expr_token, body, env): self.params = [child.name for child in expr_token.children] self.body = body self.env = env
Procedure
python
python__mypy
mypyc/ir/class_ir.py
{ "start": 22038, "end": 23800 }
class ____: """Information needed to construct a non-extension class (Python class). Includes the class dictionary, a tuple of base classes, the class annotations dictionary, and the metaclass. """ def __init__(self, dict: Value, bases: Value, anns: Value, metaclass: Value) -> None: self.d...
NonExtClassInfo
python
bokeh__bokeh
src/bokeh/models/widgets/buttons.py
{ "start": 2116, "end": 2866 }
class ____(HasProps): ''' Shared properties for button-like widgets. ''' # explicit __init__ to support Init signatures def __init__(self, *args: Any, **kwargs: Any) -> None: super().__init__(*args, **kwargs) button_type = Enum(ButtonType, help=""" A style for the button, signifying i...
ButtonLike
python
ray-project__ray
python/ray/air/tests/mocked_wandb_integration.py
{ "start": 258, "end": 637 }
class ____( namedtuple( "MockTrial", [ "config", "trial_id", "trial_name", "experiment_dir_name", "placement_group_factory", "local_path", ], ) ): def __hash__(self): return hash(self.trial_id) def _...
Trial
python
getsentry__sentry
tests/sentry/workflow_engine/endpoints/serializers/test_workflow_group_history_serializer.py
{ "start": 665, "end": 8903 }
class ____(TestCase): def setUp(self) -> None: super().setUp() self.login_as(user=self.user) self.group = self.create_group() self.project = self.group.project self.organization = self.project.organization self.history: list[WorkflowFireHistory] = [] self.wor...
WorkflowGroupsPaginatedTest
python
numpy__numpy
numpy/f2py/tests/test_character.py
{ "start": 20703, "end": 21177 }
class ____(util.F2PyTest): sources = [util.getpath("tests", "src", "string", "gh24662.f90")] def test_gh24662(self): self.module.string_inout_optional() a = np.array('hi', dtype='S32') self.module.string_inout_optional(a) assert "output string" in a.tobytes().decode() wi...
TestStringOptionalInOut
python
getsentry__sentry
tests/sentry/db/postgres/schema/safe_migrations/integration/test_migrations.py
{ "start": 4202, "end": 4589 }
class ____(BaseSafeMigrationTest): app = "decimal_to_float_app" migrate_from = "0001_initial" migrate_to = "0002_type_conversion" def test(self) -> None: with pytest.raises( UnsafeOperationException, match="Altering the type of column Value.amount in this way is unsafe",...
ChangeDecimalToFloatTest
python
run-llama__llama_index
llama-index-integrations/protocols/llama-index-protocols-ag-ui/llama_index/protocols/ag_ui/agent.py
{ "start": 1055, "end": 1158 }
class ____(Event): tool_call_id: str tool_name: str tool_kwargs: Dict[str, Any]
ToolCallEvent
python
ansible__ansible
lib/ansible/modules/hostname.py
{ "start": 24125, "end": 24242 }
class ____(Hostname): platform = 'Linux' distribution = 'Kylin' strategy_class = FileStrategy
KylinHostname
python
kubernetes-client__python
kubernetes/client/models/v1_service_account_subject.py
{ "start": 383, "end": 4834 }
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...
V1ServiceAccountSubject
python
dagster-io__dagster
python_modules/dagster/dagster/_core/remote_representation/external_data.py
{ "start": 23614, "end": 24022 }
class ____: """A definition of a directed edge in the logical asset graph. An downstream asset that's depended by, and the corresponding input name in the upstream asset that it depends on. """ child_asset_key: AssetKey input_name: Optional[str] = None output_name: Optional[str] = None @...
AssetChildEdgeSnap
python
sqlalchemy__sqlalchemy
lib/sqlalchemy/sql/roles.py
{ "start": 2385, "end": 2682 }
class ____(AllowsLambdaRole, UsesInspection, ColumnListRole): __slots__ = () _role_name = ( "Column expression, FROM clause, or other columns clause element" ) @property def _select_iterable(self) -> _SelectIterable: raise NotImplementedError()
ColumnsClauseRole
python
ray-project__ray
python/ray/_private/gcs_pubsub.py
{ "start": 400, "end": 2445 }
class ____: def __init__(self, worker_id: bytes = None): self._worker_id = worker_id # self._subscriber_id needs to match the binary format of a random # SubscriberID / UniqueID, which is 28 (kUniqueIDSize) random bytes. self._subscriber_id = bytes(bytearray(random.getrandbits(8) for...
_SubscriberBase
python
kamyu104__LeetCode-Solutions
Python/valid-word-square.py
{ "start": 33, "end": 414 }
class ____(object): def validWordSquare(self, words): """ :type words: List[str] :rtype: bool """ for i in xrange(len(words)): for j in xrange(len(words[i])): if j >= len(words) or i >= len(words[j]) or \ words[j][i] != words[i][...
Solution
python
fsspec__filesystem_spec
fsspec/implementations/dask.py
{ "start": 3932, "end": 4466 }
class ____(AbstractBufferedFile): def __init__(self, mode="rb", **kwargs): if mode != "rb": raise ValueError('Remote dask files can only be opened in "rb" mode') super().__init__(**kwargs) def _upload_chunk(self, final=False): pass def _initiate_upload(self): ""...
DaskFile
python
pypa__warehouse
tests/unit/admin/views/test_prohibited_project_names.py
{ "start": 9223, "end": 13969 }
class ____: def test_get(self): request = pretend.stub(method="GET") assert views.bulk_add_prohibited_project_names(request) == {} def test_bulk_add(self, db_request): db_request.user = UserFactory.create() db_request.method = "POST" comment = "This is a comment" ...
TestBulkAddProhibitedProjectName
python
walkccc__LeetCode
solutions/2110. Number of Smooth Descent Periods of a Stock/2110.py
{ "start": 0, "end": 262 }
class ____: def getDescentPeriods(self, prices: list[int]) -> int: ans = 1 # prices[0] dp = 1 for i in range(1, len(prices)): if prices[i] == prices[i - 1] - 1: dp += 1 else: dp = 1 ans += dp return ans
Solution
python
spack__spack
lib/spack/spack/solver/asp.py
{ "start": 167789, "end": 168100 }
class ____(spack.error.UnsatisfiableSpecError): """Errors that indicate a bug in Spack.""" def __init__(self, msg): super(spack.error.UnsatisfiableSpecError, self).__init__(msg) self.provided = None self.required = None self.constraint_type = None
InternalConcretizerError
python
pytorch__pytorch
test/lazy/test_extract_compiled_graph.py
{ "start": 5401, "end": 6185 }
class ____(unittest.TestCase): test_sub = maketest(ModuleSub) # Same as test_sub but force aten::sub to fallback # We expect an exception caught because of LTC fallback. test_ltc_fallback = maketest( ModuleSub, exception_msg_pattern="fallback.*aten::sub", ctxmgr=force_fallback_ct...
OptimizeTest
python
rapidsai__cudf
python/cudf/cudf/core/dtypes.py
{ "start": 30786, "end": 42421 }
class ____(StructDtype): """ A data type for Interval data. Parameters ---------- subtype: str, np.dtype The dtype of the Interval bounds. closed: {'right', 'left', 'both', 'neither'}, default 'right' Whether the interval is closed on the left-side, right-side, both or n...
IntervalDtype
python
keras-team__keras
keras/src/layers/activations/leaky_relu_test.py
{ "start": 118, "end": 1224 }
class ____(testing.TestCase): @pytest.mark.requires_trainable_backend def test_leaky_relu(self): self.run_layer_test( leaky_relu.LeakyReLU, init_kwargs={ "negative_slope": 1, }, input_shape=(2, 3, 4), supports_masking=True, ...
LeakyReLUTest
python
Pylons__pyramid
src/pyramid/interfaces.py
{ "start": 24093, "end": 24448 }
class ____(Interface): """Marker interface for storing request extensions (properties and methods) which will be added to the request object.""" descriptors = Attribute( """A list of descriptors that will be added to each request.""" ) methods = Attribute("""A list of methods to be added to...
IRequestExtensions
python
apache__airflow
providers/google/tests/unit/google/cloud/operators/test_dataplex.py
{ "start": 38092, "end": 39038 }
class ____: @mock.patch(HOOK_STR) def test_execute(self, hook_mock): op = DataplexCatalogDeleteAspectTypeOperator( project_id=PROJECT_ID, location=REGION, aspect_type_id=ASPECT_TYPE_NAME, task_id="delete_task", gcp_conn_id=GCP_CONN_ID, ...
TestDataplexCatalogDeleteAspectTypeOperator
python
ipython__ipython
IPython/extensions/tests/test_deduperreload.py
{ "start": 56557, "end": 64024 }
class ____(ShellFixture): """ Unit tests for autoreload patching logic """ def test_modify_property(self): self.shell.magic_autoreload("2") mod_name, mod_file = self.new_module( """ class Foo: @property def foo(self): ...
DecoratorPatchingSuite
python
doocs__leetcode
lcof/面试题10- II. 青蛙跳台阶问题/Solution.py
{ "start": 0, "end": 159 }
class ____: def numWays(self, n: int) -> int: a = b = 1 for _ in range(n): a, b = b, (a + b) % 1000000007 return a
Solution
python
walkccc__LeetCode
solutions/3155. Maximum Number of Upgradable Servers/3155.py
{ "start": 0, "end": 486 }
class ____: def maxUpgrades( self, count: list[int], upgrade: list[int], sell: list[int], money: list[int], ) -> list[int]: # If there's enough money, upgrade all servers; otherwise, optimize by # upgrading x servers. We have x * upgrade <= money + (count - x) * sell. # The...
Solution
python
kamyu104__LeetCode-Solutions
Python/minimum-number-of-visited-cells-in-a-grid.py
{ "start": 2163, "end": 3089 }
class ____(object): def minimumVisitedCells(self, grid): """ :type grid: List[List[int]] :rtype: int """ m, n = len(grid), len(grid[0]) sl1 = [SortedList(xrange(n)) for _ in xrange(m)] sl2 = [SortedList(xrange(m)) for _ in xrange(n)] d, i, j = 1, 0, 0 ...
Solution2_TLE
python
apache__airflow
airflow-core/tests/unit/api_fastapi/core_api/routes/ui/test_backfills.py
{ "start": 1691, "end": 2291 }
class ____: @provide_session def _create_dag_models(self, *, count=3, dag_id_prefix="TEST_DAG", is_paused=False, session=None): dags = [] for num in range(1, count + 1): dag_model = DagModel( dag_id=f"{dag_id_prefix}_{num}", bundle_name="testing", ...
TestBackfillEndpoint
python
explosion__spaCy
spacy/training/corpus.py
{ "start": 3370, "end": 8161 }
class ____: """Iterate Example objects from a file or directory of DocBin (.spacy) formatted data files. path (Path): The directory or filename to read from. gold_preproc (bool): Whether to set up the Example object with gold-standard sentences and tokens for the predictions. Gold preprocessing...
Corpus
python
psf__black
tests/data/cases/nested_stub.py
{ "start": 27, "end": 450 }
class ____: class InnerStub: ... outer_attr_after_inner_stub: int class Inner: inner_attr: int outer_attr: int if sys.version_info > (3, 7): if sys.platform == "win32": assignment = 1 def function_definition(self): ... def f1(self) -> str: ... if sys.platform != "win...
Outer
python
pytorch__pytorch
torch/nn/modules/conv.py
{ "start": 69489, "end": 72514 }
class ____(_LazyConvXdMixin, ConvTranspose1d): # type: ignore[misc] r"""A :class:`torch.nn.ConvTranspose1d` module with lazy initialization of the ``in_channels`` argument. The ``in_channels`` argument of the :class:`ConvTranspose1d` that is inferred from the ``input.size(1)``. The attributes that wil...
LazyConvTranspose1d
python
walkccc__LeetCode
solutions/311. Sparse Matrix Multiplication/311-2.py
{ "start": 0, "end": 591 }
class ____: def multiply(self, mat1: list[list[int]], mat2: list[list[int]]) -> list[list[int]]: m = len(mat1) n = len(mat2) l = len(mat2[0]) ans = [[0] * l for _ in range(m)] nonZeroColIndicesInMat2 = [ [j for j, a in enumerate(row) if a] for row in mat2 ] ...
Solution
python
sqlalchemy__sqlalchemy
lib/sqlalchemy/dialects/postgresql/base.py
{ "start": 107950, "end": 108158 }
class ____(TypedDict): """Represents a reflect check constraint of a domain.""" name: str """Name of the constraint.""" check: str """The check constraint text."""
ReflectedDomainConstraint
python
getsentry__sentry
tests/snuba/api/endpoints/test_organization_tagkey_values.py
{ "start": 19441, "end": 23908 }
class ____(OrganizationTagKeyTestCase): def setUp(self) -> None: super().setUp() data = load_data("transaction", timestamp=before_now(minutes=1)) data.update( { "measurements": {"lcp": {"value": 2500}}, "breakdowns": {"span_ops": {"ops.http": {"val...
TransactionTagKeyValues
python
django__django
tests/contenttypes_tests/test_fields.py
{ "start": 2776, "end": 3171 }
class ____(TestCase): def test_value_to_string(self): question = Question.objects.create(text="test") answer1 = Answer.objects.create(question=question) answer2 = Answer.objects.create(question=question) result = json.loads(Question.answer_set.field.value_to_string(question)) ...
GenericRelationTests
python
ray-project__ray
python/ray/autoscaler/v2/tests/test_subscribers.py
{ "start": 5074, "end": 9687 }
class ____: def test_launch_no_op(self): mock_provider = mock.MagicMock() launcher = CloudInstanceUpdater(mock_provider) launcher.notify( [ InstanceUpdateEvent( new_instance_status=Instance.RAY_RUNNING, launch_request_id="1"...
TestCloudInstanceUpdater
python
HypothesisWorks__hypothesis
hypothesis-python/tests/ghostwriter/test_expected_output.py
{ "start": 1928, "end": 11349 }
class ____: @classmethod def a_classmethod(cls, arg: int): pass @staticmethod def a_staticmethod(arg: int): pass def add(a: float, b: float) -> float: return a + b def divide(a: int, b: int) -> float: """This is a RST-style docstring for `divide`. :raises ZeroDivisionEr...
A_Class
python
numpy__numpy
numpy/distutils/command/build_scripts.py
{ "start": 249, "end": 1665 }
class ____(old_build_scripts): def generate_scripts(self, scripts): new_scripts = [] func_scripts = [] for script in scripts: if is_string(script): new_scripts.append(script) else: func_scripts.append(script) if not func_script...
build_scripts
python
huggingface__transformers
src/transformers/models/markuplm/modeling_markuplm.py
{ "start": 16178, "end": 17069 }
class ____(nn.Module): def __init__(self, config): super().__init__() self.self = MarkupLMSelfAttention(config) self.output = MarkupLMSelfOutput(config) def forward( self, hidden_states: torch.Tensor, attention_mask: Optional[torch.FloatTensor] = None, ou...
MarkupLMAttention
python
coleifer__peewee
peewee.py
{ "start": 37943, "end": 38560 }
class ____(ColumnBase): def __init__(self, source, name): self.source = source self.name = name def get_sort_key(self, ctx): if ctx.scope == SCOPE_VALUES: return (self.name,) else: return self.source.get_sort_key(ctx) + (self.name,) def __hash__(self...
Column
python
mlflow__mlflow
mlflow/models/auth_policy.py
{ "start": 784, "end": 1351 }
class ____: """ System Auth Policy, which defines a list of resources required to serve this model """ def __init__(self, resources: list[Resource]): self._resources = resources @property def resources(self) -> list[Resource]: return self._resources @resources.setter ...
SystemAuthPolicy
python
google__pytype
pytype/tests/test_complex_function.py
{ "start": 458, "end": 1104 }
class ____(test_base.BaseTest): """Test function with complex cfg.""" def test_function_not_optimized(self): # If we do not analyse generate_tokens with full filtering, some of the # return branches will be None and the iterator will raise a type error. code = test_utils.test_data_file("tokenize.py") ...
TestComplexFunction
python
kubernetes-client__python
kubernetes/client/models/v1_portworx_volume_source.py
{ "start": 383, "end": 5809 }
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...
V1PortworxVolumeSource
python
plotly__plotly.py
_plotly_utils/basevalidators.py
{ "start": 77446, "end": 79793 }
class ____(BaseValidator): def __init__(self, plotly_name, parent_name, data_class_str, data_docs, **kwargs): super(CompoundArrayValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, **kwargs ) # Save element class string self.data_class_str = data...
CompoundArrayValidator
python
ray-project__ray
doc/source/ray-more-libs/doc_code/dask_on_ray_callbacks.py
{ "start": 207, "end": 1130 }
class ____(RayDaskCallback): def _ray_pretask(self, key, object_refs): # Executed at the start of the Ray task. start_time = timer() return start_time def _ray_posttask(self, key, result, pre_state): # Executed at the end of the Ray task. execution_time = timer() - pre_s...
MyTimerCallback
python
huggingface__transformers
src/transformers/models/blip/modeling_blip.py
{ "start": 12358, "end": 13939 }
class ____(nn.Module): def __init__(self, config: BlipTextConfig): super().__init__() embed_dim = config.hidden_size self.token_embedding = nn.Embedding(config.vocab_size, embed_dim) self.position_embedding = nn.Embedding(config.max_position_embeddings, embed_dim) # positio...
BlipTextEmbeddings
python
ray-project__ray
python/ray/data/datasource/datasource.py
{ "start": 7868, "end": 10760 }
class ____(_DatasourceProjectionPushdownMixin, _DatasourcePredicatePushdownMixin): """Interface for defining a custom :class:`~ray.data.Dataset` datasource. To read a datasource into a dataset, use :meth:`~ray.data.read_datasource`. """ # noqa: E501 def __init__(self): """Initialize the datas...
Datasource
python
allegroai__clearml
clearml/router/proxy.py
{ "start": 155, "end": 1924 }
class ____: DEFAULT_PORT = 9000 def __init__( self, port: Optional[int] = None, workers: Optional[int] = None, default_target: Optional[str] = None, log_level: Optional[str] = None, access_log: bool = True, enable_streaming: bool = True, ) -> None: ...
HttpProxy
python
dateutil__dateutil
src/dateutil/parser/_parser.py
{ "start": 13451, "end": 19356 }
class ____(list): def __init__(self, *args, **kwargs): super(self.__class__, self).__init__(*args, **kwargs) self.century_specified = False self.dstridx = None self.mstridx = None self.ystridx = None @property def has_year(self): return self.ystridx is not No...
_ymd
python
django__django
tests/aggregation/models.py
{ "start": 31, "end": 285 }
class ____(models.Model): name = models.CharField(max_length=100) age = models.IntegerField() friends = models.ManyToManyField("self", blank=True) rating = models.FloatField(null=True) def __str__(self): return self.name
Author
python
kamyu104__LeetCode-Solutions
Python/binary-tree-preorder-traversal.py
{ "start": 957, "end": 1512 }
class ____(object): def preorderTraversal(self, root): """ :type root: TreeNode :rtype: List[int] """ result, stack = [], [(root, False)] while stack: root, is_visited = stack.pop() if root is None: continue if is_vi...
Solution2
python
python__mypy
mypyc/irbuild/prebuildvisitor.py
{ "start": 438, "end": 8636 }
class ____(ExtendedTraverserVisitor): """Mypy file AST visitor run before building the IR. This collects various things, including: * Determine relationships between nested functions and functions that contain nested functions * Find non-local variables (free variables) * Find property sette...
PreBuildVisitor
python
kubernetes-client__python
kubernetes/client/models/v1_api_service.py
{ "start": 383, "end": 7196 }
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...
V1APIService
python
run-llama__llama_index
llama-index-core/llama_index/core/ingestion/data_sources.py
{ "start": 726, "end": 1421 }
class ____(BasePydanticReader): """ A group of documents, usually separate pages from a single file. """ file_path: str = Field(description="Path to the file containing the documents") documents: List[Document] = Field( description="Sequential group of documents, usually separate pages from...
DocumentGroup
python
openai__openai-python
src/openai/types/chat/parsed_chat_completion.py
{ "start": 1002, "end": 1182 }
class ____(Choice, GenericModel, Generic[ContentType]): message: ParsedChatCompletionMessage[ContentType] """A chat completion message generated by the model."""
ParsedChoice
python
allegroai__clearml
clearml/storage/helper.py
{ "start": 169054, "end": 169225 }
class ____(_FileStorageDriver): def get_direct_access(self, remote_path: str, **_: Any) -> Optional[str]: return None
_FileStorageDriverDiskSpaceFileSizeStrategy
python
vyperlang__vyper
vyper/exceptions.py
{ "start": 9845, "end": 9936 }
class ____(VyperException): """msg.value in a nonpayable function."""
NonPayableViolation
python
huggingface__transformers
src/transformers/models/sew_d/modeling_sew_d.py
{ "start": 12876, "end": 14698 }
class ____(nn.Module): def __init__(self, config): super().__init__() self.conv = nn.Conv1d( config.hidden_size, config.hidden_size, kernel_size=config.num_conv_pos_embeddings, padding=config.num_conv_pos_embeddings // 2, groups=config.num_...
SEWDPositionalConvEmbedding
python
davidhalter__parso
parso/grammar.py
{ "start": 891, "end": 8809 }
class ____(Generic[_NodeT]): """ :py:func:`parso.load_grammar` returns instances of this class. Creating custom none-python grammars by calling this is not supported, yet. :param text: A BNF representation of your grammar. """ _start_nonterminal: str _error_normalizer_config: Optional[Erro...
Grammar
python
airbytehq__airbyte
airbyte-integrations/connectors/source-github/source_github/github_schema.py
{ "start": 1486458, "end": 1493746 }
class ____(sgqlc.types.Type, Node): """A GitHub Sponsors listing.""" __schema__ = github_schema __field_names__ = ( "active_goal", "active_stripe_connect_account", "billing_country_or_region", "contact_email_address", "created_at", "dashboard_resource_path", ...
SponsorsListing
python
python__mypy
mypy/nodes.py
{ "start": 59025, "end": 59184 }
class ____(Statement): __slots__ = () def accept(self, visitor: StatementVisitor[T]) -> T: return visitor.visit_continue_stmt(self)
ContinueStmt
python
getsentry__sentry
src/sentry/api/endpoints/event_file_committers.py
{ "start": 476, "end": 1685 }
class ____(ProjectEndpoint): owner = ApiOwner.ISSUES publish_status = { "GET": ApiPublishStatus.PRIVATE, } def get(self, request: Request, project, event_id) -> Response: """ Retrieve Suspect Commit information for an event ``````````````````````````````````````````` ...
EventFileCommittersEndpoint
python
django__django
django/db/backends/postgresql/creation.py
{ "start": 247, "end": 3886 }
class ____(BaseDatabaseCreation): def _quote_name(self, name): return self.connection.ops.quote_name(name) def _get_database_create_suffix(self, encoding=None, template=None): suffix = "" if encoding: suffix += " ENCODING '{}'".format(encoding) if template: ...
DatabaseCreation
python
ansible__ansible
lib/ansible/cli/arguments/option_helpers.py
{ "start": 5870, "end": 6395 }
class ____(argparse.Action): def __init__(self, option_strings, dest, const=True, default=None, required=False, help=None, metavar=None, nargs=0): super(UnrecognizedArgument, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, ...
UnrecognizedArgument
python
ray-project__ray
rllib/core/models/configs.py
{ "start": 27462, "end": 35383 }
class ____(ModelConfig): """Configuration for a convolutional (encoder) network. The configured CNN encodes 3D-observations into a latent space. The stack of layers is composed of a sequence of convolutional layers. `input_dims` describes the shape of the input tensor. Beyond that, each layer speci...
CNNEncoderConfig
python
django__django
django/test/selenium.py
{ "start": 4535, "end": 5000 }
class ____: def __init__(self, width, height, selenium): self.selenium = selenium self.new_size = (width, height) def __enter__(self): self.old_size = self.selenium.get_window_size() self.selenium.set_window_size(*self.new_size) return self def __exit__(self, exc_ty...
ChangeWindowSize
python
huggingface__transformers
src/transformers/models/decision_transformer/configuration_decision_transformer.py
{ "start": 822, "end": 7029 }
class ____(PreTrainedConfig): """ This is the configuration class to store the configuration of a [`DecisionTransformerModel`]. It is used to instantiate a Decision Transformer model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults wi...
DecisionTransformerConfig
python
doocs__leetcode
lcci/16.19.Pond Sizes/Solution.py
{ "start": 0, "end": 514 }
class ____: def pondSizes(self, land: List[List[int]]) -> List[int]: def dfs(i: int, j: int) -> int: res = 1 land[i][j] = 1 for x in range(i - 1, i + 2): for y in range(j - 1, j + 2): if 0 <= x < m and 0 <= y < n and land[x][y] == 0: ...
Solution
python
conda__conda
conda/core/link.py
{ "start": 5405, "end": 5669 }
class ____(NamedTuple): target_prefix: str unlink_precs: tuple[PackageRecord, ...] link_precs: tuple[PackageRecord, ...] remove_specs: tuple[MatchSpec, ...] update_specs: tuple[MatchSpec, ...] neutered_specs: tuple[MatchSpec, ...]
PrefixSetup
python
graphql-python__graphene
graphene/types/scalars.py
{ "start": 301, "end": 1401 }
class ____(UnmountedType, BaseType): """ Scalar Type Definition The leaf values of any request and input values to arguments are Scalars (or Enums) and are defined with a name and a series of functions used to parse input from ast or variables and to ensure validity. """ @classmethod d...
Scalar
python
huggingface__transformers
tests/models/pixtral/test_image_processing_pixtral.py
{ "start": 4631, "end": 13245 }
class ____(ImageProcessingTestMixin, unittest.TestCase): image_processing_class = PixtralImageProcessor if is_vision_available() else None fast_image_processing_class = PixtralImageProcessorFast if is_torchvision_available() else None def setUp(self): super().setUp() self.image_processor_te...
PixtralImageProcessingTest
python
wandb__wandb
wandb/vendor/pygments/styles/rrt.py
{ "start": 350, "end": 852 }
class ____(Style): """ Minimalistic "rrt" theme, based on Zap and Emacs defaults. """ background_color = '#000000' highlight_color = '#0000ff' styles = { Comment: '#00ff00', Name.Function: '#ffff00', Name.Variable: '#eedd82', Name.Constant: ...
RrtStyle
python
astropy__astropy
astropy/coordinates/angles/formats.py
{ "start": 918, "end": 13777 }
class ____: """ Parses the various angle formats including: * 01:02:30.43 degrees * 1 2 0 hours * 1°2′3″ * 1d2m3s * -1h2m3s * 1°2′3″N This class should not be used directly. Use `parse_angle` instead. """ # For safe multi-threaded operation all class...
_AngleParser
python
etianen__django-reversion
tests/test_app/tests/test_admin.py
{ "start": 10636, "end": 10747 }
class ____(VersionAdmin): inlines = (TestModelInlineAdmin, TestModelGenericInlineAdmin)
TestModelParentAdmin
python
tensorflow__tensorflow
tensorflow/python/debug/lib/debug_graph_reconstruction_test.py
{ "start": 1607, "end": 7552 }
class ____(test_util.TensorFlowTestCase): _OP_TYPE_DENYLIST = ("_Send", "_Recv", "_HostSend", "_HostRecv", "_Retval") def _no_rewrite_session_config(self): rewriter_config = rewriter_config_pb2.RewriterConfig( dependency_optimization=rewriter_config_pb2.RewriterConfig.OFF, pin_to_host_optimiza...
ReconstructNonDebugGraphTest
python
dask__dask
dask/dataframe/dask_expr/_expr.py
{ "start": 59973, "end": 60224 }
class ____(ExplodeSeries): _parameters = ["frame", "column"] def _simplify_up(self, parent, dependents): if isinstance(parent, Projection): return plain_column_projection(self, parent, dependents, [self.column])
ExplodeFrame
python
kamyu104__LeetCode-Solutions
Python/subsets.py
{ "start": 950, "end": 1321 }
class ____(object): def subsets(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ return self.subsetsRecu([], sorted(nums)) def subsetsRecu(self, cur, nums): if not nums: return [cur] return self.subsetsRecu(cur, nums[1:]) + ...
Solution3
python
django-mptt__django-mptt
tests/myapp/tests.py
{ "start": 58593, "end": 58748 }
class ____(TreeTestCase): def test_save_registered_model(self): g1 = Group.objects.create(name="group 1") g1.save()
RegisteredRemoteModel
python
django__django
django/contrib/gis/geos/collections.py
{ "start": 486, "end": 3472 }
class ____(GEOSGeometry): _typeid = 7 def __init__(self, *args, **kwargs): "Initialize a Geometry Collection from a sequence of Geometry objects." # Checking the arguments if len(args) == 1: # If only one geometry provided or a list of geometries is provided # i...
GeometryCollection
python
django__django
django/db/models/functions/text.py
{ "start": 6122, "end": 6197 }
class ____(Transform): function = "LOWER" lookup_name = "lower"
Lower
python
numba__numba
numba/core/rewrites/static_getitem.py
{ "start": 139, "end": 1788 }
class ____(Rewrite): """ Rewrite IR expressions of the kind `getitem(value=arr, index=$constXX)` where `$constXX` is a known constant as `static_getitem(value=arr, index=<constant value>)`. """ def match(self, func_ir, block, typemap, calltypes): self.getitems = getitems = {} se...
RewriteConstGetitems
python
pennersr__django-allauth
allauth/headless/account/inputs.py
{ "start": 4624, "end": 4701 }
class ____(ResetPasswordForm, inputs.Input): pass
RequestPasswordResetInput
python
matplotlib__matplotlib
lib/matplotlib/backends/backend_tkcairo.py
{ "start": 771, "end": 845 }
class ____(_BackendTk): FigureCanvas = FigureCanvasTkCairo
_BackendTkCairo
python
pytorch__pytorch
torch/fx/_symbolic_trace.py
{ "start": 41822, "end": 42037 }
class ____(NamedTuple): frame_dict: Any fn_name: str orig_fn: Any new_fn: Any def revert(self): raise NotImplementedError def patch(self): raise NotImplementedError
_PatchedFn
python
doocs__leetcode
solution/1100-1199/1176.Diet Plan Performance/Solution2.py
{ "start": 0, "end": 467 }
class ____: def dietPlanPerformance( self, calories: List[int], k: int, lower: int, upper: int ) -> int: def check(s): if s < lower: return -1 if s > upper: return 1 return 0 s, n = sum(calories[:k]), len(calories) ...
Solution