instance_id
stringlengths
18
32
correct_response
stringclasses
2 values
pair_type
stringclasses
2 values
episode_a
int64
1
16
text_a
stringlengths
43.7k
61k
full_output_a
stringlengths
2.18k
33.4k
model_patch_a
stringlengths
128
1.41k
resolved_a
bool
2 classes
num_passed_tests_a
int64
0
776
episode_b
int64
1
16
text_b
stringlengths
43.7k
61k
full_output_b
stringlengths
2.47k
50.4k
model_patch_b
stringlengths
188
2.51k
resolved_b
bool
2 classes
num_passed_tests_b
int64
0
673
model_name
stringclasses
1 value
num_episodes_used
int64
16
16
success_episode
int64
1
15
⌀
failure_episode
int64
1
16
⌀
better_episode
int64
1
16
⌀
worse_episode
int64
1
16
⌀
sympy__sympy-23824
A
resolved
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> physics.hep.kahane_simplify() incorrectly reverses order of leading uncontracted gamma matrices The kahane_simplify() function applies [identities](https://en.wikipedia.org/w/index.php?title=Gamma_matrices&oldi...
Okay, let's tackle this problem. The user mentioned a bug in the kahane_simplify() function where the order of leading uncontracted gamma matrices is reversed. The example shows that when the contracted pairs are at the end, the leading gammas are kept in order, but when they're in the middle, the order of the leading...
--- a/sympy/physics/hep/gamma_matrices.py +++ b/sympy/physics/hep/gamma_matrices.py @@ -697,4 +697,4 @@ def kahane_simplify(expression): [ri.insert(0, free_pos[i]) for ri in resulting_indices] resulting_expr = S.Zero - for i in range(0, first_dum_pos): + for i in reversed(range(0, first_dum_pos))...
true
3
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> physics.hep.kahane_simplify() incorrectly reverses order of leading uncontracted gamma matrices The kahane_simplify() function applies [identities](https://en.wikipedia.org/w/index.php?title=Gamma_matrices&oldi...
Okay, let's see. The user mentioned that there's a bug in the kahane_simplify() function where the order of leading uncontracted gamma matrices is reversed. They provided an example where the order of GammaMatrix(rho) and GammaMatrix(sigma) gets swapped in the second test case. Looking at the code for kahane_simplif...
--- a/sympy/physics/hep/gamma_matrices.py +++ b/sympy/physics/hep/gamma_matrices.py @@ def kahane_simplify(expression): # If `first_dum_pos` is not zero, it means that there are trailing free gamma # matrices in front of `expression`, so multiply by them: - for i in range(0, first_dum_pos): - [ri.i...
false
0
Qwen3-32B
16
1
16
null
null
django__django-13112
A
unresolved
4
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> makemigrations crashes for ForeignKey with mixed-case app name. Description When i run "python3 manage.py migrate" on Django 3.1b1 shows me that error (Please, note that the code works well in 3.0) ValueError...
Okay, let's tackle this Django issue. The user is getting a ValueError when running makemigrations or migrate, specifically about the app 'dj_reglogin' not being installed, but their INSTALLED_APPS has 'DJ_RegLogin'. First, I remember that Django apps are case-sensitive, especially when it comes to app labels. The e...
--- a/DJ_RegLogin/__init__.py +++ b/DJ_RegLogin/__init__.py @@ -0,0 +1 @@ +default_app_config = 'DJ_RegLogin.DJ_RegLoginConfig'
false
63
11
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> makemigrations crashes for ForeignKey with mixed-case app name. Description When i run "python3 manage.py migrate" on Django 3.1b1 shows me that error (Please, note that the code works well in 3.0) ValueError...
Okay, let's try to figure out why the user is getting this error. The error message says that the field DJ_RegLogin.Content.category has a lazy reference to 'dj_reglogin.category', but the app 'dj_reglogin' isn't installed. Hmm. Wait, looking at their settings.py, they have 'DJ_RegLogin' in INSTALLED_APPS. But Django ...
--- a/DJ_RegLogin/apps.py +++ b/DJ_RegLogin/apps.py @@ -2,7 +2,7 @@ class DJ_RegLoginConfig(AppConfig): - name = 'DJ_RegLogin' + name = 'dj_reglogin' verbose_name = "Contents"
false
0
Qwen3-32B
16
null
null
4
11
sphinx-doc__sphinx-8475
A
unresolved
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Extend linkchecker GET fallback logic to handle Too Many Redirects Subject: linkcheck - fallback to GET requests when HEAD requests returns Too Many Redirects ### Feature or Bugfix - Bugfix ### Purpose...
Okay, let's see. The issue is about extending the linkchecker's GET fallback logic to handle "Too Many Redirects" errors. The problem is that when a HEAD request results in too many redirects, the linkchecker doesn't fall back to a GET request, causing valid links to be marked as broken. Looking at the provided code...
--- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -23,6 +23,7 @@ from docutils import nodes from docutils.nodes import Node from requests.exceptions import HTTPError +from requests.exceptions import TooManyRedirects from sphinx.application import Sphinx from sphinx.builders import Builder f...
false
17
4
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Extend linkchecker GET fallback logic to handle Too Many Redirects Subject: linkcheck - fallback to GET requests when HEAD requests returns Too Many Redirects ### Feature or Bugfix - Bugfix ### Purpose...
Okay, let's see. The user wants me to fix an issue in the Sphinx linkchecker where it doesn't handle Too Many Redirects errors when using HEAD requests. The problem is that when a HEAD request results in too many redirects, the linkchecker doesn't fall back to a GET request, causing valid links to be marked as broken....
--- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ def check_uri() -> Tuple[str, str, int]: - from requests.exceptions import HTTPError + from requests.exceptions import HTTPError, TooManyRedirects ... @@ -175,7 +175,7 @@ # retry with GET request if that fails, some serv...
false
0
Qwen3-32B
16
null
null
13
4
django__django-14999
B
unresolved
4
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> RenameModel with db_table should be a noop. Description A RenameModel operation that already has db_table defined must be a noop. In Postgres, it drops and recreates foreign key constraints. In sqlite it recr...
Okay, I need to figure out how to solve this issue where a RenameModel operation that already has a db_table defined should be a no-op. The problem is that in Postgres, it drops and recreates foreign key constraints, and in SQLite, it recreates the table. The user wants this to be a no-op. First, I should look into h...
--- a/django/contrib/gis/db/backends/spatialite/schema.py +++ b/django/contrib/gis/db/backends/spatialite/schema.py @@ -128,6 +128,8 @@ class SpatialiteSchemaEditor(DatabaseSchemaEditor): def alter_db_table(self, model, old_db_table, new_db_table, disable_constraints=True): + if old_db_table == new_db_table...
false
0
14
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> RenameModel with db_table should be a noop. Description A RenameModel operation that already has db_table defined must be a noop. In Postgres, it drops and recreates foreign key constraints. In sqlite it recr...
Okay, let's tackle this issue. The problem is that when using a RenameModel operation in Django migrations, if the model has a db_table explicitly defined, the rename should be a no-op. However, in Postgres, it's dropping and recreating foreign key constraints, and in SQLite, it's recreating the table. The user wants ...
--- a/django/contrib/gis/db/backends/spatialite/schema.py +++ b/django/contrib/gis/db/backends/spatialite/schema.py @@ -128,6 +128,8 @@ class SpatialiteSchemaEditor(DatabaseSchemaEditor): disable_constraints=True): from django.contrib.gis.db.models import GeometryField + if old_db_table == n...
false
113
Qwen3-32B
16
null
null
14
4
django__django-11790
A
resolved
14
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> AuthenticationForm's username field doesn't set maxlength HTML attribute. Description AuthenticationForm's username field doesn't render with maxlength HTML attribute anymore. Regression introduced in #27515 ...
Okay, let's tackle this problem. The issue is that the AuthenticationForm's username field isn't setting the maxlength HTML attribute anymore. The user mentioned that this regression was introduced in #27515 and a specific commit. First, I need to look at the code for AuthenticationForm. From the provided code in dj...
--- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ -194,6 +194,7 @@ class AuthenticationForm(forms.Form): self.username_field = UserModel._meta.get_field(UserModel.USERNAME_FIELD) self.fields['username'].max_length = self.username_field.max_length or 254 if self.fields[...
true
79
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> AuthenticationForm's username field doesn't set maxlength HTML attribute. Description AuthenticationForm's username field doesn't render with maxlength HTML attribute anymore. Regression introduced in #27515 ...
Okay, I need to fix the issue where the AuthenticationForm's username field isn't setting the maxlength HTML attribute. The problem was introduced in a previous commit, and I need to figure out how to address it. Looking at the provided code, specifically in django/contrib/auth/forms.py, the AuthenticationForm's user...
--- a/django/contrib/auth/forms.py +++ b/django/contrib/auth/forms.py @@ <1,70> <64,69> return { **super().widget_attrs(widget), 'autocapitalize': 'none', 'autocomplete': 'username', + 'maxlength': self.max_length, }
false
0
Qwen3-32B
16
14
1
null
null
sphinx-doc__sphinx-8721
B
resolved
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> viewcode creates pages for epub even if `viewcode_enable_epub=False` on `make html epub` **Describe the bug** viewcode creates pages for epub even if `viewcode_enable_epub=False` on `make html epub` **To Re...
Okay, let's see. The issue is that when someone runs `make html epub`, the viewcode extension is still creating pages for the EPUB even though `viewcode_enable_epub` is set to False. The user expects that module pages shouldn't be generated for EPUB by default. Looking at the code, I need to find where the viewcode e...
--- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ def collect_pages(app: Sphinx) -> Generator[Tuple[str, Dict[str, Any], str], None, None]: - env = app.builder.env - if not hasattr(env, '_viewcode_modules'): - return - highlighter = app.builder.highlighter # type: ignore - urito = a...
false
0
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> viewcode creates pages for epub even if `viewcode_enable_epub=False` on `make html epub` **Describe the bug** viewcode creates pages for epub even if `viewcode_enable_epub=False` on `make html epub` **To Re...
Okay, let's tackle this issue. The problem is that when someone runs `make html epub`, the viewcode extension is generating pages for the EPUB even though `viewcode_enable_epub` is set to False. The user expects that module pages shouldn't be created for EPUB by default. Looking at the provided code, the relevant par...
--- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -181,6 +181,9 @@ def collect_pages(app: Sphinx) -> Generator[Tuple[str, Dict[str, Any], str], None env = app.builder.env if not hasattr(env, '_viewcode_modules'): return + if not env.config.viewcode_enable_epub: + return + hi...
true
4
Qwen3-32B
16
3
16
null
null
django__django-10999
A
unresolved
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Fix parse_duration() for some negative durations Description The ​https://docs.djangoproject.com/en/2.1/_modules/django/utils/dateparse/ defines: standard_duration_re = re.compile( r'^' r'(?:(?P<days>-?\d+)...
Okay, let's tackle this problem. The user is pointing out an issue with the Django codebase's parse_duration function not correctly handling negative durations. The specific part of the regex in standard_duration_re is the problem. The issue is in the hours group's lookahead. Looking at the provided code in django/ut...
--- a/django/utils/dateparse.py +++ b/django/utils/dateparse.py @@ -33,7 +33,7 @@ standard_duration_re = re.compile( r'((?:(?P<hours>-?\d+):)(?=\d+:\d+))?' r'(?:(?P<minutes>-?\d+):)?' r'(?P<seconds>-?\d+)' - r'(?:\.(?P<microseconds>\d{1,6})\d{0,6})?' + r'(?:\.(?P<microseconds>\d{1,6})\d{0,6})?' ...
false
10
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Fix parse_duration() for some negative durations Description The ​https://docs.djangoproject.com/en/2.1/_modules/django/utils/dateparse/ defines: standard_duration_re = re.compile( r'^' r'(?:(?P<days>-?\d+)...
Okay, let's tackle this problem. The user mentioned an issue with the Django's parse_duration function not correctly handling negative durations. The problem is in the regular expression used for matching the standard duration format. Looking at the code in django/utils/dateparse.py, the standard_duration_re is defin...
--- a/django/utils/dateparse.py +++ b/django/utils/dateparse.py @@ -29,3 @@ standard_duration_re = re.compile( r'^' r'(?:(?P<days>-?\d+) (days?, )?)?' @@ -32,1 +32,1 @@ - r'((?:(?P<hours>-?\d+):)(?=\d+:\d+))?' + r'((?:(?P<hours>-?\d+):)(?=-?\d+:-?\d+))?' r'(?:(?P<minutes>-?\d+):)?'
false
0
Qwen3-32B
16
null
null
3
16
scikit-learn__scikit-learn-14983
A
unresolved
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> RepeatedKFold and RepeatedStratifiedKFold do not show correct __repr__ string #### Description `RepeatedKFold` and `RepeatedStratifiedKFold` do not show correct \_\_repr\_\_ string. #### Steps/Code to Rep...
Okay, let's tackle this issue. The user is saying that RepeatedKFold and RepeatedStratifiedKFold don't show the correct __repr__ string. When they run repr(RepeatedKFold()), instead of getting the parameters, they get the default object string with a memory address. The expected output is to have the parameters like n...
--- a/sklearn/utils/_pprint.py +++ b/sklearn/utils/_pprint.py @@ -65,6 +65,8 @@ from inspect import signature import pprint from collections import OrderedDict +from sklearn.model_selection import RepeatedKFold +from sklearn.model_selection import RepeatedStratifiedKFold from ..base import BaseEstimator from .._...
false
105
9
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> RepeatedKFold and RepeatedStratifiedKFold do not show correct __repr__ string #### Description `RepeatedKFold` and `RepeatedStratifiedKFold` do not show correct \_\_repr\_\_ string. #### Steps/Code to Rep...
Okay, let's tackle this issue. The user is saying that RepeatedKFold and RepeatedStratifiedKFold don't show the correct __repr__ string. When they call repr() on those objects, they get the default object representation instead of showing their parameters. Looking at the provided code, the __repr__ for scikit-learn e...
--- a/sklearn/utils/_pprint.py +++ b/sklearn/utils/_pprint.py @@ def _safe_repr(object, context, maxlevels, level, changed_only=False): if issubclass(typ, BaseEstimator): + if hasattr(object, 'get_params'): + objid = id(object) - objid = id(object) if maxlevels and level >= maxle...
false
0
Qwen3-32B
16
null
null
15
9
pytest-dev__pytest-6197
A
unresolved
12
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Regression in 5.2.3: pytest tries to collect random __init__.py files This was caught by our build server this morning. It seems that pytest 5.2.3 tries to import any `__init__.py` file under the current direc...
Okay, let's try to figure out how to fix this issue with pytest 5.2.3 collecting random __init__.py files. The user provided a minimal example where creating a directory with an __init__.py that has an assert False causes pytest 5.2.3 to fail, but not 5.2.2. The problem is that pytest is importing these __init__.py fi...
--- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ -575,6 +575,10 @@ if handle_dupes: keepduplicates = self.config.getoption("keepduplicates") if not keepduplicates: + # Skip __init__.py if it's part of a package to avoid double collection + if path.b...
false
142
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Regression in 5.2.3: pytest tries to collect random __init__.py files This was caught by our build server this morning. It seems that pytest 5.2.3 tries to import any `__init__.py` file under the current direc...
Okay, let's tackle this issue. The user is reporting a regression in pytest 5.2.3 where it's trying to collect random __init__.py files, causing problems on Linux when those files can't be imported. The example shows that with pytest 5.2.3, an __init__.py file in a directory (foobar) is being collected as a test, lead...
--- a/src/_pytest/main.py +++ b/src/_pytest/main.py @@ def _collect(self, arg): - if argpath.basename == "__init__.py": - try: - yield next(m[0].collect()) - except StopIteration: - # The package collects nothing with only an __init__.py - # fil...
false
0
Qwen3-32B
16
null
null
12
10
django__django-11603
A
resolved
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Add DISTINCT support for Avg and Sum aggregates. Description As an extension of #28658, aggregates should be supported for other general aggregates such as Avg and Sum. Before 2.2, these aggregations just ign...
Okay, let's tackle this issue. The user wants to add DISTINCT support for Avg and Sum aggregates in Django. The problem statement mentions that before version 2.2, these aggregations ignored the DISTINCT parameter, but now they throw an exception. The solution is to allow these aggregates to use DISTINCT by setting th...
--- a/django/db/models/aggregates.py +++ b/django/db/models/aggregates.py @@ -99,6 +99,7 @@ class Avg(FixDurationInputMixin, NumericOutputFieldMixin, Aggregate): function = 'AVG' name = 'Avg' + allow_distinct = True def __init__(self, expression, **extra): super().__init__(expression, **ex...
true
60
8
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Add DISTINCT support for Avg and Sum aggregates. Description As an extension of #28658, aggregates should be supported for other general aggregates such as Avg and Sum. Before 2.2, these aggregations just ign...
Okay, let's tackle this issue. The user wants to add DISTINCT support for Avg and Sum aggregates in Django, as an extension of a previous issue. From the code provided, I need to look into the relevant files. First, I remember that in Django's aggregate functions, the ability to use DISTINCT is controlled by the `all...
--- a/django/db/models/aggregates.py +++ b/django/db/models/aggregates.py @@ def __init__(self, *expressions, distinct=False, filter=None, **extra): if distinct and not self.allow_distinct: raise TypeError("%s does not allow distinct." % self.__class__.__name__) self.distinct = distinct self.fi...
false
0
Qwen3-32B
16
15
8
null
null
django__django-14672
B
resolved
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Missing call `make_hashable` on `through_fields` in `ManyToManyRel` Description In 3.2 identity property has been added to all ForeignObjectRel to make it possible to compare them. A hash is derived from said...
Okay, I need to solve this issue where the ManyToManyRel class in Django is missing a call to make_hashable on the through_fields attribute. The problem arises because through_fields can be a list, and when the identity tuple is created for hashing, it includes this list, which isn't hashable. The error occurs during ...
--- a/django/db/models/fields/related.py +++ b/django/db/models/fields/related.py @@ def __init__(self, to, **kwargs): self.to = to self.related_name = kwargs.get('related_name') self.limit_choices_to = kwargs.get('limit_choices_to', {}) + from django.db.models import make_hashable self.through_...
false
0
14
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Missing call `make_hashable` on `through_fields` in `ManyToManyRel` Description In 3.2 identity property has been added to all ForeignObjectRel to make it possible to compare them. A hash is derived from said...
Okay, let's tackle this issue. The user is pointing out that in Django's ManyToManyRel, the through_fields are not being made hashable, which is causing a TypeError when a proxy model is checked. The error occurs because through_fields can be a list, and when the identity tuple is created, it includes this list, which...
--- a/django/db/models/fields/reverse_related.py +++ b/django/db/models/fields/reverse_related.py @@ -1,5 +1,6 @@ from django.db import models from django.db.models.fields import ForeignObjectRel +from django.db.models.fields import make_hashable class ManyToManyRel(ForeignObjectRel): @@ -45,7 +46,7 @@ class Ma...
true
168
Qwen3-32B
16
14
1
null
null
django__django-14404
B
unresolved
8
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> catch_all_view() does not support FORCE_SCRIPT_NAME. Description (last modified by SlavaSkvortsov) catch_all_view returns redirect to '%s/' % request.path_info (script name cut off there) instead of '%s...
Okay, I need to fix the issue where catch_all_view doesn't support FORCE_SCRIPT_NAME. The problem is that it redirects to '%s/' % request.path_info instead of using request.path, which includes the script name. First, I should look for where catch_all_view is implemented. But wait, in the provided code, I don't see ...
--- a/django/middleware/locale.py +++ b/django/middleware/locale.py @@ def process_response(self, request, response): - language_url = request.get_full_path(force_append_slash=path_needs_slash).replace( - script_prefix, - '%s%s/' % (script_prefix, language), - ...
false
0
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> catch_all_view() does not support FORCE_SCRIPT_NAME. Description (last modified by SlavaSkvortsov) catch_all_view returns redirect to '%s/' % request.path_info (script name cut off there) instead of '%s...
Okay, let's tackle this issue. The problem is about the catch_all_view not supporting FORCE_SCRIPT_NAME correctly. The user mentioned that catch_all_view returns a redirect to '%s/' % request.path_info instead of using request.path, which includes the script name. First, I need to find where catch_all_view is impleme...
--- a/django/middleware/locale.py +++ b/django/middleware/locale.py @@ -51,8 +51,8 @@ if (response.status_code == 404 and not language_from_path and i18n_patterns_used and prefixed_default_language): # Maybe the language code is missing in the URL? Try adding the - # la...
false
323
Qwen3-32B
16
null
null
13
8
astropy__astropy-13236
A
unresolved
8
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Consider removing auto-transform of structured column into NdarrayMixin <!-- This comments are hidden when you submit the issue, so you do not need to remove them! --> <!-- Please be sure to check out our c...
Okay, let's tackle this issue. The user wants to modify the Astropy code to remove the auto-transformation of structured numpy arrays into NdarrayMixin when adding them to a Table. The plan is to add a FutureWarning suggesting users wrap data in a Column and then in version 5.2, remove that code. First, I need to fin...
--- a/astropy/table/column.py +++ b/astropy/table/column.py @@ -123,6 +123,9 @@ # Structured ndarray gets viewed as a mixin unless already a valid # mixin class if (not isinstance(data, Column) and not data_is_mixin + and isinstance(data, np.ndarray) and len(data.dtype) > 1): + ...
false
644
2
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Consider removing auto-transform of structured column into NdarrayMixin <!-- This comments are hidden when you submit the issue, so you do not need to remove them! --> <!-- Please be sure to check out our c...
Okay, let's tackle this issue. The user wants to modify the behavior of how structured numpy arrays are handled when added to an Astropy Table. Specifically, they want to remove the auto-transformation into NdarrayMixin, which currently happens in certain code. The plan is to add a FutureWarning suggesting users wrap ...
--- a/astropy/table/column.py +++ b/astropy/table/column.py @@ def _process_data(data, data_is_mixin): - if (not isinstance(data, Column) and not data_is_mixin - and isinstance(data, np.ndarray) and len(data.dtype) > 1): - data = data.view(NdarrayMixin) - data_is_mixin = True + if (not is...
false
0
Qwen3-32B
16
null
null
8
2
django__django-12304
B
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Enumeration Types are not usable in templates. Description (last modified by Mariusz Felisiak) The new ​enumeration types are great but can't be used in Django templates due to their being callable. For...
Okay, let's see. The issue is that Django's new enumeration types (Choices) can't be used in templates because they're callable. When you try to do something like {% if student.year_in_school == YearInSchool.FRESHMAN %}, Django calls the YearInSchool class because it's a callable, but that fails because the class prob...
--- a/django/db/models/choices.py +++ b/django/db/models/choices.py @@ -1,6 +1,7 @@ from django.utils.functional import classproperty from django.utils.text import capfirst from django.utils.translation import gettext_lazy as _ +from django.utils.deprecation import deprecation_removed_in_4_2 class Choices: @@ -...
false
0
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Enumeration Types are not usable in templates. Description (last modified by Mariusz Felisiak) The new ​enumeration types are great but can't be used in Django templates due to their being callable. For...
Okay, I need to solve this Django issue where enumeration types (Choices) can't be used in templates because they're callable. The problem is that when you do something like {% if student.year_in_school == YearInSchool.FRESHMAN %}, Django's template engine tries to call the YearInSchool class since it's a callable, le...
--- a/django/db/models/enums.py +++ b/django/db/models/enums.py @@ -1,6 +1,7 @@ from enum import Enum from django.utils.translation import gettext_lazy as _ +do_not_call_in_templates = True class TextChoices(str, Enum): def _generate_next_value_(name, start, count, last_values): return name.lower()
false
17
Qwen3-32B
16
null
null
13
10
sympy__sympy-16597
A
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> a.is_even does not imply a.is_finite I'm not sure what the right answer is here: ```julia In [1]: m = Symbol('m', even=True) ...
Okay, let's see. The user is pointing out that in SymPy, when you create a symbol with the 'even=True' property, checking 'is_finite' returns None, which they think is incorrect. They expect that an even number should be finite first. Looking at the code, specifically in the Equality class's __new__ method. There's a...
--- a/sympy/core/symbol.py +++ b/sympy/core/symbol.py @@ -123,6 +123,9 @@ def __new__(cls, name, **assumptions): if 'even' in assumptions: # Handle even assumption if 'odd' in assumptions: # Handle odd assumption + if assumptions.get('even') is not None or assumptions....
false
74
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> a.is_even does not imply a.is_finite I'm not sure what the right answer is here: ```julia In [1]: m = Symbol('m', even=True) ...
Okay, let's tackle this issue. The user is pointing out that in SymPy, when a symbol is declared as even (like m = Symbol('m', even=True)), checking m.is_finite returns None. They expect that if a number is even, it should be finite first. But in reality, being even doesn't necessarily imply finiteness. For example, i...
--- a/sympy/core/assumptions.py +++ b/sympy/core/assumptions.py @@ def _ask_finite(self, expr, assumptions): - return ask(expr, 'real', assumptions) + if ask(expr, 'even', assumptions): + return True + return ask(expr, 'real', assumptions)
false
0
Qwen3-32B
16
null
null
10
1
django__django-16569
B
resolved
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Formsets' add_fields() method fails in some circumstances if the argument index is None. Description Formsets' add_fields() method fails in some circumstances if the argument index is None. When a FormSet has...
Okay, let's tackle this issue. The problem is that when using a formset with can_delete=True and can_delete_extra=False, calling add_fields() with index=None (like when creating an empty_form) raises a TypeError because it compares index (None) with initial_form_count (an integer). Looking at the code in django/forms...
--- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -490,7 +490,7 @@ required=False, widget=self.get_ordering_widget(), ) - if self.can_delete and (self.can_delete_extra or index < initial_form_count): + if self.can_delete and (self.can_delete_extra or (index is no...
false
0
11
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Formsets' add_fields() method fails in some circumstances if the argument index is None. Description Formsets' add_fields() method fails in some circumstances if the argument index is None. When a FormSet has...
Okay, let's see. The user is reporting an issue with Django's formsets where the add_fields() method fails when the index is None. The problem occurs when can_delete is True and can_delete_extra is False. The example given uses my_formset.empty_form, which triggers the error. Looking at the code in django/forms/forms...
--- a/django/forms/formsets.py +++ b/django/forms/formsets.py @@ -493,7 +493,7 @@ def add_fields(self, form, index): # Only pre-fill the ordering field for initial forms. if index is not None and index < initial_form_count: form.fields[ORDERING_FIELD_NAME] = IntegerField( - ...
true
113
Qwen3-32B
16
11
3
null
null
scikit-learn__scikit-learn-12973
B
unresolved
5
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> LassoLarsIC: unintuitive copy_X behaviour Hi, I would like to report what seems to be a bug in the treatment of the `copy_X` parameter of the `LassoLarsIC` class. Because it's a simple bug, it's much easier to ...
Okay, I need to fix the issue with the LassoLarsIC's copy_X parameter. The problem is that there's a copy_X parameter both in the class initialization and in the fit method. When someone initializes the estimator with copy_X=False and then calls fit(), the fit method's default value of True overrides it, which is not ...
--- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ def fit(self, X, y, copy_X=None): - def fit(self, X, y): - X = check_array(X, accept_sparse='csc', copy=copy_X) + def fit(self, X, y, copy_X=None): + if copy_X is None: + copy_X = self.copy_X + ...
false
0
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> LassoLarsIC: unintuitive copy_X behaviour Hi, I would like to report what seems to be a bug in the treatment of the `copy_X` parameter of the `LassoLarsIC` class. Because it's a simple bug, it's much easier to ...
Okay, let's tackle this issue. The user is pointing out a problem with the LassoLarsIC class in scikit-learn where the copy_X parameter is defined both in the class and in the fit method. The problem is that when someone initializes the class with copy_X=False and then calls fit(), the fit method's default value of Tr...
--- a/sklearn/linear_model/least_angle.py +++ b/sklearn/linear_model/least_angle.py @@ -1495,7 +1495,7 @@ dtype=np.float64, order="F", copy=False ) - def fit(self, X, y, copy_X=True): + def fit(self, X, y, copy_X=None): """Fit the model using X, y as training data. Parameters ...
false
32
Qwen3-32B
16
null
null
13
5
django__django-14534
A
unresolved
7
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> BoundWidget.id_for_label ignores id set by ChoiceWidget.options Description If you look at the implementation of BoundField.subwidgets class BoundField: ... def subwidgets(self): id_ = self.field.widget.a...
Okay, let's tackle this issue. The problem is that when using CheckboxSelectMultiple, the BoundWidget's id_for_label method isn't using the id from the attrs, which leads to incorrect label IDs. First, I need to look at the code provided. The BoundWidget's id_for_label is currently generating an ID based on name and ...
--- a/django/forms/boundfield.py +++ b/django/forms/boundfield.py @@ -281,4 +281,4 @@ def id_for_label(self): - return 'id_%s_%s' % (self.data['name'], self.data['index']) + return self.data['attrs']['id']
false
119
2
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> BoundWidget.id_for_label ignores id set by ChoiceWidget.options Description If you look at the implementation of BoundField.subwidgets class BoundField: ... def subwidgets(self): id_ = self.field.widget.a...
Okay, let's tackle this issue. The problem is about the BoundWidget's id_for_label method not using the id set by the widget's attributes. The user says that when using CheckboxSelectMultiple, the generated ID for labels isn't respecting the auto_id or attrs['id'] set on the widget. Looking at the code, the BoundFiel...
--- a/django/forms/boundfield.py +++ b/django/forms/boundfield.py @@ -280,2 +280,3 @@ - def id_for_label(self): - return 'id_%s_%s' % (self.data['name'], self.data['index']) + def id_for_label(self): + return self.data['attrs']['id']
false
0
Qwen3-32B
16
null
null
7
2
django__django-13516
B
resolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> flush() on self.stdout/stderr management commands doesn't work. Description flush() is notably called during migrate command; it doesn't work, and a long migration effectively prints to stderr no relevant inf...
Okay, let's tackle this problem. The user is reporting that when using the `flush()` method on `self.stdout` or `self.stderr` in Django management commands, it's not working as expected. Specifically, during the `migrate` command, output isn't being displayed until the end, which is not the desired behavior. The expec...
--- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -146,6 +146,10 @@ style_func = style_func or self.style_func self._out.write(style_func(msg)) + # Ensure output is flushed if no newline is present + if self.ending != '\n': + self._out.flush() + ...
false
43
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> flush() on self.stdout/stderr management commands doesn't work. Description flush() is notably called during migrate command; it doesn't work, and a long migration effectively prints to stderr no relevant inf...
Okay, let's tackle this issue. The user is saying that when they run the migrate command, the flush() on stdout/stderr isn't working. The problem is that during a long migration, nothing is printed until the end. For example, the output is all the migration steps at once at the end instead of line by line. The expecte...
--- a/django/core/management/base.py +++ b/django/core/management/base.py @@ -146,6 +146,8 @@ class OutputWrapper(TextIOBase): style_func = style_func or self.style_func self._out.write(style_func(msg)) + # Ensure output is immediately flushed to the stream + self._out.flush() def...
true
44
Qwen3-32B
16
13
10
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
sympy__sympy-20590
A
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Symbol instances have __dict__ since 1.7? In version 1.6.2 Symbol instances had no `__dict__` attribute ```python >>> sympy.Symbol('s').__dict__ --------------------------------------------------------------...
Okay, let's tackle this issue. The user is saying that in SymPy version 1.6.2, Symbol instances didn't have a __dict__ attribute, but starting from 1.7 they do. They think this might be a bug because of how __slots__ works. First, I need to figure out where in the codebase the Symbol class is defined. The provided c...
--- a/sympy/core/symbol.py +++ b/sympy/core/symbol.py @@ -10,6 +10,7 @@ class Symbol(Basic): def __new__(cls, name, **assumptions): return Basic.__new__(cls, name, **assumptions) + __slots__ = ('name',)
false
21
12
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Symbol instances have __dict__ since 1.7? In version 1.6.2 Symbol instances had no `__dict__` attribute ```python >>> sympy.Symbol('s').__dict__ --------------------------------------------------------------...
Okay, let's tackle this issue. The user is saying that in SymPy version 1.6.2, Symbol instances didn't have a __dict__ attribute. But starting from version 1.7, they do. The problem is that this change might be unintended, possibly due to a parent class accidentally stopping the use of __slots__, leading to the appear...
--- a/sympy/core/symbol.py +++ b/sympy/core/symbol.py @@ -10,6 +10,7 @@ class Symbol(with_metaclass(Singleton, Basic)): return super(Symbol, cls).__new__(cls, name, **assumptions) def __init__(self, name, **assumptions): + __slots__ = ('name',) pass
false
0
Qwen3-32B
16
null
null
10
12
pylint-dev__pylint-4970
A
unresolved
2
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Setting `min-similarity-lines` to `0` should stop pylint from checking duplicate code ### Current problem Setting `min-similarity-lines` to `0` in the rcfile doesn't disable checking for duplicate code, it ins...
Okay, let's tackle this issue. The user wants that setting `min-similarity-lines` to 0 in Pylint disables the duplicate code check entirely. Right now, setting it to 0 causes every line to be treated as a duplicate, which is not the intended behavior. Looking at the code, the problem is in the `similar.py` file. The ...
--- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -832,6 +832,8 @@ def close(self): """compute and display similarities on closing (i.e. end of parsing)""" total = sum(len(lineset) for lineset in self.linesets) + if self.min_lines <= 0: + return dupli...
false
17
5
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Setting `min-similarity-lines` to `0` should stop pylint from checking duplicate code ### Current problem Setting `min-similarity-lines` to `0` in the rcfile doesn't disable checking for duplicate code, it ins...
Okay, let's see. The user is saying that when they set min-similarity-lines to 0 in their pylint rcfile, it's not disabling the duplicate code check. Instead, it's treating every line as a duplicate and raising errors. They want setting this value to 0 to disable the check entirely, similar to how flake8 works with so...
--- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ def open(self): """init the checkers: reset linesets and statistics information""" self.linesets = [] self.stats = self.linter.add_stats( nb_duplicated_lines=0, percent_duplicated_lines=0 ) + # Disable the checker if mi...
false
0
Qwen3-32B
16
null
null
2
5
sphinx-doc__sphinx-8459
A
unresolved
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> autodoc_type_aliases doesn't work when autodoc_typehints is set to "description" **Describe the bug** autodoc_type_aliases doesn't work when autodoc_typehints is set to "description". **To Reproduce** ty...
Okay, I need to figure out why autodoc_type_aliases isn't working when autodoc_typehints is set to "description" in Sphinx. Let me look through the provided code and the issue description. The user says that when they set autodoc_typehints = 'description', the type aliases (like JSONObject) aren't being replaced with...
--- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -531,7 +531,7 @@ return inspect.Signature(parameters, return_annotation=return_annotation, # type: ignore __validate_parameters__=False) -def stringify_signature(sig: inspect.Signature, show_annotation: bool = True...
false
17
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> autodoc_type_aliases doesn't work when autodoc_typehints is set to "description" **Describe the bug** autodoc_type_aliases doesn't work when autodoc_typehints is set to "description". **To Reproduce** ty...
Okay, I need to figure out why autodoc_type_aliases isn't working when autodoc_typehints is set to "description" in Sphinx. Let me start by understanding the problem. The user provided a minimal example where they define a type alias JSONObject as Dict[str, Any]. They want this alias to be used in the documentation, ...
--- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -1616,7 +1616,7 @@ class FunctionDocumenter(AllMembersDocumenter): # Get type hints if (self.options.autodoc_typehints == 'description' or self.options.autodoc_typehints == 'both'): - self.annotations = typing.get_type_...
false
0
Qwen3-32B
16
null
null
13
10
sphinx-doc__sphinx-8269
B
resolved
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Linkcheck should report HTTP errors instead of Anchor not found **Describe the bug** The `linkcheck` command always reports that it was unable to find the anchor when [`linkcheck_anchors`](https://www.sphinx-d...
Okay, let's tackle this issue. The problem is that when using linkcheck with anchors enabled, it's reporting "Anchor not found" even when the server returns a 404. The user wants the actual HTTP error to be shown instead. Looking at the provided code, specifically the linkcheck.py file. The CheckExternalLinksBuilder'...
--- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ def check_uri() -> Tuple[str, str, int]: - found = check_anchor(response, unquote(anchor)) + response.raise_for_status() + found = check_anchor(response, unquote(anchor))
false
0
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Linkcheck should report HTTP errors instead of Anchor not found **Describe the bug** The `linkcheck` command always reports that it was unable to find the anchor when [`linkcheck_anchors`](https://www.sphinx-d...
Okay, let's tackle this issue. The user says that when linkcheck_anchors is True, the linkcheck builder reports "Anchor not found" even when the server returns a 404. But they want it to show the actual HTTP error like when linkcheck_anchors is False. Looking at the code in linkcheck.py, specifically the CheckExterna...
--- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -167,6 +167,7 @@ def check_uri() -> Tuple[str, str, int]: auth=auth_info, **kwargs) found = check_anchor(response, unquote(anchor)) + response.raise_for_statu...
true
6
Qwen3-32B
16
1
3
null
null
sympy__sympy-20428
B
unresolved
11
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Result from clear_denoms() prints like zero poly but behaves wierdly (due to unstripped DMP) The was the immediate cause of the ZeroDivisionError in #17990. Calling `clear_denoms()` on a complicated constant...
Okay, let's see. The issue is about a problem in the clear_denoms() function where it returns a polynomial that prints as zero but isn't actually recognized as such, leading to inconsistencies and errors in other functions. The root cause seems to be an unstripped leading zero in the DMP (Dense Multivariate Polynomial...
--- a/sympy/polys/densetools.py +++ b/sympy/polys/densetools.py @@ def dup_strip(f): - if not f: - return [] - if f[-1].is_zero: - raise ValueError("tail of polynomial is zero") - return [c for c in f if not c.is_zero] + if not f: + return [] + if all(c.is_zero for c in f): + ...
false
0
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Result from clear_denoms() prints like zero poly but behaves wierdly (due to unstripped DMP) The was the immediate cause of the ZeroDivisionError in #17990. Calling `clear_denoms()` on a complicated constant...
Okay, let's tackle this problem. The issue is about the `clear_denoms()` function in SymPy returning a polynomial that appears as zero but isn't properly recognized as such, leading to inconsistencies and errors. The root cause is that the underlying DMP (Dense Multivariate Polynomial) representation has a leading zer...
--- a/sympy/polys/polyclasses.py +++ b/sympy/polys/polyclasses.py @@ -398,6 +398,7 @@ class DMP(object): self.lev = lev self.dom = dom self.rep = rep + self.strip() def __getnewargs__(self): return (self.rep, self.dom, self.lev)
false
154
Qwen3-32B
16
null
null
15
11
django__django-14752
A
resolved
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Refactor AutocompleteJsonView to support extra fields in autocomplete response Description (last modified by mrts) Adding data attributes to items in ordinary non-autocomplete foreign key fields that us...
Okay, let's see. The user wants to refactor the AutocompleteJsonView to support extra fields in the autocomplete response. The main issue is that currently, if someone wants to add extra fields, they have to override the entire get() method, which is not maintainable when the original code changes. The proposed solut...
--- a/django/contrib/admin/views/autocomplete.py +++ b/django/contrib/admin/views/autocomplete.py @@ -7,6 +7,12 @@ class AutocompleteJsonView(BaseListView): paginate_by = 20 admin_site = None + def serialize_result(self, obj, to_field_name): + """ + Serialize an object to a dictionary for th...
true
16
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Refactor AutocompleteJsonView to support extra fields in autocomplete response Description (last modified by mrts) Adding data attributes to items in ordinary non-autocomplete foreign key fields that us...
Okay, let's see. The user wants to refactor the AutocompleteJsonView in Django to support adding extra fields in the autocomplete response. The main idea is to extract the part where the results are built into a separate method called serialize_result, so that subclasses can override it easily without having to duplic...
--- a/django/contrib/admin/views/autocomplete.py +++ b/django/contrib/admin/views/autocomplete.py @@ def get(self, request, *args, **kwargs): """ Return a JsonResponse with search results of the form: { results: [{id: "123" text: "foo"}], pagination: {more: true} } """ se...
false
0
Qwen3-32B
16
15
1
null
null
matplotlib__matplotlib-20826
B
unresolved
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> ax.clear() adds extra ticks, un-hides shared-axis tick labels ### Bug report **Bug summary** When using shared axes (e.g. from `plt.subplots(2, 2, sharex=True, sharey=True)`), calling `ax.clear()` causes ...
Okay, let's tackle this issue. The user is saying that when using shared axes with subplots in Matplotlib and calling ax.clear(), it causes extra ticks and tick labels to appear that should be hidden. This problem started in version 3.4.2 and didn't happen in 3.4.1. The example code uses subplots with shared x and y a...
--- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -1384,6 +1384,7 @@ def clear(self): self.set_ylabel('') self.set_zlabel('') + self._process_shared_axes() # Clear the image list. self.images = [] # Clear the contour lists.
false
0
2
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> ax.clear() adds extra ticks, un-hides shared-axis tick labels ### Bug report **Bug summary** When using shared axes (e.g. from `plt.subplots(2, 2, sharex=True, sharey=True)`), calling `ax.clear()` causes ...
Okay, I need to figure out how to fix this issue with Matplotlib where using ax.clear() on shared axes in version 3.4.2 causes extra ticks and un-hides labels that should be hidden. The user provided a minimal example that works in 3.4.1 but breaks in 3.4.2. First, I should look into the Matplotlib codebase to see w...
--- a/lib/matplotlib/axis.py +++ b/lib/matplotlib/axis.py @@ -1032,6 +1032,7 @@ def clear(self): self._major_tick_line_kw = None self._minor_tick_line_kw = None self._major_ticklabel_kw = None + self.label.set_visible(False) self._update_label_position() self.offsetTe...
false
673
Qwen3-32B
16
null
null
2
3
astropy__astropy-14365
A
unresolved
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> ascii.qdp Table format assumes QDP commands are upper case ### Description ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself ...
Okay, let's tackle this issue. The problem is that the ascii.qdp reader in Astropy expects QDP commands to be in uppercase, but the user wants it to be case-insensitive. The example given is that "read serr 1 2" is not recognized, leading to an error, whereas QDP itself is case-insensitive. Looking at the code in ast...
--- a/astropy/io/ascii/qdp.py +++ b/astropy/io/ascii/qdp.py @@ -64,7 +64,7 @@ _command_re = r"READ [TS]ERR(\s+[0-9]+)+" _new_re = rf"NO({sep}NO)+" _data_re = rf"({_decimal_re}|NO|[-+]?nan)({sep}({_decimal_re}|NO|[-+]?nan))*)" - _type_re = rf"^\s*((?P<command>{_command_re})|(?P<new>{_new_re})|(?P<data...
false
8
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> ascii.qdp Table format assumes QDP commands are upper case ### Description ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself ...
Okay, I need to fix the issue where the ascii.qdp reader in Astropy is expecting QDP commands to be in uppercase, but the user wants it to be case-insensitive. The problem is that the current code checks for commands like "READ SERR" which must be uppercase, but QDP itself is case-insensitive. Looking at the code in ...
--- a/astropy/io/ascii/qdp.py +++ b/astropy/io/ascii/qdp.py @@ def _line_type(line, delimiter=None): - _command_re = r"READ [TS]ERR(\s+[0-9]+)+" + _command_re = r"(?i)READ [TS]ERR(\s+[0-9]+)+"
false
0
Qwen3-32B
16
null
null
15
13
django__django-14376
B
unresolved
5
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> MySQL backend uses deprecated "db" and "passwd" kwargs. Description The "db" and "passwd" usage can be seen at ​https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/db/backend...
Okay, let's tackle this issue. The problem is that Django's MySQL backend is using deprecated keyword arguments "db" and "passwd" when connecting to the database. The mysqlclient library has moved to "database" and "password" instead. The user wants a patch to fix this in the codebase. First, I need to find where the...
--- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -202,8 +202,8 @@ def get_connection_params(self): kwargs = { 'conv': django_conversions, 'charset': 'utf8', } settings_dict = self.settings_dict if settings_dict['USER']: ...
false
0
9
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> MySQL backend uses deprecated "db" and "passwd" kwargs. Description The "db" and "passwd" usage can be seen at ​https://github.com/django/django/blob/ca9872905559026af82000e46cde6f7dedc897b6/django/db/backend...
Okay, let's tackle this issue. The problem is that Django's MySQL backend is using deprecated keyword arguments "db" and "passwd" when connecting to the database. The user mentioned that mysqlclient has marked these as deprecated in favor of "database" and "password". The task is to update the code to use the new keyw...
--- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -203,7 +203,7 @@ kwargs = { 'conv': django_conversions, 'charset': 'utf8', - } + } settings_dict = self.settings_dict if settings_dict['USER']: kwargs['user'...
false
6
Qwen3-32B
16
null
null
9
5
django__django-12741
A
unresolved
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Simplify signature of `DatabaseOperations.execute_sql_flush()` Description The current signature is: def execute_sql_flush(self, using, sql_list): The using argument can be dropped and inferred by the calling...
Okay, let's see. The issue is to simplify the signature of the `execute_sql_flush` method in Django's `DatabaseOperations` class. The current method has two arguments: `self`, `using`, and `sql_list`. But the problem says that the `using` argument can be dropped because it can be inferred from `self.connection.alias`....
--- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ def execute_sql_flush(self, using, sql_list): + def execute_sql_flush(self, sql_list): """Execute a list of SQL statements to flush the database.""" - with transaction.atomic(using=using, savepoint=self.connec...
false
64
6
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Simplify signature of `DatabaseOperations.execute_sql_flush()` Description The current signature is: def execute_sql_flush(self, using, sql_list): The using argument can be dropped and inferred by the calling...
Okay, let's tackle this issue. The user wants to simplify the signature of the `execute_sql_flush` method in Django's `DatabaseOperations` class. The current method has parameters `self`, `using`, and `sql_list`, but the `using` argument is supposed to be removed because it can be inferred from `self.connection.alias`...
--- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -403,7 +403,7 @@ def execute_sql_flush(self, using, sql_list): """Execute a list of SQL statements to flush the database.""" with transaction.atomic(using=using, savepoint=self.connection.features.can_rollback_...
false
0
Qwen3-32B
16
null
null
16
6
django__django-16082
B
unresolved
11
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Resolve output_field when combining numeric expressions with MOD operator. Description When writing a Django expression for a query that does MOD, if the types of the query are different (Decimal and Integer)...
Okay, let's tackle this Django issue. The problem is about the MOD operator not correctly resolving the output type when combining Decimal and Integer expressions. The user says that other mathematical operators handle this, but MOD doesn't. First, I need to figure out where in the code the MOD operation is handled....
--- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ def combine_expression(self, connector, sub_expressions): - conn = " %s " % connector - return conn.join(sub_expressions) + if connector == '%': + # Ensure the result of MOD is cast to a Decimal i...
false
0
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Resolve output_field when combining numeric expressions with MOD operator. Description When writing a Django expression for a query that does MOD, if the types of the query are different (Decimal and Integer)...
Okay, let's tackle this issue. The problem is that when combining numeric expressions with the MOD operator in Django, if the types are different (like Decimal and Integer), the result isn't resolved to a Decimal type, unlike other mathematical operators. First, I need to understand where in the code Django handles ...
--- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -123,6 +123,16 @@ class Mod(BinaryOperation): def resolve_output_field(self): super().resolve_output_field() + from django.db.models.fields import DecimalField, IntegerField + + lhs_output = self.lhs.output_field ...
false
169
Qwen3-32B
16
null
null
10
11
scikit-learn__scikit-learn-10844
A
resolved
6
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> fowlkes_mallows_score returns RuntimeWarning when variables get too big <!-- If your issue is a usage question, submit it here instead: - StackOverflow with the scikit-learn tag: http://stackoverflow.com/ques...
Okay, I need to fix the issue with the fowlkes_mallows_score function in scikit-learn. The problem is that when pk and qk are very large, their product exceeds the 32-bit integer limit, causing an overflow and leading to a RuntimeWarning, which results in returning 'nan'. The user suggests changing the calculation fro...
--- a/sklearn/metrics/cluster/supervised.py +++ b/sklearn/metrics/cluster/supervised.py @@ -857,3 +857,3 @@ qk = np.sum(np.asarray(c.sum(axis=1)).ravel() ** 2) - n_samples - return tk / np.sqrt(pk * qk) if tk != 0. else 0. + return np.sqrt(tk / pk) * np.sqrt(tk / qk) if tk != 0. else 0.
true
17
9
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> fowlkes_mallows_score returns RuntimeWarning when variables get too big <!-- If your issue is a usage question, submit it here instead: - StackOverflow with the scikit-learn tag: http://stackoverflow.com/ques...
Okay, let's tackle this issue. The problem is that the fowlkes_mallows_score function in sklearn is throwing a RuntimeWarning when the variables pk and qk are too large. The user mentioned that when pk * qk exceeds 2^32, it causes an overflow with int32, leading to a 'nan' result. The proposed fix is to change the cal...
--- a/sklearn/metrics/cluster/supervised.py +++ b/sklearn/metrics/cluster/supervised.py @@ -859,1 +859,1 @@ - return tk / np.sqrt(pk * qk) if tk != 0. else 0. + return np.sqrt(tk / pk) * np.sqrt(tk / qk) if tk != 0. else 0.
false
0
Qwen3-32B
16
6
9
null
null
matplotlib__matplotlib-24637
B
unresolved
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> AnnotationBbox gid not passed to renderer Hi, I'm creating matplotlib figures that contain images using AnnotationBbox (following the examples here https://matplotlib.org/stable/gallery/text_labels_and_annot...
Okay, let's see. The user is having an issue where when they use AnnotationBbox in Matplotlib and set a gid with set_gid(), it doesn't get included in the SVG output. They mentioned that a similar fix was done in pull request #15087, but maybe AnnotationBbox was missed. First, I need to figure out where in the Matplo...
--- a/lib/matplotlib/backends/backend_svg.py +++ b/lib/matplotlib/backends/backend_svg.py @@ def _draw_offsetbox(self, offsetbox, xdescent, ydescent, x, y, renderer): """ Draw the offsetbox at the given position. """ if offsetbox.get_visible(): children = offsetbox.get_children() ...
false
0
9
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> AnnotationBbox gid not passed to renderer Hi, I'm creating matplotlib figures that contain images using AnnotationBbox (following the examples here https://matplotlib.org/stable/gallery/text_labels_and_annot...
Okay, let's see. The user is having an issue where when they use AnnotationBbox in Matplotlib and set a gid with set_gid(), it's not being included in the SVG output. They mentioned a similar fix in a GitHub pull request, so maybe the AnnotationBbox wasn't handled there. First, I need to figure out where in the Matpl...
--- a/lib/matplotlib/offsetbox.py +++ b/lib/matplotlib/offsetbox.py @@ -1196,6 +1196,13 @@ class AnnotationBbox(OffsetBox): self._update_offsetbox_position() self.stale = True + def set_gid(self, gid): + """ + Set the gid for the artist and propagate it to the contained offsetbox. ...
false
29
Qwen3-32B
16
null
null
9
15
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
psf__requests-1921
B
resolved
13
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Removing a default header of a session [The docs](http://docs.python-requests.org/en/latest/user/advanced/#session-objects) say that you can prevent sending a session header by setting the headers value to None...
Okay, let's see. The user is having an issue with the Python Requests library where setting a session header to None doesn't remove it, but instead sends "None" as the value. The correct approach is to delete the header, but they want to fix the library so that setting it to None actually removes it. Looking at the c...
--- a/requests/sessions.py +++ b/requests/sessions.py @@ def merge_setting(request_setting, session_setting, dict_class=OrderedDict): """ Determines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a setting is a d...
false
0
4
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Removing a default header of a session [The docs](http://docs.python-requests.org/en/latest/user/advanced/#session-objects) say that you can prevent sending a session header by setting the headers value to None...
Okay, let's see. The issue is about removing a default header from a session in the Requests library. The user says that setting a session header to None doesn't remove it, instead it sends "None" as the value. The correct way is to delete the header, but they want to be able to set it to None and have it removed. Lo...
--- a/requests/sessions.py +++ b/requests/sessions.py @@ def merge_setting(request_setting, session_setting, dict_class=OrderedDict): """ Determines appropriate setting for a given request, taking into account the explicit setting on that request, and the setting in the session. If a @@ -58,8 +58,8 @@ de...
true
113
Qwen3-32B
16
4
13
null
null
scikit-learn__scikit-learn-26194
A
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Thresholds can exceed 1 in `roc_curve` while providing probability estimate While working on https://github.com/scikit-learn/scikit-learn/pull/26120, I found out that something was odd with `roc_curve` that ret...
Okay, I need to address the issue where the `roc_curve` function in scikit-learn is returning thresholds greater than 1 when probability estimates are provided. The user provided a test case that checks if all thresholds are between 0 and 1. The problem seems to be in the code where they add a point for fpr=0 and tpr=...
--- a/sklearn/metrics/_ranking.py +++ b/sklearn/metrics/_ranking.py @@ -1083,6 +1083,10 @@ def roc_curve(y_true, y_score, pos_label=None, sample_weight=None, # Add a threshold at the end for the case when all predictions are positive thresholds = np.append(thresholds, [np.inf]) + # Clip thresholds to [0...
false
186
6
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Thresholds can exceed 1 in `roc_curve` while providing probability estimate While working on https://github.com/scikit-learn/scikit-learn/pull/26120, I found out that something was odd with `roc_curve` that ret...
Okay, I need to address the issue where the roc_curve function in scikit-learn is returning thresholds that exceed 1 when probability estimates are provided. The user provided a test case that's failing because of this. Let me look into the code and the problem description. The issue points to a specific line in the ...
--- a/sklearn/metrics/_ranking.py +++ b/sklearn/metrics/_ranking.py @@ -1083,6 +1083,7 @@ def roc_curve(y_true, y_score, pos_label=None, sample_weight=None, thresholds = thresholds[1:] # Add a threshold at 1 + max(y_score) to make sure the ROC curve starts at (0, 0) thresholds = np.concatena...
false
0
Qwen3-32B
16
null
null
10
6
sphinx-doc__sphinx-7590
A
unresolved
9
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> C++ User Defined Literals not supported The code as below ```cpp namespace units::si { inline constexpr auto planck_constant = 6.62607015e-34q_J * 1q_s; } ``` causes the following error: ``` W...
Okay, let's see. The user is having an issue with Sphinx not supporting C++ user-defined literals. The example code uses something like 6.62607015e-34q_J and 1q_s, which are literals with the 'q' suffix, probably from a units library. The error message from Sphinx mentions that the parser is failing because of invalid...
--- a/sphinx/util/cfamily.py +++ b/sphinx/util/cfamily.py @@ -53,7 +53,8 @@ float_literal_re = re.compile(r'''(?x) | (0[xX][0-9a-fA-F]+\.([pP][+-]?[0-9a-fA-F]+)?) ) ) -''') + ([a-zA-Z_]+)? +''')
false
24
14
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> C++ User Defined Literals not supported The code as below ```cpp namespace units::si { inline constexpr auto planck_constant = 6.62607015e-34q_J * 1q_s; } ``` causes the following error: ``` W...
Okay, let's see. The user is having an issue with Sphinx not recognizing C++ user-defined literals (UDLs). The example code uses something like 6.62607015e-34q_J and 1q_s, which are UDLs for units. The error message points to Sphinx's C++ domain parser not handling these correctly. Looking at the code in sphinx/util/...
--- a/sphinx/util/cfamily.py +++ b/sphinx/util/cfamily.py @@ def float_literal_re = re.compile(r'''(?x) + [+-]?( + # decimal + ([0-9]+[eE][+-]?[0-9]+) + | ([0-9]*\.[0-9]+([eE][+-]?[0-9]+)?) + | ([0-9]+\.([eE][+-]?[0-9]+)?) + # hex + | (0[xX][0-9a-fA-F]+[pP][+-]?[0-9a-fA-F]+) + | (0[xX][0-9a-fA...
false
0
Qwen3-32B
16
null
null
9
14
pytest-dev__pytest-5840
A
unresolved
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> 5.1.2 ImportError while loading conftest (windows import folder casing issues) 5.1.1 works fine. after upgrade to 5.1.2, the path was converted to lower case ``` Installing collected packages: pytest Found...
Okay, let's see. The user is facing an ImportError when running pytest 5.1.2, specifically mentioning that the conftest.py can't find the 'python' module. They mentioned that upgrading from 5.1.1 to 5.1.2 caused this issue, and the path was converted to lowercase. The error message shows a path like 'c:\azure\kms\comp...
--- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -398,7 +398,7 @@ if self._noconftest: return [] - directory = unique_path(directory) + directory = directory clist = [] for parent in directory.parts(): if self._confcutdir a...
false
51
2
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> 5.1.2 ImportError while loading conftest (windows import folder casing issues) 5.1.1 works fine. after upgrade to 5.1.2, the path was converted to lower case ``` Installing collected packages: pytest Found...
Okay, let's see. The user is having an issue with pytest 5.1.2 where there's an ImportError when loading conftest on Windows because the path is converted to lowercase. They mentioned that 5.1.1 works fine, but after upgrading to 5.1.2, the problem occurs. The error message says ModuleNotFoundError: No module named 'p...
--- a/src/_pytest/config/__init__.py +++ b/src/_pytest/config/__init__.py @@ -409,1 +409,6 @@ directory = path - directory = unique_path(directory) + if os.name != 'nt': + directory = unique_path(directory) + else: + # On Windows, preserve original case for import resolution + directo...
false
0
Qwen3-32B
16
null
null
16
2
astropy__astropy-7166
A
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> InheritDocstrings metaclass doesn't work for properties Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties. </issue> <code> [start of README.rst] 1 ======...
Okay, let's tackle this issue. The problem is that the InheritDocstrings metaclass isn't working for properties because it uses inspect.isfunction, which returns False for properties. First, I need to understand how the InheritDocstrings metaclass works. Looking at the code in astropy/utils/misc.py, the InheritDocst...
--- a/astropy/utils/misc.py +++ b/astropy/utils/misc.py @@ -530,7 +530,8 @@ class InheritDocstrings(type): return 'Did you mean {0}?'.format(matches) for key, val in dct.items(): if (inspect.isfunction(val) and - is_public_member(key) and + is_public_mem...
false
6
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> InheritDocstrings metaclass doesn't work for properties Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties. </issue> <code> [start of README.rst] 1 ======...
Okay, let's see. The issue is about the InheritDocstrings metaclass not working for properties. The user mentioned that it uses inspect.isfunction, which returns False for properties. So I need to figure out how to modify the metaclass to handle properties correctly. First, I should look at the InheritDocstrings meta...
--- a/astropy/utils/misc.py +++ b/astropy/utils/misc.py @@ def __init__(cls, name, bases, dct): - for key, val in dct.items(): - if (inspect.isfunction(val) and - is_public_member(key) and - val.__doc__ is None): - for base in cls.__mro__[1:]: - ...
false
0
Qwen3-32B
16
null
null
10
3
django__django-13794
B
unresolved
6
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> add filter is unable to concatenate strings with lazy string Description If you try to concatenate a string with a lazy string with the add template filter, the result is always the empty string because the a...
Okay, I need to solve the issue where the add template filter in Django can't concatenate a regular string with a lazy string, resulting in an empty string. The problem is a TypeError because you can't concatenate a str with a __proxy__ (which is what a lazy string is). First, I remember that Django's template system...
--- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -1,3 +1,3 @@ def add(value, arg): - return value + arg + return str(value) + str(arg)
false
0
5
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> add filter is unable to concatenate strings with lazy string Description If you try to concatenate a string with a lazy string with the add template filter, the result is always the empty string because the a...
Okay, let's tackle this issue. The problem is that when using the add filter in Django templates to concatenate a regular string with a lazy string, it results in an empty string because of a TypeError. The error message says you can't concatenate a str with a __proxy__ (which is the type for lazy strings). First, I...
--- a/django/template/defaultfilters.py +++ b/django/template/defaultfilters.py @@ -27,6 +27,7 @@ from django.utils import safestring from django.utils.encoding import force_str from django.utils.functional import keep_lazy, keep_lazy_text from django.utils.html import conditional_escape, escape, format_html +from ...
false
24
Qwen3-32B
16
null
null
5
6
django__django-15280
B
unresolved
6
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Deferred fields incorrect when following prefetches back to the "parent" object Description Given the following models: class User(models.Model): email = models.EmailField() kind = models.CharField( max_l...
Okay, let's try to figure out how to fix this Django issue. The user provided a test case that's failing because accessing a deferred field after a prefetch is causing an extra query. The problem seems to be that the deferred fields on the inner User model (from the Profile's user relation) aren't being respected when...
--- a/django/db/models/query.py +++ b/django/db/models/query.py @@ def _merge_related_objects(self, obj, related_obj, related_name, reverse): + if related_obj is obj: + # When the related object is the same as the main object (e.g., in a + # reverse relation like Profile.user pointing back ...
false
0
11
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Deferred fields incorrect when following prefetches back to the "parent" object Description Given the following models: class User(models.Model): email = models.EmailField() kind = models.CharField( max_l...
Okay, let's try to figure out how to fix this Django issue. The user provided a test case where using prefetch_related with deferred fields isn't working as expected. The problem is that when accessing a related object's parent, it's causing an extra query even though the fields were deferred. First, I need to unders...
diff --git a/django/db/models/query.py b/django/db/models/query.py --- a/django/db/models/query.py +++ b/django/db/models/query.py @@ -1548,6 +1548,10 @@ def _prefetch_related_objects(self, prefetcher, instances): # This is a reverse relation. for instance in instances: related_obj = geta...
false
82
Qwen3-32B
16
null
null
11
6
sympy__sympy-13372
A
unresolved
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> UnboundLocalError in evalf ``` >>> Mul(x, Max(0, y), evaluate=False).evalf() x*Max(0, y) >>> Mul(Max(0, y), x, evaluate=False).evalf() Traceback (most recent call last): File "./sympy/core/evalf.py", lin...
Okay, let's try to figure out how to solve this issue. The problem is an UnboundLocalError in the evalf method when dealing with a Mul that has a Max as the first argument. The user mentioned that adding an else clause with a NotImplementedError to the elif clauses in evalf_mul might fix it. First, I need to locate ...
--- a/sympy/core/evalf.py +++ b/sympy/core/evalf.py @@ -1305,6 +1305,8 @@ imprec = reprec elif arg.is_commutative and not arg.is_number: reprec = prec imprec = 0 + else: + raise NotImplementedError("evalf of non-number/commutativ...
false
44
11
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> UnboundLocalError in evalf ``` >>> Mul(x, Max(0, y), evaluate=False).evalf() x*Max(0, y) >>> Mul(Max(0, y), x, evaluate=False).evalf() Traceback (most recent call last): File "./sympy/core/evalf.py", lin...
Okay, let's see. The user is encountering an UnboundLocalError in the evalf method when dealing with a Mul that has a Max as the first argument. The error message says that 'reprec' is referenced before assignment. Looking at the code, the issue is in the evalf_mul function in evalf.py. The problem arises when the c...
--- a/sympy/core/evalf.py +++ b/sympy/core/evalf.py @@ def evalf_mul(x, prec, options): reprec = imprec = None for arg in x.args: re, im, rprec, iprec = evalf(arg, prec, options) if re is None: re = im = 0 if im is None: im = 0 if re != 0 or im !=...
false
0
Qwen3-32B
16
null
null
16
11
django__django-13023
B
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> DecimalField.to_python() raises TypeError on dict values. Description A call to DecimalField.to_python() with a dictionary as the value parameter produces TypeError instead of ValidationError. This is a probl...
Okay, let's tackle this issue. The problem is that when DecimalField's to_python method receives a dictionary, it raises a TypeError instead of a ValidationError. This makes debugging harder because the error isn't as informative. The user provided a pull request link, but I need to figure out the code changes based o...
--- a/django/contrib/gis/utils/layermapping.py +++ b/django/contrib/gis/utils/layermapping.py @@ def verify_ogr_field(self, ogr_field, model_field): - d = Decimal(str(ogr_field.value)) + val = model_field.to_python(ogr_field.value) @@ def verify_ogr_field(self, ogr_field, model_field): - val = d +...
false
0
1
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> DecimalField.to_python() raises TypeError on dict values. Description A call to DecimalField.to_python() with a dictionary as the value parameter produces TypeError instead of ValidationError. This is a probl...
Okay, let's tackle this issue. The problem is that when DecimalField's to_python method receives a dictionary, it raises a TypeError instead of a ValidationError. This makes debugging harder because the error isn't as informative. The user provided a pull request link, but I need to figure out the fix based on the cod...
--- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -123,6 +123,8 @@ class DecimalField(Field): def to_python(self, value): if value in (None, ''): return None + if isinstance(value, dict): + raise ValidationError(self.error_messages['invalid'], code='invalid') ...
false
9
Qwen3-32B
16
null
null
1
10
pallets__flask-5014
A
unresolved
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Require a non-empty name for Blueprints Things do not work correctly if a Blueprint is given an empty name (e.g. #4944). It would be helpful if a `ValueError` was raised when trying to do that. </issue> <cod...
Okay, let's tackle this issue. The user wants to ensure that a ValueError is raised when a Blueprint is given an empty name. Looking at the provided code, I need to find where Blueprints are initialized. First, I remember that in Flask, the Blueprint class is where the initialization happens. But in the code provided...
--- a/src/flask/blueprints.py +++ b/src/flask/blueprints.py @@ -20,6 +20,9 @@ class Blueprint: self.import_name = import_name self.name = name self.url_prefix = url_prefix + + if not self.name: + raise ValueError("Blueprint name must be non-empty.")
false
3
4
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Require a non-empty name for Blueprints Things do not work correctly if a Blueprint is given an empty name (e.g. #4944). It would be helpful if a `ValueError` was raised when trying to do that. </issue> <cod...
Okay, let's tackle this issue. The user wants to ensure that a ValueError is raised when a Blueprint is given an empty name. Looking at the provided code, I need to find where Blueprints are initialized. First, I remember that in Flask, the Blueprint class is where the initialization happens. But in the code provided...
--- a/src/flask/blueprints.py +++ b/src/flask/blueprints.py @@ -10,6 +10,9 @@ class Blueprint: def __init__(self, name, import_name, static_folder=None, template_folder=None, url_prefix=None, subdomain=None, cli_commands=None): self.name = name + if not self.name: + ra...
false
0
Qwen3-32B
16
null
null
15
4
matplotlib__matplotlib-24627
A
unresolved
10
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> cla(), clf() should unset the `.axes` and `.figure` attributes of deparented artists mpl2.0b3: Removing an artist from its axes unsets its `.axes` attribute, but clearing the axes does not do so. ``` In [11]: ...
Okay, let's tackle this issue. The problem is that when you call cla() or clf() on an Axes or Figure in Matplotlib, the artists that were removed from the Axes aren't having their .axes or .figure attributes unset. The user provided examples showing that after removing a line with remove(), the .axes attribute becomes...
--- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ -1234,6 +1234,10 @@ def cla(self): self.xaxis.cla() self.yaxis.cla() self.images = [] + # Explicitly remove all artists to unset their .axes attribute + for artist in list(self._all_artists): + ...
false
776
16
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> cla(), clf() should unset the `.axes` and `.figure` attributes of deparented artists mpl2.0b3: Removing an artist from its axes unsets its `.axes` attribute, but clearing the axes does not do so. ``` In [11]: ...
Okay, let's see. The issue is about cla() and clf() not unsetting the .axes and .figure attributes of deparented artists in Matplotlib. The user provided an example where removing an artist with remove() sets l.axes to None, but after cla(), it still references the old Axes. First, I need to figure out where in the ...
--- a/lib/matplotlib/axes/_base.py +++ b/lib/matplotlib/axes/_base.py @@ def cla(self): - self.lines = [] - self.patches = [] - self.texts = [] - self.collections = [] - self.polygonCollections = [] - self.images = [] - self.containers = [] - self.legend_ = None ...
false
0
Qwen3-32B
16
null
null
10
16
matplotlib__matplotlib-13989
B
unresolved
14
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> hist() no longer respects range=... when density=True <!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--> <!--You can feel free to delete the sections tha...
Okay, let's tackle this issue. The user says that when using plt.hist with density=True, the range parameter isn't respected. The example provided shows that the bins don't start at 0 and end at 1 as expected. The problem was introduced in a recent commit related to PR #8638. First, I need to understand why the range...
--- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ def hist(self, x, bins=10, range=None, density=False, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwidth=None, log=False, color=None, label=None, stacked=False, normed=None, *, data=None, **kwa...
false
0
3
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> hist() no longer respects range=... when density=True <!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--> <!--You can feel free to delete the sections tha...
Okay, let's tackle this issue. The user is saying that when using plt.hist with density=True, the range parameter isn't being respected. The problem was introduced in a specific commit related to pull request #8638. First, I need to understand what the issue is. The user's example uses np.random.rand(10) which shoul...
--- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ def hist(self, x, bins=10, range=None, density=False, weights=None, @@ -1890,6 +1890,10 @@ if density: db = bins[1] - bins[0] n = n / (db * np.sum(weights)) if weights is not None else n / (db * n.size) + ...
false
411
Qwen3-32B
16
null
null
3
14
django__django-13344
B
unresolved
12
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Coroutine passed to the first middleware's process_response() instead of HttpResponse. Description Like the title says, using ASGI (+ uvicorn in my case), the first middleware (according to the list in settin...
Okay, let's tackle this issue. The user is saying that when using ASGI with Django 3.1 and a middleware as the first in the list, the process_response method receives a coroutine instead of an HttpResponse. This is causing problems for packages like django-cors-headers. Looking at the provided code, specifically djan...
--- a/django/core/handlers/base.py +++ b/django/core/handlers/base.py @@ def get_response_async(self, request): - response = await self._middleware_chain(request) + response = await self._middleware_chain(request) + if asyncio.iscoroutine(response): + response = await response
false
0
14
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Coroutine passed to the first middleware's process_response() instead of HttpResponse. Description Like the title says, using ASGI (+ uvicorn in my case), the first middleware (according to the list in settin...
Okay, let's tackle this issue. The user is saying that when using ASGI with Django (like with Uvicorn), the first middleware in the MIDDLEWARE list receives a coroutine instead of an HttpResponse in its process_response method. This is causing problems for packages like django-cors-headers when they're placed first. ...
--- a/django/utils/decorators.py +++ b/django/utils/decorators.py @@ -1,4 +1,5 @@ import asyncio +from asgiref.sync import async_to_sync class MiddlewareMixin: @@ -10,6 +11,12 @@ class MiddlewareMixin: response = None if hasattr(self, 'process_request'): response = self.process_req...
false
356
Qwen3-32B
16
null
null
14
12
django__django-13551
A
unresolved
12
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Changing user's email could invalidate password reset tokens Description Sequence: Have account with email address foo@… Password reset request for that email (unused) foo@… account changes their email addres...
Okay, I need to fix the issue where changing a user's email allows a password reset token generated before the change to still work. The problem is in the PasswordResetTokenGenerator's _make_hash_value method not including the email, so when the email changes, the token shouldn't be valid anymore. First, I should loo...
--- a/django/contrib/auth/tokens.py +++ b/django/contrib/auth/tokens.py @@ -15,7 +15,7 @@ # Ensure the timestamp is in bytes, not a datetime or int. return str(user.pk) + user.password + str(timestamp) - def _make_hash_value(self, user, timestamp): + def _make_hash_value(self, user, timestamp)...
false
56
15
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Changing user's email could invalidate password reset tokens Description Sequence: Have account with email address foo@… Password reset request for that email (unused) foo@… account changes their email addres...
Okay, let's tackle this issue. The problem is that when a user changes their email, password reset tokens generated before the change are still valid, which they shouldn't be. The fix involves modifying the PasswordResetTokenGenerator's _make_hash_value method to include the user's email. First, I need to find where ...
--- a/django/contrib/auth/tokens.py +++ b/django/contrib/auth/tokens.py @@ -1,21 +1,34 @@ from django.contrib.auth.models import AbstractBaseUser from django.utils import six from django.utils.crypto import salted_hmac from django.utils.http import base36_encode from django.utils.translation import ugettext_lazy ...
false
0
Qwen3-32B
16
null
null
12
15
sphinx-doc__sphinx-8035
B
unresolved
5
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Support defining specific `:private-members:` for autodoc **Is your feature request related to a problem? Please describe.** Currently, if I'm using autodoc, the `:private-members:` option does not allow speci...
Okay, I need to figure out how to modify the Sphinx codebase to support specifying individual private members in autodoc using the :private-members: option. Let me start by understanding the problem. The user wants to be able to list specific private members (like _member1, _member2) with the :private-members: direct...
--- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ def process_documenter_options(documenter: "Type[Documenter]", config: Config, options: Dict ) -> Options: """Recognize options of Documenter from user input.""" for name in AUTODOC_DEFAULT_OPTIONS...
false
0
2
You will be provided with a partial code base and an issue statement explaining a problem to resolve. <issue> Support defining specific `:private-members:` for autodoc **Is your feature request related to a problem? Please describe.** Currently, if I'm using autodoc, the `:private-members:` option does not allow speci...
Okay, I need to solve the issue where the autodoc's :private-members: option doesn't allow specifying which private members to document. The user wants to be able to list specific private members, similar to how :members: works. First, I should look at the existing code in the Sphinx repository. The relevant files a...
--- a/sphinx/ext/autodoc/directive.py +++ b/sphinx/ext/autodoc/directive.py @@ -38,7 +38,7 @@ AUTODOC_DEFAULT_OPTIONS = ['members', 'undoc-members', 'inherited-members', 'show-inheritance', 'private-members', 'special-members', 'ignore-module-all', 'exclude-membe...
false
2
Qwen3-32B
16
null
null
2
5
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