instance_id stringlengths 18 32 | correct_response stringclasses 2
values | pair_type stringclasses 2
values | episode_a int64 1 15 | text_a stringlengths 40.8k 57.8k | full_output_a stringlengths 2.18k 44.1k | model_patch_a stringlengths 288 3.62k | resolved_a bool 2
classes | num_passed_tests_a int64 0 151 | episode_b int64 1 16 | text_b stringlengths 40.8k 57.8k | full_output_b stringlengths 2.21k 53.5k | model_patch_b stringlengths 227 4.4k | resolved_b bool 2
classes | num_passed_tests_b int64 0 247 | model_name stringclasses 1
value | num_episodes_used int64 16 16 | success_episode int64 1 12 ⌀ | failure_episode int64 1 11 ⌀ | better_episode int64 2 16 ⌀ | worse_episode int64 2 14 ⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sphinx-doc__sphinx-9320 | A | unresolved | 15 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
`sphinx-quickstart` with existing conf.py doesn't exit easily
**Describe the bug**
I've attached a screenshot in the screenshots section which I think explains the bug better.
- I'm running `sphinx-quicksta... |
Okay, let's look at the problem. The user is running sphinx-quickstart in a directory that already has a conf.py. When they try to exit by pressing Enter at the prompt asking for a new root path, they get an error saying "Please enter a valid path name" instead of exiting.
Looking at the code in sphinx/cmd/quickstart... |
--- a/sphinx/cmd/quickstart.py
+++ b/sphinx/cmd/quickstart.py
@@ -226,6 +226,8 @@
'', is_path)
if not d['path']:
sys.exit(1)
+ if not d['path']:
+ sys.exit(1)
while path.isfile(path.join(d['path'], 'conf.py')) or \
path.isfile(... | false | 9 | 13 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
`sphinx-quickstart` with existing conf.py doesn't exit easily
**Describe the bug**
I've attached a screenshot in the screenshots section which I think explains the bug better.
- I'm running `sphinx-quicksta... |
Okay, let's see. The user is reporting an issue with sphinx-quickstart where if there's an existing conf.py, pressing Enter to exit isn't working. Instead, it's throwing an error saying to enter a valid path name.
Looking at the code in sphinx/cmd/quickstart.py, specifically the part where the path is validated. The ... | --- a/sphinx/cmd/quickstart.py
+++ b/sphinx/cmd/quickstart.py
@@ -225,7 +225,7 @@
print()
print(bold(__('Error: an existing conf.py has been found in the '
'selected root path.')))
- d['path'] = do_prompt(__('Please enter a new root path (or just Enter to exit)'), '', is_... | false | 0 | Qwen3-32B | 16 | null | null | 15 | 13 |
pytest-dev__pytest-8399 | A | resolved | 12 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Starting v6.2.0, unittest setUpClass fixtures are no longer "private"
<!--
Thanks for submitting an issue!
Quick check-list while reporting bugs:
-->
Minimal example:
```
import unittest
class Tests(... |
Okay, let's tackle this issue. The user is saying that starting from pytest version 6.2.0, the setUpClass fixtures from unittest are no longer private. The problem is that these fixtures are showing up in the pytest --fixtures list without an underscore, which is causing issues with their CI script that checks for und... | --- a/src/_pytest/unittest.py
+++ b/src/_pytest/unittest.py
@@ -146,7 +146,7 @@
@pytest.fixture(
scope=scope,
autouse=True,
- name=f"unittest_{setup_name}_fixture_{obj.__qualname__}",
+ name=f"_unittest_{setup_name}_fixture_{obj.__qualname__}",
)
def fixture(self, request:... | true | 60 | 11 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Starting v6.2.0, unittest setUpClass fixtures are no longer "private"
<!--
Thanks for submitting an issue!
Quick check-list while reporting bugs:
-->
Minimal example:
```
import unittest
class Tests(... |
Okay, let's tackle this issue. The user is reporting that starting from pytest version 6.2.0, the fixtures generated for unittest's setUpClass are no longer "private." Previously, these fixtures had names starting with an underscore, which made them hidden unless the -v flag was used. Now, they're visible by default, ... | --- a/src/_pytest/unittest.py
+++ b/src/_pytest/unittest.py
@@ def _make_xunit_fixture(
- name=f"unittest_{setup_name}_fixture_{obj.__qualname__}",
+ name=f"_unittest_{setup_name}_fixture_{obj.__qualname__}",
| false | 0 | Qwen3-32B | 16 | 12 | 11 | null | null |
django__django-11477 | A | unresolved | 10 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
translate_url() creates an incorrect URL when optional named groups are missing in the URL pattern
Description
There is a problem when translating urls with absent 'optional' arguments
(it's seen in test case... |
Okay, I need to figure out how to fix the issue where translate_url() creates incorrect URLs when optional named groups are missing. Let me start by understanding the problem based on the provided code and the issue description.
The issue says that when optional arguments are absent in the URL pattern, the generated ... | diff --git a/django/urls/resolvers.py b/django/urls/resolvers.py
index 1234567..89abcde 100644
--- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ def _reverse_with_prefix(self, lookup_view, _prefix, *args, **kwargs):
- if set(kwargs).symmetric_difference(params).difference(defaults):
+ if se... | false | 151 | 11 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
translate_url() creates an incorrect URL when optional named groups are missing in the URL pattern
Description
There is a problem when translating urls with absent 'optional' arguments
(it's seen in test case... |
Okay, let's try to figure out how to solve this problem. The issue is that when there are optional named groups in a URL pattern and some of them are missing, the translate_url() function (or whatever is handling URL reversing) is generating an incorrect URL. The user mentioned that there's a test case in the patch, b... | --- a/django/urls/resolvers.py
+++ b/django/urls/resolvers.py
@@ def _reverse_with_prefix(self, lookup_view, _prefix, *args, **kwargs):
candidate_subs = kwargs
# Convert the candidate subs to text using Converter.to_url().
text_candidate_subs = {}
+ ... | false | 0 | Qwen3-32B | 16 | null | null | 10 | 11 |
pydata__xarray-6461 | B | unresolved | 6 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
xr.where with scalar as second argument fails with keep_attrs=True
### What happened?
``` python
import xarray as xr
xr.where(xr.DataArray([1, 2, 3]) > 0, 1, 0)
```
fails with
```
1809 if keep_a... |
Okay, I need to figure out how to fix the xr.where error when using a scalar as the second argument with keep_attrs=True. Let's look at the issue description and the code provided.
The error occurs in the line where keep_attrs is set to a lambda function that tries to get attrs[1]. The problem is that when the second... |
--- a/xarray/core/computation.py
+++ b/xarray/core/computation.py
@@ -1807,7 +1807,7 @@
# keep the attributes of x, the second parameter, by default to
# be consistent with the `where` method of `DataArray` and `Dataset`
keep_attrs = True
- keep_attrs = lambda attrs, c... | false | 0 | 5 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
xr.where with scalar as second argument fails with keep_attrs=True
### What happened?
``` python
import xarray as xr
xr.where(xr.DataArray([1, 2, 3]) > 0, 1, 0)
```
fails with
```
1809 if keep_a... |
Okay, let's see. The user is reporting an issue with xr.where when using a scalar as the second argument and keep_attrs=True. The error is an IndexError in the xarray code. The problem occurs when they run xr.where on a DataArray with 1, 2, 3 and condition >0, passing 1 and 0 as the true and false values. The error is... |
--- a/xarray/core/computation.py
+++ b/xarray/core/computation.py
@@ -1809,3 +1809,3 @@
- keep_attrs = lambda attrs, context: attrs[1]
+ keep_attrs = lambda attrs, context: (attrs[1] if len(attrs) > 1 else None)
| false | 247 | Qwen3-32B | 16 | null | null | 5 | 6 |
django__django-14315 | A | unresolved | 12 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
database client runshell doesn't respect os.environ values in some cases
Description
(last modified by Konstantin Alekseev)
postgresql client returns empty dict instead of None for env
as a result os.en... |
Okay, let's see. The user mentioned an issue with the database client's runshell not respecting os.environ values in some cases. Specifically, the PostgreSQL client returns an empty dict instead of None for env, leading to empty environment variables being passed to subprocess. The bug was introduced in a specific com... |
--- a/django/db/backends/base/client.py
+++ b/django/db/backends/base/client.py
@@ -24,7 +24,7 @@ def runshell(self, parameters):
args, env = self.settings_to_cmd_args_env(self.connection.settings_dict, parameters)
- if env:
- env = {**os.environ, **env}
+ if env is not None:
+ ... | false | 7 | 14 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
database client runshell doesn't respect os.environ values in some cases
Description
(last modified by Konstantin Alekseev)
postgresql client returns empty dict instead of None for env
as a result os.en... |
Okay, let's tackle this issue. The problem is that the database client's runshell method isn't respecting os.environ values in some cases, specifically with PostgreSQL returning an empty dict instead of None. The bug was introduced in a specific commit, and there's a PR mentioned.
Looking at the provided code, the re... |
--- a/django/db/backends/base/client.py
+++ b/django/db/backends/base/client.py
@@ def runshell(self, parameters):
- if env:
- env = {**os.environ, **env}
+ if env is not None:
+ env = {**os.environ, **env}
| false | 0 | Qwen3-32B | 16 | null | null | 12 | 14 |
sympy__sympy-22714 | A | unresolved | 10 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
simpify gives `Imaginary coordinates are not permitted.` with evaluate(False)
## Issue
`with evaluate(False)` crashes unexpectedly with `Point2D`
## Code
```python
import sympy as sp
with sp.evaluate(Fal... |
Okay, let's try to figure out why the code is throwing that error. The user is using SymPy's sympify function with evaluate=False inside a context manager that disables evaluation. The error is about imaginary coordinates not being allowed in Point2D.
First, I need to look at the code flow. The code is:
with sp.eva... | --- a/sympy/core/sympify.py
+++ b/sympy/core/sympify.py
@@ -475,6 +475,12 @@ def sympify(a, locals=None, convert_xor=True, strict=False, rational=False,
raise SympifyError('could not parse %r' % a, exc)
return expr
+
+ # Ensure Point2D coordinates are numeric even when evaluate=False
+ if isinstan... | false | 11 | 2 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
simpify gives `Imaginary coordinates are not permitted.` with evaluate(False)
## Issue
`with evaluate(False)` crashes unexpectedly with `Point2D`
## Code
```python
import sympy as sp
with sp.evaluate(Fal... |
Okay, let's tackle this issue. The user is encountering a ValueError when using sympify with evaluate=False inside a with evaluate(False): block. The error is "Imaginary coordinates are not permitted." Let's see why that's happening.
Looking at the code example, they're trying to create a Point2D using sympify with e... |
--- a/sympy/core/sympify.py
+++ b/sympy/core/sympify.py
@@ -10,6 +10,8 @@
from sympy.core.random import choice
from .parameters import global_parameters
from sympy.utilities.exceptions import SymPyDeprecationWarning
from sympy.utilities.iterables import iterable
+from sympy.core.numbers import Integer, Rational,... | false | 0 | Qwen3-32B | 16 | null | null | 10 | 2 |
django__django-10914 | B | resolved | 8 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Set default FILE_UPLOAD_PERMISSION to 0o644.
Description
Hello,
As far as I can see, the File Uploads documentation page does not mention any permission issues.
What I would like to see is a warning that in ... |
Okay, let's see. The user is talking about setting a default FILE_UPLOAD_PERMISSIONS to 0o644 in Django. The problem is that when files are uploaded, depending on whether they're handled by MemoryFileUploadHandler or TemporaryFileUploadHandler, the permissions might vary. Specifically, when using the temporary file ha... | --- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -307,7 +307,7 @@
FILE_UPLOAD_PERMISSIONS = None
# The numeric mode to assign to newly-created directories, when uploading files.
# The value should be a mode as you'd pass to os.chmod;
# see https://docs.python.org/library/os.html#files-... | false | 0 | 1 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Set default FILE_UPLOAD_PERMISSION to 0o644.
Description
Hello,
As far as I can see, the File Uploads documentation page does not mention any permission issues.
What I would like to see is a warning that in ... |
Okay, let's tackle this issue. The user wants to set the default FILE_UPLOAD_PERMISSIONS to 0o644 in Django. From the provided code, I need to look at the relevant files.
Looking at the code, the global_settings.py file has a setting called FILE_UPLOAD_PERMISSIONS, which is set to None by default. The issue is that w... | --- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -307,7 +307,7 @@
# The numeric mode to set newly-uploaded files to. The value should be a mode
# you'd pass directly to os.chmod; see https://docs.python.org/library/os.html#files-and-directories.
FILE_UPLOAD_PERMISSIONS = None
-
+FILE_UPLO... | true | 99 | Qwen3-32B | 16 | 1 | 8 | null | null |
pytest-dev__pytest-7324 | B | unresolved | 10 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Pytest crashes the interpreter on debug build for 3.8+
Short reproducer
```py
>>> Expression.compile("False")
python: Python/compile.c:3559: compiler_nameop: Assertion `!_PyUnicode_EqualToASCIIString(name, "... |
Okay, I need to figure out how to fix the issue where Pytest crashes the interpreter on a debug build for Python 3.8+ when compiling an expression with "False". The error is an assertion failure in the Python compiler, specifically in the function compiler_nameop. The assertion checks that the name isn't "None", "True... | --- a/src/_pytest/mark/__init__.py
+++ b/src/_pytest/mark/__init__.py
@@ def deselect_by_keyword(items: "List[Item]", config: Config) -> None:
keywordexpr = config.option.keyword.lstrip()
if not keywordexpr:
return
+ # Replace Python keywords False, True, None with string representations
+ # t... | false | 0 | 13 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Pytest crashes the interpreter on debug build for 3.8+
Short reproducer
```py
>>> Expression.compile("False")
python: Python/compile.c:3559: compiler_nameop: Assertion `!_PyUnicode_EqualToASCIIString(name, "... |
Okay, let's tackle this issue. The problem is that Pytest crashes the interpreter on a debug build for Python 3.8+ when compiling an expression with "False". The error is an assertion failure in the Python compiler, specifically in the compiler_nameop function. The assertion checks that the name isn't "None", "True", ... | --- a/src/_pytest/mark/__init__.py
+++ b/src/_pytest/mark/__init__.py
@@ import keyword
@@ -177,6 +177,7 @@
def deselect_by_keyword(items: "List[Item]", config: Config) -> None:
keywordexpr = config.option.keyword.lstrip()
if not keywordexpr:
return
+
if keywordexpr.startswith("-"):
# ... | false | 58 | Qwen3-32B | 16 | null | null | 13 | 10 |
django__django-15277 | B | resolved | 1 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Micro-optimisation for Value._resolve_output_field (by modifying CharField.__init__)
Description
Currently, when you do something like annotate(x=Value('test')) that will eventually probably call down into Va... |
Okay, let me try to figure out how to solve this issue. The problem is about optimizing the Value._resolve_output_field method in Django by modifying the CharField's initialization to avoid unnecessary validators when max_length is None.
First, I need to understand the current code. The issue mentions that when Valu... |
--- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -582,7 +582,8 @@ class CharField(Field):
super().__init__(*args, **kwargs)
self.max_length = max_length
if self.max_length is not None:
- self.validators.append(validators.MaxLengthValidator(sel... | false | 0 | 6 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Micro-optimisation for Value._resolve_output_field (by modifying CharField.__init__)
Description
Currently, when you do something like annotate(x=Value('test')) that will eventually probably call down into Va... |
Okay, let's see. The user is talking about a micro-optimization for the Value._resolve_output_field method in Django. The main issue is that when you create a Value with a string, it returns a CharField, but that CharField has a MaxLengthValidator which isn't useful here because the output_field's validators aren't us... | --- a/django/db/models/fields/__init__.py
+++ b/django/db/models/fields/__init__.py
@@ -1234,7 +1234,8 @@ class CharField(Field):
super().__init__(*args, **kwargs)
self.validators.append(validators.RegexValidator(
r'[\w.+-]+@[a-zA-Z0-9_]+?\.[a-zA-Z0-9_.-]+$',
))
- self.val... | true | 160 | Qwen3-32B | 16 | 6 | 1 | null | null |
pytest-dev__pytest-10356 | B | unresolved | 4 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Consider MRO when obtaining marks for classes
When using pytest markers in two baseclasses `Foo` and `Bar`, inheriting from both of those baseclasses will lose the markers of one of those classes. This behavior... |
Okay, let's tackle this problem. The user is reporting an issue with pytest where markers from multiple base classes aren't being merged correctly. They provided a code example where using a metaclass to collect markers from the MRO (Method Resolution Order) solves the problem. The goal is to fix this in pytest itself... |
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ def __init__(
@@ -227,6 +227,24 @@ class Node(metaclass=NodeMeta):
#: Allow adding of extra keywords to use for matching.
self.extra_keyword_matches: Set[str] = set()
+ @property
+ def pytestmark(self):
+ """Aggregate markers fro... | false | 0 | 16 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Consider MRO when obtaining marks for classes
When using pytest markers in two baseclasses `Foo` and `Bar`, inheriting from both of those baseclasses will lose the markers of one of those classes. This behavior... |
Okay, I need to address the issue where pytest doesn't correctly merge markers from multiple base classes in the MRO. The user provided a code example where using a metaclass helps collect markers from all parent classes. The problem is that without the metaclass, only the first marker in the MRO is considered.
Looki... | diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py
index 0c3b8c5..f4a2d5c 100644
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ def __init__(
self,
name,
parent=None,
config: Optional[Config] = None,
session: Optional["Session"] = None,
nodeid: Optio... | false | 79 | Qwen3-32B | 16 | null | null | 16 | 4 |
django__django-13741 | B | unresolved | 3 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Set disabled prop on ReadOnlyPasswordHashField
Description
Currently the django.contrib.auth.forms.UserChangeForm defines a clean_password method that returns the initial password value to prevent (accidental... |
Okay, let's tackle this issue. The user wants to set the disabled prop on the ReadOnlyPasswordHashField in Django's UserChangeForm. The problem is that currently, the clean_password method is needed to prevent accidental password changes, but using the disabled attribute on the field could eliminate the need for that ... |
--- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ def __init__(self, *args, **kwargs):
- kwargs.setdefault("required", False)
+ kwargs.setdefault("required", False)
+ kwargs.setdefault("disabled", True)
super().__init__(*args, **kwargs)
def bound_data(self, d... | false | 0 | 12 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Set disabled prop on ReadOnlyPasswordHashField
Description
Currently the django.contrib.auth.forms.UserChangeForm defines a clean_password method that returns the initial password value to prevent (accidental... |
Okay, let's tackle this issue. The user wants to set the disabled prop on the ReadOnlyPasswordHashField in Django's UserChangeForm. The problem is that currently, the form uses a clean_password method to prevent password changes, but using the disabled attribute would make this unnecessary and avoid potential errors i... | --- a/django/contrib/auth/forms.py
+++ b/django/contrib/auth/forms.py
@@ -147,7 +147,8 @@ class UserChangeForm(forms.ModelForm):
'Raw passwords are not stored, so there is no way to see this '
'user’s password, but you can change the password using '
'<a href="{}">this form</a>.'
... | false | 82 | Qwen3-32B | 16 | null | null | 12 | 3 |
scikit-learn__scikit-learn-10908 | A | unresolved | 11 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
CountVectorizer's get_feature_names raise not NotFittedError when the vocabulary parameter is provided
If you initialize a `CounterVectorizer` and try to perform a transformation without training you will get a... |
Okay, let's see. The user is reporting an issue with the CountVectorizer in scikit-learn. The problem is that when a vocabulary is provided during initialization, the get_feature_names() method raises a NotFittedError, even though the vectorizer hasn't been fitted yet. However, the transform method works because it se... |
--- a/sklearn/feature_extraction/text.py
+++ b/sklearn/feature_extraction/text.py
@@ def __init__(self, input='content', encoding='utf-8', decode_error='strict',
@@ -1600,6 +1600,7 @@ class CountVectorizer(TransformerMixin):
self.tokenizer = tokenizer
self.analyzer = analyzer
self.vocabulary... | false | 47 | 9 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
CountVectorizer's get_feature_names raise not NotFittedError when the vocabulary parameter is provided
If you initialize a `CounterVectorizer` and try to perform a transformation without training you will get a... |
Okay, let's see. The issue is about CountVectorizer's get_feature_names method raising a NotFittedError when the vocabulary is provided but the vectorizer hasn't been fitted. The user says that when you provide a vocabulary during initialization, you can call transform without fitting, and indeed, the vocabulary_ attr... |
--- a/sklearn/feature_extraction/text.py
+++ b/sklearn/feature_extraction/text.py
@@ -1589,12 +1589,14 @@ def get_feature_names_out(self, input_features=None):
return self._get_feature_names_out(input_features)
def get_feature_names(self):
- """Array mapping from feature integer indices to featu... | false | 0 | Qwen3-32B | 16 | null | null | 11 | 9 |
django__django-16527 | B | resolved | 4 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
"show_save_as_new" in admin can add without this permission
Description
(last modified by Mariusz Felisiak)
At "django/contrib/admin/templatetags/admin_modify.py" file, line 102, I think you must put on... |
Okay, let's tackle this issue. The user is pointing out a problem in Django's admin code where the "show_save_as_new" button can be accessed without the necessary add permission. The issue is in the file django/contrib/admin/templatetags/admin_modify.py, specifically line 102.
Looking at the code for the submit_row f... |
--- a/django/contrib/admin/templatetags/admin_modify.py
+++ b/django/contrib/admin/templatetags/admin_modify.py
@@ -102,7 +102,7 @@ def submit_row(context):
"show_delete_link": (
not is_popup
and context["has_delete_permission"]
- and change
+ ... | false | 6 | 8 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
"show_save_as_new" in admin can add without this permission
Description
(last modified by Mariusz Felisiak)
At "django/contrib/admin/templatetags/admin_modify.py" file, line 102, I think you must put on... |
Okay, let's tackle this issue. The user is saying that in Django's admin, the "show_save_as_new" button can be accessed without having the add permission. The problem is in the file django/contrib/admin/templatetags/admin_modify.py, specifically line 102. They suggest adding a check for has_add_permission because save... | --- a/django/contrib/admin/templatetags/admin_modify.py
+++ b/django/contrib/admin/templatetags/admin_modify.py
@@ -102,7 +102,8 @@ def submit_row(context):
"show_save_as_new": not is_popup
and has_change_permission
+ and has_add_permission
and change
and s... | true | 7 | Qwen3-32B | 16 | 8 | 4 | null | null |
django__django-14017 | B | unresolved | 13 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Q(...) & Exists(...) raises a TypeError
Description
Exists(...) & Q(...) works, but Q(...) & Exists(...) raise a TypeError
Here's a minimal example:
In [3]: Exists(Product.objects.all()) & Q()
Out[3]: <Q: (AN... |
Okay, let's see. The user is reporting an issue where using Q() & Exists(...) raises a TypeError, but Exists(...) & Q() works. The problem seems to be with the commutativity of the & operator between Q objects and Exists expressions.
Looking at the provided code, specifically in django/db/models/query_utils.py where ... |
--- a/django/db/models/expressions.py
+++ b/django/db/models/expressions.py
@@ -1,5 +1,7 @@
from django.db.models import Field, Func, Lookup, Transform
+from django.db.models.query_utils import Q
class Exists(Func):
@@ -10,6 +12,14 @@
super().__init__(query, output_field=Field())
def __and__(self... | false | 0 | 3 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Q(...) & Exists(...) raises a TypeError
Description
Exists(...) & Q(...) works, but Q(...) & Exists(...) raise a TypeError
Here's a minimal example:
In [3]: Exists(Product.objects.all()) & Q()
Out[3]: <Q: (AN... |
Okay, let's tackle this issue. The user is saying that when they use Q() & Exists(...) in Django, it raises a TypeError, but Exists(...) & Q() works fine. The problem seems to be with the commutativity of the & operator between Q objects and Exists expressions.
Looking at the provided code, specifically in django/db/... |
--- a/django/db/models/query_utils.py
+++ b/django/db/models/query_utils.py
@@ -43,7 +43,7 @@ class Q(tree.Node):
if not isinstance(other, Q):
- raise TypeError(other)
+ other = Q(other)
# If the other Q() is empty, ignore it and just use `self`.
if not other:
... | false | 148 | Qwen3-32B | 16 | null | null | 3 | 13 |
django__django-13933 | A | unresolved | 9 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
ModelChoiceField does not provide value of invalid choice when raising ValidationError
Description
(last modified by Aaron Wiegel)
Compared with ChoiceField and others, ModelChoiceField does not show th... |
Okay, let's tackle this issue. The problem is that ModelChoiceField doesn't include the invalid value in its ValidationError message, unlike ChoiceField. The user wants to fix that by modifying the error message to include the value.
First, I need to look at the code provided. The issue mentions ModelChoiceField and ... | --- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -2005,1 +2005,1 @@
- 'invalid_choice': _('Select a valid choice. That choice is not one of the available choices.'),
+ 'invalid_choice': _('Select a valid choice. %(value)s is not one of the available choices.'),
| false | 18 | 11 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
ModelChoiceField does not provide value of invalid choice when raising ValidationError
Description
(last modified by Aaron Wiegel)
Compared with ChoiceField and others, ModelChoiceField does not show th... |
Okay, let's tackle this issue. The problem is that ModelChoiceField doesn't include the invalid value in its ValidationError message, unlike ChoiceField. The user wants to fix that by modifying the error message to include the value.
First, I need to look at the code provided. The issue mentions ModelChoiceField and ... | diff --git a/django/forms/fields.py b/django/forms/fields.py
--- a/django/forms/fields.py
+++ b/django/forms/fields.py
@@ -1230,8 +1230,8 @@ class ModelChoiceField(ChoiceField):
# actually use any of ChoiceField's implementation.
default_error_messages = {
'invalid_choice': _('Select a va... | false | 0 | Qwen3-32B | 16 | null | null | 9 | 11 |
scikit-learn__scikit-learn-13779 | A | resolved | 12 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Voting estimator will fail at fit if weights are passed and an estimator is None
Because we don't check for an estimator to be `None` in `sample_weight` support, `fit` is failing`.
```python
X, y = load... |
Okay, let's see. The issue is about the VotingClassifier failing when sample weights are passed and one of the estimators is set to None. The error is an AttributeError because the code tries to call fit on a None estimator.
Looking at the provided code in sklearn/ensemble/voting.py, specifically the fit method in th... |
--- a/sklearn/ensemble/voting.py
+++ b/sklearn/ensemble/voting.py
@@ -80,7 +80,7 @@ def fit(self, X, y, sample_weight=None):
for name, step in self.estimators:
- if not has_fit_parameter(step, 'sample_weight'):
+ if step is not None and not has_fit_parameter(step, 'sample_wei... | true | 20 | 4 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Voting estimator will fail at fit if weights are passed and an estimator is None
Because we don't check for an estimator to be `None` in `sample_weight` support, `fit` is failing`.
```python
X, y = load... |
Okay, let's see. The problem is that the VotingClassifier in scikit-learn is failing when sample weights are passed and one of the estimators is set to None. The user provided an example where after setting an estimator to None using set_params, calling fit with sample_weight raises an AttributeError because it tries ... |
--- a/sklearn/ensemble/voting.py
+++ b/sklearn/ensemble/voting.py
@@ def fit(self, X, y, sample_weight=None):
if sample_weight is not None:
- for name, step in self.estimators:
- if not has_fit_parameter(step, 'sample_weight'):
- raise ValueError('Underlying estimator \'%s\' does ... | false | 0 | Qwen3-32B | 16 | 12 | 4 | null | null |
django__django-12262 | B | unresolved | 13 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Custom template tags raise TemplateSyntaxError when keyword-only arguments with defaults are provided.
Description
(last modified by P-Seebauer)
When creating simple tags without variable keyword args, ... |
Okay, let's see. The user is reporting an issue with Django's custom template tags raising a TemplateSyntaxError when keyword-only arguments with defaults are provided. The problem seems to be in the parse_bits function in django/template/library.py.
First, I need to understand why the current code is causing this e... |
--- a/django/template/library.py
+++ b/django/template/library.py
@@ def parse_bits(parser, bits, params, varargs, varkw, defaults,
- if param not in params and param not in unhandled_kwargs and varkw is None:
+ if param not in params and param not in kwonly and varkw is None:
| false | 0 | 14 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Custom template tags raise TemplateSyntaxError when keyword-only arguments with defaults are provided.
Description
(last modified by P-Seebauer)
When creating simple tags without variable keyword args, ... |
Okay, let's see. The user is reporting an issue with Django's custom template tags raising a TemplateSyntaxError when keyword-only arguments with defaults are provided. The example given is a simple_tag with a keyword-only argument that has a default. When they try to call the tag with a keyword argument, it's throwin... |
--- a/django/template/library.py
+++ b/django/template/library.py
@@ def parse_bits(parser, bits, params, varargs, varkw, defaults,
@@ -265,7 +265,7 @@
if param not in params and param not in unhandled_kwargs and varkw is None:
# An unexpected keyword argument was supplied
... | false | 18 | Qwen3-32B | 16 | null | null | 14 | 13 |
scikit-learn__scikit-learn-13124 | B | unresolved | 7 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
sklearn.model_selection.StratifiedKFold either shuffling is wrong or documentation is misleading
<!--
If your issue is a usage question, submit it here instead:
- StackOverflow with the scikit-learn tag: http... |
Okay, let's tackle this issue. The user is saying that the shuffle parameter in StratifiedKFold is either implemented incorrectly or the documentation is misleading. They provided a code example where even when shuffle is True, the pairs like 1 and 11 remain together across different random states. The problem is that... |
--- a/sklearn/model_selection/_split.py
+++ b/sklearn/model_selection/_split.py
@@ def _iter_stratified_split(self, y, groups=None):
- for i in range(self.n_splits):
- indices = []
- for class_label in sorted(class_indices.keys()):
- class_data = class_indices[class_label]
-... | false | 0 | 8 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
sklearn.model_selection.StratifiedKFold either shuffling is wrong or documentation is misleading
<!--
If your issue is a usage question, submit it here instead:
- StackOverflow with the scikit-learn tag: http... |
Okay, let's tackle this issue. The user is saying that the shuffle parameter in StratifiedKFold is either implemented incorrectly or the documentation is wrong. The problem is that when shuffle is set to True, the samples within each stratum aren't being shuffled. Instead, the order of the batches is shuffled.
Looki... |
--- a/sklearn/model_selection/_split.py
+++ b/sklearn/model_selection/_split.py
@@ -1184,6 +1184,11 @@
class_indices = np.split(np.argsort(y_indices),
np.cumsum(class_counts[:-1]))
+ if self.shuffle:
+ for i in range(len(class_indices)):
+ c... | false | 60 | Qwen3-32B | 16 | null | null | 8 | 7 |
scikit-learn__scikit-learn-9288 | A | unresolved | 14 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
KMeans gives slightly different result for n_jobs=1 vs. n_jobs > 1
<!--
If your issue is a usage question, submit it here instead:
- StackOverflow with the scikit-learn tag: http://stackoverflow.com/questions... |
Okay, let's tackle this issue. The user is reporting that KMeans in scikit-learn gives slightly different results when using n_jobs=1 versus n_jobs>1. The example code shows that the inertia_ value differs between the single and parallel runs. The expected result is that the inertia should be the same regardless of th... | --- a/sklearn/cluster/k_means_.py
+++ b/sklearn/cluster/k_means_.py
@@ -1360,6 +1360,10 @@
if n_threads > 1:
results = Parallel(n_jobs=n_jobs, verbose=verbose,
**parallel_backend)(
+ delayed(_kmeans_single_euclidean)(X, sample_weight, ... | false | 123 | 12 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
KMeans gives slightly different result for n_jobs=1 vs. n_jobs > 1
<!--
If your issue is a usage question, submit it here instead:
- StackOverflow with the scikit-learn tag: http://stackoverflow.com/questions... |
Okay, let's tackle this issue. The user is reporting that KMeans gives slightly different results when using n_jobs=1 versus n_jobs>1. The example code shows that the inertia_ value changes, which indicates that the clustering results are not consistent between the different job counts. The expected result is that the... | --- a/sklearn/cluster/_kmeans.pyx
+++ b/sklearn/cluster/_kmeans.pyx
@@ def _kmeans_plus_plus(X, n_clusters, x_squared_norms, random_state, n_local_trials=None, return_norm=False):
- # Initialize centers list and centers array
- centers = np.empty((n_clusters, n_features), order='F', dtype=X.dtype)
- centers_in... | false | 0 | Qwen3-32B | 16 | null | null | 14 | 12 |
django__django-14725 | B | unresolved | 3 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Provide a way for model formsets to disallow new object creation
Description
Model formsets don't provide a way to create an "edit only" view of objects. We see users trying to use extra=0 to accomplish this,... |
Okay, I need to solve the issue where model formsets should disallow new object creation, making them "edit only". The current approach of using extra=0 isn't reliable because users can add forms via JavaScript or POST data.
First, I should look into how Django's formsets work. The BaseFormSet class in django/forms/... |
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -478,7 +478,8 @@ def formset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
can_delete=False, max_num=None, validate_max=False,
min_num=None, validate_min=False, absolute_max=None,
... | false | 0 | 2 | You will be provided with a partial code base and an issue statement explaining a problem to resolve.
<issue>
Provide a way for model formsets to disallow new object creation
Description
Model formsets don't provide a way to create an "edit only" view of objects. We see users trying to use extra=0 to accomplish this,... |
Okay, let's see. The issue is about model formsets not having a reliable way to disallow new object creation. Users try using extra=0, but that's not sufficient because JavaScript can add more forms or someone could send extra POST data. So the goal is to provide a proper way to make model formsets "edit only", preven... |
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -477,7 +477,8 @@ def formset_factory(form, formset=BaseFormSet, extra=1, can_order=False,
can_delete_extra=True, renderer=None):
"""Return a FormSet for the given form class."""
if min_num is None:
min_num = DEFAUL... | false | 64 | Qwen3-32B | 16 | null | null | 2 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.