selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | swe_bench_verified::test::23 | swe_bench_verified | test | 23 | django__django-10554 | django/django | django/django | python | 14d026cccb144c6877294ba4cd4e03ebf0842498 | Union queryset with ordering breaks on ordering with derived querysets
Description
(last modified by Sergei Maertens)
May be related to #29692
Simple reproduction (the exact models are not relevant I think):
>>> Dimension.objects.values_list('id', flat=True)
<QuerySet [10, 11, 12, 13, 14, 15, 16, 17, 18]>
>>> qs = ... | Looks like a bug caused by a .query attribute change without performing a prior copy() of the query/queryset.
Attaching a regression test that fails on master (tested at f3d3338e06d571a529bb2046428eeac8e56bcbf6).
PR
Tests aren't passing.
Needs more tests, at the least. But discussion on PR suggests we've not hit the r... | diff --git a/django/db/models/sql/compiler.py b/django/db/models/sql/compiler.py
--- a/django/db/models/sql/compiler.py
+++ b/django/db/models/sql/compiler.py
@@ -356,7 +356,12 @@ def get_order_by(self):
resolved.set_source_expressions([RawSQL('%d' % (idx + 1), ())])
br... | diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py
--- a/tests/queries/test_qs_combinators.py
+++ b/tests/queries/test_qs_combinators.py
@@ -153,6 +153,29 @@ def test_union_with_values_list_on_annotated_and_unannotated(self):
qs2 = Number.objects.filter(num=9)
sel... | ["test_union_with_values_list_and_order (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_union_with_values_list_on_annotated_and_unannotated (queries.test_qs_combinators.QuerySetSetOperationTests)"] | ["test_combining_multiple_models (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_difference (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_intersection (queries.test_qs_combinators.QuerySetSetOperationTests)", "test_count_union (queries.test_qs_combinators.QuerySetSetOperati... | null | true | 2018-10-24T14:24:45Z | 2 | 11 | 2 | 2,904 | 0 | 1 | 1 | 1 | 1 | 0.520667 | 98.562 | |
1 | swe_bench_verified::test::359 | swe_bench_verified | test | 359 | scikit-learn__scikit-learn-13142 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 1c8668b0a021832386470ddf740d834e02c66f69 | GaussianMixture predict and fit_predict disagree when n_init>1
#### Description
When `n_init` is specified in GaussianMixture, the results of fit_predict(X) and predict(X) are often different. The `test_gaussian_mixture_fit_predict` unit test doesn't catch this because it does not set `n_init`.
#### Steps/Code to Rep... | Indeed the code in fit_predict and the one in predict are not exactly consistent. This should be fixed but we would need to check the math to choose the correct variant, add a test and remove the other one.
I don't think the math is wrong or inconsistent. I think it's a matter of `fit_predict` returning the fit from t... | diff --git a/sklearn/mixture/base.py b/sklearn/mixture/base.py
--- a/sklearn/mixture/base.py
+++ b/sklearn/mixture/base.py
@@ -257,11 +257,6 @@ def fit_predict(self, X, y=None):
best_params = self._get_parameters()
best_n_iter = n_iter
- # Always do a final e-step to guarantee... | diff --git a/sklearn/mixture/tests/test_bayesian_mixture.py b/sklearn/mixture/tests/test_bayesian_mixture.py
--- a/sklearn/mixture/tests/test_bayesian_mixture.py
+++ b/sklearn/mixture/tests/test_bayesian_mixture.py
@@ -451,6 +451,15 @@ def test_bayesian_mixture_fit_predict(seed, max_iter, tol):
assert_array_eq... | ["sklearn/mixture/tests/test_bayesian_mixture.py::test_bayesian_mixture_fit_predict_n_init", "sklearn/mixture/tests/test_gaussian_mixture.py::test_gaussian_mixture_fit_predict_n_init"] | ["sklearn/mixture/tests/test_bayesian_mixture.py::test_log_dirichlet_norm", "sklearn/mixture/tests/test_bayesian_mixture.py::test_log_wishart_norm", "sklearn/mixture/tests/test_bayesian_mixture.py::test_bayesian_mixture_covariance_type", "sklearn/mixture/tests/test_bayesian_mixture.py::test_bayesian_mixture_weight_conc... | null | true | 2019-02-12T14:32:37Z | 1 | 10 | 2 | 2,240 | 0 | 1 | 1 | 1 | 1 | 0.406667 | 98.22 | |
2 | swe_bench_verified::test::365 | swe_bench_verified | test | 365 | scikit-learn__scikit-learn-14087 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | a5743ed36fbd3fbc8e351bdab16561fbfca7dfa1 | IndexError thrown with LogisticRegressionCV and refit=False
#### Description
The following error is thrown when trying to estimate a regularization parameter via cross-validation, *without* refitting.
#### Steps/Code to Reproduce
```python
import sys
import sklearn
from sklearn.linear_model import LogisticRegressionCV... | I.e. coefs_paths.ndim < 4? I haven't tried to reproduce yet, but thanks for
the minimal example.
Are you able to check if this was introduced in 0.21?
Yes - the example above works with scikit-learn==0.20.3. Full versions:
```
System:
python: 3.6.8 (default, Jun 4 2019, 11:38:34) [GCC 4.2.1 Compatible Apple ... | diff --git a/sklearn/linear_model/logistic.py b/sklearn/linear_model/logistic.py
--- a/sklearn/linear_model/logistic.py
+++ b/sklearn/linear_model/logistic.py
@@ -2170,7 +2170,7 @@ def fit(self, X, y, sample_weight=None):
# Take the best scores across every fold and the average of
# al... | diff --git a/sklearn/linear_model/tests/test_logistic.py b/sklearn/linear_model/tests/test_logistic.py
--- a/sklearn/linear_model/tests/test_logistic.py
+++ b/sklearn/linear_model/tests/test_logistic.py
@@ -1532,8 +1532,9 @@ def test_LogisticRegressionCV_GridSearchCV_elastic_net_ovr():
assert (lrcv.predict(X_test)... | ["sklearn/linear_model/tests/test_logistic.py::test_LogisticRegressionCV_no_refit[ovr-l2]", "sklearn/linear_model/tests/test_logistic.py::test_LogisticRegressionCV_no_refit[multinomial-l2]", "sklearn/linear_model/tests/test_logistic.py::test_LogisticRegressionCV_no_refit[auto-l2]"] | ["sklearn/linear_model/tests/test_logistic.py::test_predict_2_classes", "sklearn/linear_model/tests/test_logistic.py::test_error", "sklearn/linear_model/tests/test_logistic.py::test_logistic_cv_mock_scorer", "sklearn/linear_model/tests/test_logistic.py::test_logistic_cv_score_does_not_warn_by_default", "sklearn/linear_... | null | true | 2019-06-13T20:09:22Z | 1 | 9 | 3 | 2,243 | 0 | 1 | 1 | 1 | 1 | 0.403833 | 98.2115 | |
3 | swe_bench_verified::test::138 | swe_bench_verified | test | 138 | django__django-14011 | django/django | django/django | python | e4430f22c8e3d29ce5d9d0263fba57121938d06d | LiveServerTestCase's ThreadedWSGIServer doesn't close database connections after each thread
Description
In Django 2.2.17, I'm seeing the reappearance of #22414 after it was fixed in 1.11. #22414 is the issue where the following error will occur at the conclusion of a test run when destroy_test_db() is called:
Operati... | I wonder if this issue is because ThreadingMixIn creates a new thread for each request, but those threads don't close their database connections at their conclusion, e.g. like LiveServerThread does. Here is the code in CPython for ThreadingMixIn's process_request() and server_close(): https://github.com/python/cpython... | diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py
--- a/django/core/servers/basehttp.py
+++ b/django/core/servers/basehttp.py
@@ -16,6 +16,7 @@
from django.core.exceptions import ImproperlyConfigured
from django.core.handlers.wsgi import LimitedStream
from django.core.wsgi import get_wsg... | diff --git a/django/test/testcases.py b/django/test/testcases.py
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1513,11 +1513,12 @@ def run(self):
finally:
connections.close_all()
- def _create_server(self):
+ def _create_server(self, connections_override=None):
... | ["test_live_server_url_is_class_property (servers.tests.LiveServerAddress)", "Data written to the database by a view can be read.", "Fixtures are properly loaded and visible to the live server thread.", "test_check_model_instance_from_subview (servers.tests.LiveServerThreadedTests)", "test_view_calls_subview (servers.t... | ["test_set_up_class (servers.tests.LiveServerTestCaseSetupTest)", "Contrast to"] | null | true | 2021-02-15T06:15:21Z | 2 | 24 | 17 | 1,905 | 0 | 1 | 1 | 1 | 1 | 0.3975 | 98.1925 | |
4 | swe_bench_verified::test::368 | swe_bench_verified | test | 368 | scikit-learn__scikit-learn-14629 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 4aded39b5663d943f6a4809abacfa9cae3d7fb6a | AttributeError with cross_val_predict(method='predict_proba') when using MultiOuputClassifier
#### Description
I believe there is a bug when using `cross_val_predict(method='predict_proba')` with a `MultiOutputClassifer`.
I think the problem is in the use of `estimator.classes_` here:
https://github.com/scikit-learn/s... | Please provide the full traceback to make it easier for us to see where the
error is raised. I will admit I'm surprised this still has issues, but it
is a surprisingly complicated bit of code.
I think this bug is in MultiOutputClassifier. All classifiers should store `classes_` when fitted.
Help wanted to add `classes... | diff --git a/sklearn/multioutput.py b/sklearn/multioutput.py
--- a/sklearn/multioutput.py
+++ b/sklearn/multioutput.py
@@ -325,6 +325,28 @@ class MultiOutputClassifier(MultiOutputEstimator, ClassifierMixin):
def __init__(self, estimator, n_jobs=None):
super().__init__(estimator, n_jobs)
+ def fit(sel... | diff --git a/sklearn/tests/test_multioutput.py b/sklearn/tests/test_multioutput.py
--- a/sklearn/tests/test_multioutput.py
+++ b/sklearn/tests/test_multioutput.py
@@ -527,3 +527,20 @@ def test_base_chain_crossval_fit_and_predict():
assert jaccard_score(Y, Y_pred_cv, average='samples') > .4
else:
... | ["sklearn/tests/test_multioutput.py::test_multi_output_classes_[estimator1]"] | ["sklearn/tests/test_multioutput.py::test_multi_target_regression", "sklearn/tests/test_multioutput.py::test_multi_target_regression_partial_fit", "sklearn/tests/test_multioutput.py::test_multi_target_regression_one_target", "sklearn/tests/test_multioutput.py::test_multi_target_sparse_regression", "sklearn/tests/test_m... | null | true | 2019-08-12T09:31:54Z | 1 | 24 | 1 | 1,751 | 0 | 1 | 1 | 1 | 1 | 0.371833 | 98.1155 | |
5 | swe_bench_verified::test::377 | swe_bench_verified | test | 377 | scikit-learn__scikit-learn-25973 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 10dbc142bd17ccf7bd38eec2ac04b52ce0d1009e | Unable to pass splits to SequentialFeatureSelector
### Describe the bug
This runs fine with e.g. `cv=5`, but according to the documentation, it should also be able to take an iterable of splits.
However, passing splits from the cross validator fails
Im fairly certain I have done similar things in the past to other cl... | The internal algorithm will use the `cv` parameter in a `for` loop. If `cv` is a generator, it will be consumed at the first iteration only. Later it trigger the error because we did not complete the other iteration of the `for` loop.
Passing a list (e.g. `cv=list(splits)`) will solve the problem because we can reus... | diff --git a/sklearn/feature_selection/_sequential.py b/sklearn/feature_selection/_sequential.py
--- a/sklearn/feature_selection/_sequential.py
+++ b/sklearn/feature_selection/_sequential.py
@@ -8,12 +8,12 @@
import warnings
from ._base import SelectorMixin
-from ..base import BaseEstimator, MetaEstimatorMixin, clo... | diff --git a/sklearn/feature_selection/tests/test_sequential.py b/sklearn/feature_selection/tests/test_sequential.py
--- a/sklearn/feature_selection/tests/test_sequential.py
+++ b/sklearn/feature_selection/tests/test_sequential.py
@@ -6,11 +6,12 @@
from sklearn.preprocessing import StandardScaler
from sklearn.pipelin... | ["sklearn/feature_selection/tests/test_sequential.py::test_cv_generator_support"] | ["sklearn/feature_selection/tests/test_sequential.py::test_bad_n_features_to_select", "sklearn/feature_selection/tests/test_sequential.py::test_n_features_to_select[1-forward]", "sklearn/feature_selection/tests/test_sequential.py::test_n_features_to_select[1-backward]", "sklearn/feature_selection/tests/test_sequential.... | null | true | 2023-03-25T13:27:07Z | 1 | 12 | 1 | 1,919 | 0 | 1 | 1 | 1 | 1 | 0.359833 | 98.0795 | |
6 | swe_bench_verified::test::397 | swe_bench_verified | test | 397 | sphinx-doc__sphinx-7985 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | f30284ef926ebaf04b176f21b421e2dffc679792 | linkcheck could also check local (internal) links
Subject: linkcheck currently doesn't check local (internal) links, but this would be useful.
### Problem
See above.
#### Procedure to reproduce the problem
Create a template project with sphinx-quickstart, put the following in index.rst
```
broken external-link_
broke... | +0: It might be useful. But all we can check is only inside sphinx-document. If users copy extra file in deploy script, we'll misdetect broken links. And it is hard if local hyperlink is absolute path. We don't know where the document will be placed.
At least this could be an optional feature; I'd guess there are a lot... | diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -35,6 +35,8 @@
logger = logging.getLogger(__name__)
+uri_re = re.compile('[a-z]+://')
+
DEFAULT_REQUEST_HEADERS = {
'Accept': 'text/html,application/xhtml+xml;q=... | diff --git a/tests/roots/test-linkcheck/links.txt b/tests/roots/test-linkcheck/links.txt
--- a/tests/roots/test-linkcheck/links.txt
+++ b/tests/roots/test-linkcheck/links.txt
@@ -11,6 +11,8 @@ Some additional anchors to exercise ignore code
* `Example Bar invalid <https://www.google.com/#top>`_
* `Example anchor inva... | ["tests/test_build_linkcheck.py::test_defaults", "tests/test_build_linkcheck.py::test_anchors_ignored"] | ["tests/test_build_linkcheck.py::test_defaults_json", "tests/test_build_linkcheck.py::test_auth", "tests/test_build_linkcheck.py::test_linkcheck_request_headers"] | null | true | 2020-07-19T10:09:07Z | 1 | 17 | 2 | 1,444 | 0 | 1 | 1 | 1 | 1 | 0.297333 | 97.892 | |
7 | swe_bench_verified::test::61 | swe_bench_verified | test | 61 | django__django-11815 | django/django | django/django | python | e02f67ef2d03d48128e7a118bf75f0418e24e8ac | Migrations uses value of enum object instead of its name.
Description
(last modified by oasl)
When using Enum object as a default value for a CharField, the generated migration file uses the value of the Enum object instead of the its name. This causes a problem when using Django translation on the value of the Enu... | Thanks for this report, however I'm not sure how translated values can brake migrations. Can you provide a sample project to reproduce this issue? Migrations with translatable strings works fine for me: >>> class TextEnum(enum.Enum): ... C = _('translatable value') ... >>> TextEnum(_('translatable value')) <TextEnum.C:... | diff --git a/django/db/migrations/serializer.py b/django/db/migrations/serializer.py
--- a/django/db/migrations/serializer.py
+++ b/django/db/migrations/serializer.py
@@ -120,9 +120,10 @@ class EnumSerializer(BaseSerializer):
def serialize(self):
enum_class = self.value.__class__
module = enum_cl... | diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
--- a/tests/migrations/test_writer.py
+++ b/tests/migrations/test_writer.py
@@ -257,6 +257,10 @@ class TextEnum(enum.Enum):
A = 'a-value'
B = 'value-b'
+ class TextTranslatedEnum(enum.Enum):
+ A ... | ["test_serialize_class_based_validators (migrations.test_writer.WriterTests)", "test_serialize_enums (migrations.test_writer.WriterTests)"] | ["test_args_kwargs_signature (migrations.test_writer.OperationWriterTests)", "test_args_signature (migrations.test_writer.OperationWriterTests)", "test_empty_signature (migrations.test_writer.OperationWriterTests)", "test_expand_args_signature (migrations.test_writer.OperationWriterTests)", "test_kwargs_signature (migr... | null | true | 2019-09-24T21:45:36Z | 1 | 7 | 2 | 1,595 | 0 | 1 | 1 | 1 | 1 | 0.289167 | 97.8675 | |
8 | swe_bench_verified::test::391 | swe_bench_verified | test | 391 | sphinx-doc__sphinx-7462 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | b3e26a6c851133b82b50f4b68b53692076574d13 | `IndexError: pop from empty list` for empty tuple type annotation
**Describe the bug**
Following notation for empty tuple from [this mypy issue](https://github.com/python/mypy/issues/4211) like
```python
from typing import Tuple
def foo() -> Tuple[()]:
"""Sample text."""
return ()
```
I get
```bash
File "\path\... | Changing
https://github.com/sphinx-doc/sphinx/blob/b3e26a6c851133b82b50f4b68b53692076574d13/sphinx/domains/python.py#L117-L122
to
```python
if node.elts:
result = []
for elem in node.elts:
result.extend(unparse(elem))
result.app... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -105,11 +105,16 @@ def unparse(node: ast.AST) -> List[Node]:
result.append(addnodes.desc_sig_punctuation('', ']'))
return result
elif isinstance(node, ast.... | diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -255,6 +255,13 @@ def test_parse_annotation():
[pending_xref, "int"],
[desc_sig_punctuation, "]"]))
+ doctree = _parse_annotation("Tupl... | ["tests/test_domain_py.py::test_parse_annotation", "tests/test_pycode_ast.py::test_unparse[()-()]"] | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam... | null | true | 2020-04-12T04:10:05Z | 2 | 20 | 2 | 1,130 | 0 | 1 | 1 | 1 | 1 | 0.255 | 97.765 | |
9 | swe_bench_verified::test::1 | swe_bench_verified | test | 1 | astropy__astropy-13033 | astropy/astropy | astropy/astropy | python | 298ccb478e6bf092953bca67a3d29dc6c35f6752 | TimeSeries: misleading exception when required column check fails.
### Description
For a `TimeSeries` object that has additional required columns (in addition to `time`), when codes mistakenly try to remove a required column, the exception it produces is misleading.
### Expected behavior
An exception that informs t... | The relevant code that produces the misleading exception.
https://github.com/astropy/astropy/blob/00ccfe76113dca48d19396986872203dc2e978d7/astropy/timeseries/core.py#L77-L82
It works under the assumption that `time` is the only required column. So when a `TimeSeries` object has additional required columns, the me... | diff --git a/astropy/timeseries/core.py b/astropy/timeseries/core.py
--- a/astropy/timeseries/core.py
+++ b/astropy/timeseries/core.py
@@ -55,6 +55,13 @@ class BaseTimeSeries(QTable):
_required_columns_relax = False
def _check_required_columns(self):
+ def as_scalar_or_list_str(obj):
+ if ... | diff --git a/astropy/timeseries/tests/test_sampled.py b/astropy/timeseries/tests/test_sampled.py
--- a/astropy/timeseries/tests/test_sampled.py
+++ b/astropy/timeseries/tests/test_sampled.py
@@ -395,6 +395,14 @@ def test_required_columns():
assert exc.value.args[0] == ("TimeSeries object is invalid - expected "
... | ["astropy/timeseries/tests/test_sampled.py::test_required_columns"] | ["astropy/timeseries/tests/test_sampled.py::test_empty_initialization", "astropy/timeseries/tests/test_sampled.py::test_empty_initialization_invalid", "astropy/timeseries/tests/test_sampled.py::test_initialize_only_time", "astropy/timeseries/tests/test_sampled.py::test_initialization_with_data", "astropy/timeseries/tes... | null | true | 2022-03-31T23:28:27Z | 1 | 14 | 1 | 1,039 | 0 | 1 | 1 | 1 | 1 | 0.219833 | 97.6595 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- -