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
pytorch__pytorch
torch/utils/cpp_extension.py
{ "start": 23945, "end": 134172 }
class ____(build_ext): """ A custom :mod:`setuptools` build extension . This :class:`setuptools.build_ext` subclass takes care of passing the minimum required compiler flags (e.g. ``-std=c++17``) as well as mixed C++/CUDA/SYCL compilation (and support for CUDA/SYCL files in general). When usin...
BuildExtension
python
sympy__sympy
sympy/stats/crv_types.py
{ "start": 108540, "end": 111426 }
class ____(SingleContinuousDistribution): _argnames = ('a', 'b', 'c') @property def set(self): return Interval(self.a, self.b) @staticmethod def check(a, b, c): _value_check(b > a, "Parameter b > %s. b = %s"%(a, b)) _value_check((a <= c, c <= b), "Parameter c must b...
TriangularDistribution
python
sqlalchemy__sqlalchemy
test/dialect/postgresql/test_types.py
{ "start": 187650, "end": 187737 }
class ____(_DateTimeRangeTests, _RangeTypeRoundTrip): pass
DateTimeRangeRoundTripTest
python
tensorflow__tensorflow
tensorflow/python/kernel_tests/strings_ops/string_upper_op_test.py
{ "start": 838, "end": 1908 }
class ____(test.TestCase): """Test cases for tf.strings.upper.""" def test_string_upper(self): strings = ["Pigs on The Wing", "aNimals"] with self.cached_session(): output = string_ops.string_upper(strings) output = self.evaluate(output) self.assertAllEqual(output, [b"PIGS ON THE WING", ...
StringUpperOpTest
python
skorch-dev__skorch
skorch/callbacks/training.py
{ "start": 30625, "end": 33212 }
class ____(Callback): """Sets the input dimension of the PyTorch module to the input dimension of the training data. By default the last dimension of X (``X.shape[-1]``) will be used. This can be of use when the shape of X is not known beforehand, e.g. when using a skorch model within an sklearn pi...
InputShapeSetter
python
huggingface__transformers
src/transformers/models/flava/configuration_flava.py
{ "start": 839, "end": 5594 }
class ____(PreTrainedConfig): r""" This is the configuration class to store the configuration of a [`FlavaImageModel`]. It is used to instantiate an FLAVA model according to the specified arguments, defining the model architecture. Instantiating a configuration with the defaults will yield a similar co...
FlavaImageConfig
python
tensorflow__tensorflow
tensorflow/python/kernel_tests/metrics_test.py
{ "start": 173596, "end": 175587 }
class ____(test.TestCase): def setUp(self): np.random.seed(1) ops.reset_default_graph() @test_util.run_deprecated_v1 def testVars(self): metrics.true_negatives( labels=(0, 1, 0, 1), predictions=(0, 0, 1, 1)) _assert_metric_variables(self, ('true_negatives/count:0',)) @test_uti...
TrueNegativesTest
python
ray-project__ray
python/ray/data/_internal/datasource/hudi_datasource.py
{ "start": 300, "end": 486 }
class ____(Enum): SNAPSHOT = "snapshot" INCREMENTAL = "incremental" @classmethod def supported_types(cls) -> List[str]: return [e.value for e in cls]
HudiQueryType
python
jazzband__django-model-utils
tests/models.py
{ "start": 9219, "end": 9370 }
class ____(TrackedFK): custom_tracker = FieldTracker(fields=['fk_id']) custom_tracker_without_id = FieldTracker(fields=['fk'])
InheritedTrackedFK
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/memberAccess9.py
{ "start": 108, "end": 229 }
class ____: def __getattr__(self, name: str) -> int: ... def test_get_attr() -> None: a = GetAttrTest()
GetAttrTest
python
ray-project__ray
python/ray/train/tensorflow/keras.py
{ "start": 5495, "end": 7342 }
class ____(RayReportCallback): """Keras callback for Ray Train reporting and checkpointing. .. note:: Metrics are always reported with checkpoints, even if the event isn't specified in ``report_metrics_on``. Example: .. testcode:: python ############# Using it in Train...
ReportCheckpointCallback
python
PrefectHQ__prefect
src/prefect/server/api/ui/flow_runs.py
{ "start": 753, "end": 4172 }
class ____(PrefectBaseModel): id: UUID = Field(default=..., description="The flow run id.") state_type: schemas.states.StateType = Field( default=..., description="The state type." ) timestamp: DateTime = Field( default=..., description=( "The start time of the run, o...
SimpleFlowRun
python
huggingface__transformers
src/transformers/models/dac/modeling_dac.py
{ "start": 23368, "end": 28867 }
class ____(DacPreTrainedModel): input_modalities = "audio" def __init__(self, config: DacConfig): super().__init__(config) self.config = config self.encoder = DacEncoder(config) self.decoder = DacDecoder(config) self.quantizer = DacResidualVectorQuantize(config) ...
DacModel
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/protocol6.py
{ "start": 602, "end": 634 }
class ____: species: str
Tapir
python
encode__django-rest-framework
tests/test_permissions.py
{ "start": 688, "end": 941 }
class ____(generics.ListCreateAPIView): queryset = BasicModel.objects.all() serializer_class = BasicSerializer authentication_classes = [authentication.BasicAuthentication] permission_classes = [permissions.DjangoModelPermissions]
RootView
python
scipy__scipy
scipy/fftpack/tests/test_basic.py
{ "start": 11507, "end": 12099 }
class ____: def setup_method(self): np.random.seed(1234) def test_regression_244(self): """FFT returns wrong result with axes parameter.""" # fftn (and hence fft2) used to break when both axes and shape were # used x = numpy.ones((4, 4, 2)) y = fft2(x, shape=(8, ...
Testfft2
python
pydata__xarray
xarray/tests/test_backends_datatree.py
{ "start": 917, "end": 6409 }
class ____(_TestNetCDF4Data): @contextlib.contextmanager def open(self, path, **kwargs): with open_datatree(path, engine=self.engine, **kwargs) as ds: yield ds.to_dataset() def test_child_group_with_inconsistent_dimensions(self) -> None: with pytest.raises( ValueErro...
TestNetCDF4DataTree
python
huggingface__transformers
src/transformers/trainer_utils.py
{ "start": 7386, "end": 7494 }
class ____(ExplicitEnum): NO = "no" STEPS = "steps" EPOCH = "epoch" BEST = "best"
SaveStrategy
python
numba__numba
numba/tests/test_init_utils.py
{ "start": 131, "end": 1557 }
class ____(TestCase): def test_major_minor_patch(self): expected = version_info(0, 1, 0, (0, 1), (0, 1, 0), "0.1.0", ('0', '1', '0'), None) received = generate_version_info("0.1.0") self.assertEqual(received, expected) def...
TestGenerateVersionInfo
python
py-pdf__pypdf
pypdf/_text_extraction/_layout_mode/_text_state_params.py
{ "start": 224, "end": 5306 }
class ____: """ Text state parameters and operator values for a single text value in a TJ or Tj PDF operation. Attributes: txt (str): the text to be rendered. font (Font): font object font_size (int | float): font size Tc (float): character spacing. Defaults to 0.0. ...
TextStateParams
python
pytorch__pytorch
torch/_dynamo/variables/dicts.py
{ "start": 58192, "end": 60086 }
class ____(VariableTracker): """ Models _PyDictViewObject This is an "abstract" class. Subclasses will override kv and the items method """ kv: Optional[str] = None def __init__(self, dv_dict: ConstDictVariable, **kwargs: Any) -> None: super().__init__(**kwargs) assert self.kv...
DictViewVariable
python
google__jax
jax/experimental/jax2tf/tests/flax_models/gnn.py
{ "start": 1208, "end": 1678 }
class ____(nn.Module): """A multi-layer perceptron.""" feature_sizes: Sequence[int] dropout_rate: float = 0 deterministic: bool = True activation: Callable[[jax.Array], jax.Array] = nn.relu @nn.compact def __call__(self, inputs): x = inputs for size in self.feature_sizes: x = nn.Dense(feat...
MLP
python
streamlit__streamlit
lib/tests/streamlit/data_mocks/dask_mocks.py
{ "start": 1449, "end": 2143 }
class ____: """This is dummy Series class, which imitates dask.dataframe.core.Series class for testing purposes. We use this to make sure that our code does a special handling if it detects a Dask Series. This allows testing of the functionality without having the library installed, but it won't ca...
Series
python
tensorflow__tensorflow
tensorflow/python/autograph/operators/variables_test.py
{ "start": 838, "end": 1864 }
class ____(test.TestCase): def test_undefined(self): undefined_symbol = variables.Undefined('name') undefined_symbol2 = variables.Undefined('name') self.assertEqual(undefined_symbol.symbol_name, 'name') self.assertEqual(undefined_symbol2.symbol_name, 'name') self.assertNotEqual(undefined_symbol,...
SpecialValuesTest
python
numpy__numpy
numpy/_core/code_generators/generate_umath.py
{ "start": 1120, "end": 6279 }
class ____: """Type signature for a ufunc. Attributes ---------- type : str Character representing the nominal type. func_data : str or None or FullTypeDescr or FuncNameSuffix, optional The string representing the expression to insert into the data array, if any. in_ : s...
TypeDescription
python
pytorch__pytorch
torch/autograd/function.py
{ "start": 30564, "end": 33536 }
class ____(Function): r""" This class is here only for backward compatibility reasons. Use :class:`Function` instead of this for any new use case. """ # The 'type: ignore' statements are needed here because these functions are declared as '@staticmethod' in the # superclass (Function) but are i...
NestedIOFunction
python
great-expectations__great_expectations
great_expectations/data_context/types/base.py
{ "start": 40627, "end": 40744 }
class ____(Schema): globally = fields.Boolean() metric_calculations = fields.Boolean()
ProgressBarsConfigSchema
python
fluentpython__example-code-2e
19-concurrency/primes/py36/procs.py
{ "start": 396, "end": 1798 }
class ____(NamedTuple): # <3> n: int prime: bool elapsed: float JobQueue = queues.SimpleQueue # <4> ResultQueue = queues.SimpleQueue # <5> def check(n: int) -> PrimeResult: # <6> t0 = perf_counter() res = is_prime(n) return PrimeResult(n, res, perf_counter() - t0) def worker(jobs: JobQueu...
PrimeResult
python
django__django
tests/staticfiles_tests/test_management.py
{ "start": 8568, "end": 8703 }
class ____(TestCollection): def mkdtemp(self): tmp_dir = super().mkdtemp() return Path(tmp_dir)
TestCollectionPathLib
python
tiangolo__fastapi
docs_src/response_model/tutorial005_py310.py
{ "start": 78, "end": 816 }
class ____(BaseModel): name: str description: str | None = None price: float tax: float = 10.5 items = { "foo": {"name": "Foo", "price": 50.2}, "bar": {"name": "Bar", "description": "The Bar fighters", "price": 62, "tax": 20.2}, "baz": { "name": "Baz", "description": "There...
Item
python
run-llama__llama_index
llama-index-core/tests/evaluation/test_batch_runner.py
{ "start": 349, "end": 3942 }
class ____(BaseEvaluator): def __init__( self, mock_score: float = 1.0, mock_passing: bool = True, mock_feedback: str = "test feedback", ) -> None: self._mock_score = mock_score self._mock_passing = mock_passing self._mock_feedback = mock_feedback def...
MockEvaluator
python
etianen__django-reversion
reversion/management/commands/deleterevisions.py
{ "start": 226, "end": 4112 }
class ____(BaseRevisionCommand): help = "Deletes revisions for a given app [and model]." def add_arguments(self, parser): super().add_arguments(parser) parser.add_argument( "--days", default=0, type=int, help="Delete only revisions older than the...
Command
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/genericType47.py
{ "start": 188, "end": 513 }
class ____(Collection[T]): def __init__(self, value: Iterable[T]) -> None: self.values = tuple(value) def __contains__(self, item: object) -> bool: return True def __iter__(self) -> Iterator[T]: return iter(self.values) def __len__(self) -> int: return len(self.values)...
ClassA
python
pandas-dev__pandas
asv_bench/benchmarks/strings.py
{ "start": 7049, "end": 7260 }
class ____: def setup(self): self.ser = Series(Index([f"i-{i}" for i in range(10_000)], dtype=object)) def time_encode_decode(self): self.ser.str.encode("utf-8").str.decode("utf-8")
Encode
python
scipy__scipy
scipy/interpolate/tests/test_bsplines.py
{ "start": 151428, "end": 152868 }
class ____: @pytest.mark.parametrize('make_spline, kwargs', [(make_interp_spline, {}), (make_smoothing_spline, {}), (make_smoothing_spline, {'lam': 1.0}), (make_lsq_spline, {'method': "norm-eq"}), (make_lsq_spline, {'method': "qr"}), ]) @pytest.mark.parametri...
TestBatch
python
airbytehq__airbyte
airbyte-ci/connectors/connectors_qa/src/connectors_qa/checks/packaging.py
{ "start": 7462, "end": 9585 }
class ____(PackagingCheck): name = f"Connector version in {consts.METADATA_FILE_NAME} and {consts.PYPROJECT_FILE_NAME} file must match" description = f"Connector version in {consts.METADATA_FILE_NAME} and {consts.PYPROJECT_FILE_NAME} file must match. This is to ensure that connector release is consistent." ...
CheckConnectorVersionMatchInPyproject
python
django__django
tests/gis_tests/geoapp/models.py
{ "start": 1777, "end": 1998 }
class ____(models.IntegerField): def db_type(self, connection): return None def get_attname_column(self): attname, column = super().get_attname_column() return attname, None
NonConcreteField
python
fastapi__sqlmodel
docs_src/tutorial/connect/select/tutorial005_py310.py
{ "start": 222, "end": 2176 }
class ____(SQLModel, table=True): id: int | None = Field(default=None, primary_key=True) name: str = Field(index=True) secret_name: str age: int | None = Field(default=None, index=True) team_id: int | None = Field(default=None, foreign_key="team.id") sqlite_file_name = "database.db" sqlite_url = ...
Hero
python
django__django
tests/admin_views/models.py
{ "start": 23845, "end": 24152 }
class ____(models.Model): """ Issue #20522 Model that depends on validation of the parent class for one of its fields to validate during clean """ parent = models.ForeignKey(ParentWithDependentChildren, models.CASCADE) family_name = models.CharField(max_length=255)
DependentChild
python
streamlit__streamlit
lib/streamlit/user_info.py
{ "start": 14554, "end": 20344 }
class ____(Mapping[str, str | bool | None]): """ A read-only, dict-like object for accessing information about the current\ user. ``st.user`` is dependent on the host platform running your Streamlit app. If your host platform has not configured the object, ``st.user`` will behave as it does in ...
UserInfoProxy
python
microsoft__pyright
packages/pyright-internal/src/tests/samples/classes1.py
{ "start": 973, "end": 996 }
class ____(T): pass
K
python
jazzband__django-pipeline
pipeline/compilers/less.py
{ "start": 116, "end": 650 }
class ____(SubProcessCompiler): output_extension = "css" def match_file(self, filename): return filename.endswith(".less") def compile_file(self, infile, outfile, outdated=False, force=False): # Pipe to file rather than provide outfile arg due to a bug in lessc command = ( ...
LessCompiler
python
PrefectHQ__prefect
src/integrations/prefect-github/prefect_github/schemas/graphql_schema.py
{ "start": 225229, "end": 225554 }
class ____(sgqlc.types.Interface): """ See source code for more info. """ __schema__ = graphql_schema __field_names__ = ("closed", "closed_at") closed = sgqlc.types.Field(sgqlc.types.non_null(Boolean), graphql_name="closed") closed_at = sgqlc.types.Field(DateTime, graphql_name="closedAt") ...
Closable
python
dagster-io__dagster
python_modules/libraries/dagster-deltalake/dagster_deltalake/io_manager.py
{ "start": 1180, "end": 1302 }
class ____(str, Enum): error = "error" append = "append" overwrite = "overwrite" ignore = "ignore"
WriteMode
python
mwaskom__seaborn
tests/test_rcmod.py
{ "start": 5374, "end": 7345 }
class ____(RCParamFixtures): contexts = ["paper", "notebook", "talk", "poster"] def test_default_return(self): current = rcmod.plotting_context() self.assert_rc_params(current) def test_key_usage(self): _context_keys = set(rcmod._context_keys) for context in self.context...
TestPlottingContext
python
realpython__materials
python-bitwise-operators/src/stegano/bitmap.py
{ "start": 227, "end": 2282 }
class ____: """High-level interface to a bitmap file.""" def __init__(self, path: pathlib.Path) -> None: self._file = path.open(mode="r+b") self._file_bytes = mmap(self._file.fileno(), 0, access=ACCESS_WRITE) self._header = Header.from_bytes(self._file_bytes[:50]) def __enter__(sel...
Bitmap
python
pytorch__pytorch
test/dynamo/cpython/3_13/test_list.py
{ "start": 667, "end": 1640 }
class ____(importlib.abc.MetaPathFinder): def find_spec(self, fullname, path, target=None): # Check if the import is the problematic one if fullname in redirect_imports: try: # Attempt to import the standalone module name = fullname.removeprefix("test.") ...
RedirectImportFinder
python
pennersr__django-allauth
allauth/socialaccount/providers/drip/views.py
{ "start": 208, "end": 1113 }
class ____(OAuth2Adapter): """OAuth2Adapter for Drip API v3.""" provider_id = "drip" authorize_url = "https://www.getdrip.com/oauth/authorize" access_token_url = "https://www.getdrip.com/oauth/token" # nosec profile_url = "https://api.getdrip.com/v2/user" def complete_login(self, request, ap...
DripOAuth2Adapter
python
encode__django-rest-framework
tests/test_validators.py
{ "start": 1430, "end": 1520 }
class ____(models.Model): code = models.IntegerField(unique=True)
AnotherUniquenessModel
python
celery__celery
celery/backends/database/models.py
{ "start": 362, "end": 1611 }
class ____(ResultModelBase): """Task result/status.""" __tablename__ = 'celery_taskmeta' __table_args__ = {'sqlite_autoincrement': True} id = sa.Column(DialectSpecificInteger, sa.Sequence('task_id_sequence'), primary_key=True, autoincrement=True) task_id = sa.Column(sa.String(15...
Task
python
keras-team__keras
keras/src/metrics/metric_test.py
{ "start": 1391, "end": 9218 }
class ____(testing.TestCase): def setUp(self): self._global_dtype_policy = dtype_policies.dtype_policy.dtype_policy() self._floatx = backend.floatx() return super().setUp() def tearDown(self): dtype_policies.dtype_policy.set_dtype_policy(self._global_dtype_policy) backen...
MetricTest
python
coleifer__peewee
tests/libs/mock.py
{ "start": 27671, "end": 31066 }
class ____(Base): def __init__(self, spec=None, side_effect=None, return_value=DEFAULT, wraps=None, name=None, spec_set=None, parent=None, _spec_state=None, _new_name='', _new_parent=None, **kwargs): self.__dict__['_mock_return_value'] = return_value _super(Callab...
CallableMixin
python
great-expectations__great_expectations
docs/docusaurus/versioned_docs/version-0.18/oss/guides/expectations/creating_custom_expectations/multicolumn_map_expectation_template.py
{ "start": 1056, "end": 2858 }
class ____(MulticolumnMapMetricProvider): # </snippet> # This is the id string that will be used to reference your metric. # <snippet name="docs/docusaurus/docs/oss/guides/expectations/creating_custom_expectations/multicolumn_map_expectation_template.py metric_name"> condition_metric_name = "METRIC NAME...
MulticolumnValuesMatchSomeCriteria
python
ethereum__web3.py
ens/ens.py
{ "start": 1481, "end": 21641 }
class ____(BaseENS): """ Quick access to common Ethereum Name Service functions, like getting the address for a name. Unless otherwise specified, all addresses are assumed to be a `str` in `checksum format <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>`_, # blocklint: pragma # noqa...
ENS
python
numba__numba
numba/core/typed_passes.py
{ "start": 32227, "end": 38835 }
class ____(FunctionPass): """Remove phi nodes (ir.Expr.phi) introduced by SSA. This is needed before Lowering because the phi nodes in Numba IR do not match the semantics of phi nodes in LLVM IR. In Numba IR, phi nodes may expand into multiple LLVM instructions. """ _name = "strip_phis" d...
PreLowerStripPhis
python
charliermarsh__ruff
crates/ruff_linter/resources/test/fixtures/flake8_pyi/PYI036.py
{ "start": 1843, "end": 2192 }
class ____: def __exit__(self, __typ: typing.Type[BaseException] | None, exc: BaseException | None, *args: _typeshed.Unused) -> bool: ... async def __aexit__(self, typ: type[BaseException] | None, exc: BaseException | None, tb: TracebackType | None, weird_extra_arg: int = ..., *args: Unused, **kwargs: Unused) -...
GoodEight
python
getsentry__sentry
src/sentry/plugins/sentry_webhooks/apps.py
{ "start": 36, "end": 262 }
class ____(AppConfig): name = "sentry.plugins.sentry_webhooks" def ready(self) -> None: from sentry.plugins.base import register from .plugin import WebHooksPlugin register(WebHooksPlugin)
Config
python
pytorch__pytorch
torch/_dynamo/variables/base.py
{ "start": 5728, "end": 5908 }
class ____(MutationType): """ This case of VariableTracker.mutation_type marker indicates that Dynamo allows mutation on the value's attributes. """
AttributeMutation
python
getsentry__sentry
src/sentry/api/bases/organization.py
{ "start": 3714, "end": 3870 }
class ____(StaffPermissionMixin, OrganizationPermission): """Allows staff to to access organization endpoints.""" pass
OrganizationAndStaffPermission
python
google__pytype
pytype/load_pytd_test.py
{ "start": 37052, "end": 39138 }
class ____(_LoaderTest): def test_import_class(self): b_ast = self._import( a=""" class Foo: def f(self) -> int: ... """, b=""" import a f = a.Foo.f """, ) self.assertEqual( pytd_utils.Print(b_ast.Lookup("b.f")), "def b.f(self: a.Foo) -> i...
MethodAliasTest
python
dagster-io__dagster
examples/docs_snippets/docs_snippets/guides/quality-testing/unit-testing-assets-and-ops/op-combo.py
{ "start": 36, "end": 520 }
class ____(dg.Config): separator: str @dg.op def process_file( primary_file: str, secondary_file: str, config: SeparatorConfig ) -> str: return f"{primary_file}{config.separator}{secondary_file}" # end_file # start_test def test_process_file() -> None: assert ( process_file( pr...
SeparatorConfig
python
plotly__plotly.py
tests/test_optional/test_figure_factory/test_figure_factory.py
{ "start": 116321, "end": 138525 }
class ____(NumpyTestUtilsMixin, TestCaseNoTemplate): def test_df_as_list(self): df = [{"titles": "Revenue"}, "foo"] pattern = ( "Every entry of the data argument (list, tuple, etc) must be a dictionary." ) self.assertRaisesRegex(PlotlyError, pattern, ff.create_bullet, df...
TestBullet
python
streamlit__streamlit
lib/streamlit/util.py
{ "start": 2542, "end": 3625 }
class ____(dict[Any, Any]): """ A dictionary subclass that supports attribute-style access. This class extends the functionality of a standard dictionary to allow items to be accessed via attribute-style dot notation in addition to the traditional key-based access. If a dictionary item is accessed ...
AttributeDictionary
python
sympy__sympy
sympy/polys/numberfields/modules.py
{ "start": 53531, "end": 56774 }
class ____(ModuleElement): r""" Subclass for :py:class:`~.ModuleElement` instances whose module is a :py:class:`~.PowerBasis`. """ @property def T(self): """Access the defining polynomial of the :py:class:`~.PowerBasis`.""" return self.module.T def numerator(self, x=None): ...
PowerBasisElement
python
ansible__ansible
lib/ansible/galaxy/collection/gpg.py
{ "start": 6168, "end": 6391 }
class ____(GpgBaseError): """This is a generic error status message, it might be followed by error location specific data.""" location: str code: int more: str = "" @dataclass(frozen=True, slots=True)
GpgError
python
plotly__plotly.py
plotly/graph_objs/parcoords/line/colorbar/title/_font.py
{ "start": 233, "end": 9949 }
class ____(_BaseTraceHierarchyType): _parent_path_str = "parcoords.line.colorbar.title" _path_str = "parcoords.line.colorbar.title.font" _valid_props = { "color", "family", "lineposition", "shadow", "size", "style", "textcase", "variant", ...
Font
python
pypa__virtualenv
src/virtualenv/create/via_global_ref/builtin/ref.py
{ "start": 3519, "end": 4093 }
class ____(PathRef): """Link a path on the file system.""" def __init__(self, src, dest, must=RefMust.NA, when=RefWhen.ANY) -> None: super().__init__(src, must, when) self.dest = dest def run(self, creator, symlinks): dest = self.dest(creator, self.src) method = self.method...
PathRefToDest
python
getsentry__sentry
src/sentry/integrations/slack/webhooks/action.py
{ "start": 29940, "end": 35689 }
class ____(ABC): @property @abstractmethod def dialog_type(self) -> str: raise NotImplementedError def _build_format_options(self, options: dict[str, str]) -> list[dict[str, Any]]: return [ { "text": { "type": "plain_text", ...
_ModalDialog
python
langchain-ai__langchain
libs/langchain/langchain_classic/smith/evaluation/string_run_evaluator.py
{ "start": 8289, "end": 8640 }
class ____(StringRunMapper): """Map an input to the tool.""" @override def map(self, run: Run) -> dict[str, str]: if not run.outputs: msg = f"Run {run.id} has no outputs to evaluate." raise ValueError(msg) return {"input": run.inputs["input"], "prediction": run.outpu...
ToolStringRunMapper
python
gevent__gevent
src/gevent/tests/test__socket_dns.py
{ "start": 24552, "end": 26829 }
class ____(TestCase): # For this test to work correctly, it needs to resolve to # an address with a single A record; round-robin DNS and multiple A records # may mess it up (subsequent requests---and we always make two---may return # unequal results). We used to use gevent.org, but that now has multiple...
TestGeventOrg
python
sqlalchemy__sqlalchemy
lib/sqlalchemy/orm/strategies.py
{ "start": 4804, "end": 5879 }
class ____(LoaderStrategy): """Represent a non-instrumented MapperProperty. The polymorphic_on argument of mapper() often results in this, if the argument is against the with_polymorphic selectable. """ __slots__ = ("columns",) def __init__(self, parent, strategy_key): super().__init...
_UninstrumentedColumnLoader
python
jina-ai__jina
tests/unit/serve/executors/test_bad_executor_constructor.py
{ "start": 217, "end": 1201 }
class ____(Executor): def __init__(self, metas, requests, runtime_args, dynamic_batching): pass @requests def foo(self, docs, parameters, docs_matrix): pass def test_bad_executor_constructor(): # executor can be used as out of Flow as Python object exec1 = GoodExecutor() exec2...
GoodExecutor2
python
dagster-io__dagster
python_modules/libraries/dagster-azure/dagster_azure/blob/resources.py
{ "start": 665, "end": 1081 }
class ____(Config): """Authenticate using azure.identity.DefaultAzureCredential.""" credential_type: Literal["default_azure_credential"] = "default_azure_credential" kwargs: dict[str, Any] = {} "additional arguments to be passed to azure.identity.DefaultAzureCredential." ' e.g. AzureBlobStorageDef...
AzureBlobStorageDefaultCredential
python
numba__numba
numba/core/datamodel/models.py
{ "start": 38733, "end": 39763 }
class ____(StructModel): def __init__(self, dmm, fe_type): ndim = fe_type.ndim members = [('shape', types.UniTuple(types.intp, ndim)), ('indices', types.EphemeralArray(types.intp, ndim)), ('exhausted', types.EphemeralPointer(types.boolean)), ]...
NdIndexModel
python
spack__spack
var/spack/test_repos/spack_repo/builder_test/packages/callbacks/package.py
{ "start": 243, "end": 574 }
class ____(Package): """Package used to verify that callbacks on phases work correctly, including conditions""" homepage = "http://www.example.com" url = "http://www.example.com/a-1.0.tar.gz" version("2.0", md5="abcdef0123456789abcdef0123456789") version("1.0", md5="0123456789abcdef0123456789abcde...
Callbacks
python
viewflow__viewflow
viewflow/workflow/nodes/obsolete.py
{ "start": 549, "end": 1236 }
class ____(Node): """Missing node instance.""" activation_class = ObsoleteActivation task_type = "OBSOLETE" shape = {"width": 0, "height": 0, "svg": ""} bpmn_element = None def __init__(self, cancel_func=None, undo_func=None, **kwargs): super().__init__(**kwargs) self._undo_...
Obsolete
python
google__pytype
pytype/overlays/attr_overlay.py
{ "start": 2252, "end": 2395 }
class ____: pass # A unique sentinel value to signal not to write anything, not even the # original value. _NO_CHANGE = _NoChange()
_NoChange
python
jina-ai__jina
tests/integration/docarray_v2/test_v2.py
{ "start": 40111, "end": 41126 }
class ____(BaseDoc): tags: Dict[str, str] = {} @pytest.fixture(scope='function') def input_docs(): return DocList[ExternalDeploymentDoc]([ExternalDeploymentDoc() for _ in range(50)]) @pytest.fixture def num_shards(request): return request.param def _external_deployment_args(num_shards, port=None): ...
ExternalDeploymentDoc
python
requests__requests-oauthlib
requests_oauthlib/oauth1_session.py
{ "start": 809, "end": 971 }
class ____(ValueError): def __init__(self, message, response): super(TokenMissing, self).__init__(message) self.response = response
TokenMissing
python
great-expectations__great_expectations
contrib/cli/great_expectations_contrib/package.py
{ "start": 1209, "end": 1314 }
class ____(SerializableDictDot): account_type: SocialLinkType identifier: str @dataclass
SocialLink
python
pytorch__pytorch
test/mobile/model_test/tensor_ops.py
{ "start": 3036, "end": 5128 }
class ____(torch.nn.Module): def forward(self): return self.tensor_creation_ops() def tensor_creation_ops(self): i = torch.tensor([[0, 1, 1], [2, 0, 2]]) real = torch.tensor([1, 2], dtype=torch.float32) imag = torch.tensor([3, 4], dtype=torch.float32) inp = torch.tensor(...
TensorCreationOpsModule
python
wandb__wandb
wandb/vendor/graphql-core-1.1/wandb_graphql/language/ast.py
{ "start": 14203, "end": 14905 }
class ____(Value): __slots__ = ('loc', 'value',) _fields = ('value',) def __init__(self, value, loc=None): self.loc = loc self.value = value def __eq__(self, other): return ( self is other or ( isinstance(other, EnumValue) and # self....
EnumValue
python
Netflix__metaflow
metaflow/plugins/frameworks/pytorch.py
{ "start": 181, "end": 1606 }
class ____(ParallelDecorator): name = "pytorch_parallel" defaults = {"master_port": None} IS_PARALLEL = True def task_decorate( self, step_func, flow, graph, retry_count, max_user_code_retries, ubf_context ): return super().task_decorate( step_func, flow, graph, retry_co...
PytorchParallelDecorator
python
huggingface__transformers
src/transformers/models/edgetam/modeling_edgetam.py
{ "start": 2146, "end": 3459 }
class ____(nn.LayerNorm): r"""LayerNorm that supports two data formats: channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch_size, height, width, channels) while channels_first corresponds to inputs with shape (batch_s...
EdgeTamLayerNorm
python
python-poetry__poetry
src/poetry/packages/locker.py
{ "start": 1751, "end": 24495 }
class ____: _VERSION = "2.1" _READ_VERSION_RANGE = ">=1,<3" _legacy_keys: ClassVar[list[str]] = [ "dependencies", "source", "extras", "dev-dependencies", ] _relevant_keys: ClassVar[list[str]] = [*_legacy_keys, "group"] _relevant_project_keys: ClassVar[list[str]] ...
Locker
python
python-pillow__Pillow
Tests/test_file_libtiff_small.py
{ "start": 157, "end": 1573 }
class ____(LibTiffTestCase): """The small lena image was failing on open in the libtiff decoder because the file pointer was set to the wrong place by a spurious seek. It wasn't failing with the byteio method. It was fixed by forcing an lseek to the beginning of the file just before reading in libt...
TestFileLibTiffSmall
python
tensorflow__tensorflow
tensorflow/python/types/distribute.py
{ "start": 7296, "end": 8014 }
class ____(DistributedValues): """Holds a distributed value: a map from replica id to synchronized values. `Mirrored` values are `tf.distribute.DistributedValues` for which we know that the value on all replicas is the same. `Mirrored` values are kept synchronized by the distribution strategy in use, while `tf...
Mirrored
python
google__jax
tests/pallas/pallas_test.py
{ "start": 2783, "end": 3415 }
class ____(jtu.JaxTestCase): INTERPRET = False def setUp(self): if jtu.test_device_matches(["cpu"]) and not self.INTERPRET: self.skipTest("On CPU the test works only in interpret mode") if (jtu.test_device_matches(["cuda"]) and not jtu.is_cuda_compute_capability_at_least("8.0")): self.s...
PallasBaseTest
python
dagster-io__dagster
examples/docs_projects/project_ml/src/project_ml/defs/assets/model_assets.py
{ "start": 18139, "end": 23519 }
class ____(dg.Config): """Configuration for model deployment.""" accuracy_threshold: float = ACCURACY_THRESHOLD model_path: str = str(MODELS_DIR) custom_model_name: Optional[str] = None # Allow users to specify a specific model to deploy force_deploy: bool = False # Allow users to bypass accuracy...
DeploymentConfig
python
walkccc__LeetCode
solutions/1482. Minimum Number of Days to Make m Bouquets/1482.py
{ "start": 0, "end": 924 }
class ____: def minDays(self, bloomDay: list[int], m: int, k: int) -> int: if len(bloomDay) < m * k: return -1 def getBouquetCount(waitingDays: int) -> int: """ Returns the number of bouquets (k flowers needed) can be made after the `waitingDays`. """ bouquetCount = 0 ...
Solution
python
pytorch__pytorch
tools/test/test_upload_stats_lib.py
{ "start": 722, "end": 8433 }
class ____(unittest.TestCase): emitted_metric: dict[str, Any] = {"did_not_emit": True} def mock_put_item(self, **kwargs: Any) -> None: # Utility for mocking putting items into s3. THis will save the emitted # metric so tests can check it self.emitted_metric = json.loads( gz...
TestUploadStats
python
docker__docker-py
tests/integration/api_container_test.py
{ "start": 54856, "end": 56612 }
class ____(BaseAPIIntegrationTest): @requires_api_version('1.22') def test_update_container(self): old_mem_limit = 400 * 1024 * 1024 new_mem_limit = 300 * 1024 * 1024 container = self.client.create_container( TEST_IMG, 'top', host_config=self.client.create_host_config( ...
ContainerUpdateTest
python
openai__openai-python
tests/api_resources/test_embeddings.py
{ "start": 385, "end": 2378 }
class ____: parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) @parametrize def test_method_create(self, client: OpenAI) -> None: embedding = client.embeddings.create( input="The quick brown fox jumped over the lazy dog", m...
TestEmbeddings
python
neetcode-gh__leetcode
python/0729-my-calendar-i.py
{ "start": 25, "end": 1010 }
class ____: def __init__(self): self.calendar = CalendarNode(-1, -1) def book(self, start: int, end: int) -> bool: def bookHelper(cur, targetStart, targetEnd): if targetStart > cur.end: # go to the right if not cur.right: # we ca...
MyCalendar
python
python__mypy
mypy/test/teststubinfo.py
{ "start": 216, "end": 1587 }
class ____(unittest.TestCase): def test_is_legacy_bundled_packages(self) -> None: assert not is_module_from_legacy_bundled_package("foobar_asdf") assert not is_module_from_legacy_bundled_package("PIL") assert is_module_from_legacy_bundled_package("pycurl") assert is_module_from_legac...
TestStubInfo
python
pytorch__pytorch
torch/package/_mock.py
{ "start": 1390, "end": 2866 }
class ____: _name: str def __new__(cls, *args, **kwargs): # _suppress_err is set by us in the mocked module impl, so that we can # construct instances of MockedObject to hand out to people looking up # module attributes. # Any other attempt to construct a MockedObject instance ...
MockedObject
python
joke2k__faker
tests/sphinx/test_docstring.py
{ "start": 223, "end": 15006 }
class ____: def test_what_is_not_method(self): docstring = ProviderMethodDocstring( app=MagicMock(), what="not_a_method", name="name", obj=MagicMock, options=MagicMock(), lines=MagicMock(), ) assert docstring.skipped ...
TestProviderMethodDocstring
python
tensorflow__tensorflow
tensorflow/python/profiler/pprof_profiler.py
{ "start": 8379, "end": 15157 }
class ____(object): """Creates profiles in pprof format.""" def __init__(self, graph, run_metadata): """Constructor. Args: graph: A `Graph` instance. run_metadata: A list of `RunMetadata` objects. """ self._graph = graph self._run_metadata = run_metadata self._string_table = St...
PprofProfiler
python
crytic__slither
slither/detectors/erc/erc20/incorrect_erc20_interface.py
{ "start": 540, "end": 4327 }
class ____(AbstractDetector): """ Incorrect ERC20 Interface """ ARGUMENT = "erc20-interface" HELP = "Incorrect ERC20 interfaces" IMPACT = DetectorClassification.MEDIUM CONFIDENCE = DetectorClassification.HIGH WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#incorre...
IncorrectERC20InterfaceDetection
python
jazzband__django-oauth-toolkit
oauth2_provider/views/generic.py
{ "start": 186, "end": 361 }
class ____(ProtectedResourceMixin, View): """ Generic view protecting resources by providing OAuth2 authentication out of the box """ pass
ProtectedResourceView