selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3,500 | r2e_gym::train::5029 | r2e_gym | train | 5,029 | datalad__bfd9fd10b42c32d9e2231b4e49b41f985e25b296 | datalad | datalad/datalad | python | bfd9fd10b42c32d9e2231b4e49b41f985e25b296 | **Title:** `verify_ria_url` Returns Host with Protocol, Causing Test Failures
**Description:**
The `verify_ria_url` function is intended to parse RIA URLs and extract components such as `host`, `base-path`, and a rewritten URL. However, it currently returns the `host` component including the protocol (e.g., `'ssh://lo... | diff --git a/datalad/customremotes/ria_utils.py b/datalad/customremotes/ria_utils.py
--- a/datalad/customremotes/ria_utils.py
+++ b/datalad/customremotes/ria_utils.py
@@ -79,8 +79,8 @@
-------
tuple
(host, base-path, rewritten url)
- `host` is not just a hostname, but may also contain username, pa... | diff --git a/datalad/customremotes/tests/test_ria_utils.py b/datalad/customremotes/tests/test_ria_utils.py
--- a/datalad/customremotes/tests/test_ria_utils.py
+++ b/datalad/customremotes/tests/test_ria_utils.py
@@ -127,26 +127,32 @@
def test_verify_ria_url():
# unsupported protocol
- assert_raises(ValueError... | null | null | namanjain12/datalad_final:bfd9fd10b42c32d9e2231b4e49b41f985e25b296 | true | null | 1 | 15 | null | 1,957 | 0 | 0.75 | 1 | 0.75 | 1 | 0.376167 | 84.2535 | ||
3,501 | r2e_gym::train::279 | r2e_gym | train | 279 | orange3__a2afed5c9540bd877710710d0b9b3b393e0ccd20 | orange3 | biolab/orange3 | python | a2afed5c9540bd877710710d0b9b3b393e0ccd20 | **Title:** PCA Widget Missing Variance Information in Output Tables
**Description:**
When performing Principal Component Analysis (PCA) using the widget, the variance covered by each principal component is not included in the output tables. This omission leads to errors when accessing the variance information programm... | diff --git a/Orange/widgets/unsupervised/owpca.py b/Orange/widgets/unsupervised/owpca.py
--- a/Orange/widgets/unsupervised/owpca.py
+++ b/Orange/widgets/unsupervised/owpca.py
@@ -293,22 +293,36 @@
self._transformed = self._pca(self.data)
transformed = self._transformed
+ if se... | diff --git a/Orange/widgets/unsupervised/tests/test_owpca.py b/Orange/widgets/unsupervised/tests/test_owpca.py
--- a/Orange/widgets/unsupervised/tests/test_owpca.py
+++ b/Orange/widgets/unsupervised/tests/test_owpca.py
@@ -94,6 +94,27 @@
self.send_signal(self.widget.Inputs.data, table)
out = self.get_... | null | null | namanjain12/orange3_final:a2afed5c9540bd877710710d0b9b3b393e0ccd20 | true | null | 1 | 22 | null | 1,799 | 0 | 0.75 | 1 | 0.75 | 1 | 0.373167 | 84.2445 | ||
3,502 | r2e_gym::train::1885 | r2e_gym | train | 1,885 | sympy__9c47f86fa3367ed316d99b4daa9a68ba7e34e339 | sympy | sympy/sympy | python | 9c47f86fa3367ed316d99b4daa9a68ba7e34e339 | Title: Incorrect handling of empty list arguments in fuzzy_and and fuzzy_or
Description:
When providing an empty list to fuzzy_and or fuzzy_or, the functions are expected to return a default value instead of raising an error. For instance, an empty list should yield True in fuzzy_and and False in fuzzy_or. However, th... | diff --git a/sympy/core/logic.py b/sympy/core/logic.py
--- a/sympy/core/logic.py
+++ b/sympy/core/logic.py
@@ -22,11 +22,8 @@
return bool(x)
-def fuzzy_and(*args):
+def fuzzy_and(args):
"""Return True (all True), False (any False) or None.
-
- If `a` is an iterable it must not be empty; it
- can be ... | diff --git a/sympy/core/tests/test_logic.py b/sympy/core/tests/test_logic.py
--- a/sympy/core/tests/test_logic.py
+++ b/sympy/core/tests/test_logic.py
@@ -13,40 +13,29 @@
def test_fuzzy_and():
- assert fuzzy_and(*[T, T]) == T
- assert fuzzy_and(*[T, F]) == F
- assert fuzzy_and(*[T, U]) == U
- assert fu... | null | null | namanjain12/sympy_final:9c47f86fa3367ed316d99b4daa9a68ba7e34e339 | true | null | 1 | 50 | null | 1,220 | 0 | 0.75 | 1 | 0.75 | 1 | 0.37 | 84.235 | ||
3,503 | r2e_gym::train::4573 | r2e_gym | train | 4,573 | numpy__f0e37e8088e55307ad33791a03cb3989f1b8118c | numpy | numpy/numpy | python | f0e37e8088e55307ad33791a03cb3989f1b8118c | **Example Issue:**
[ISSUE]
**Title:** `np.insert` and `np.delete` Allow Axis Parameters on 0-D Arrays, Causing Unexpected Behavior
**Description:**
When using `np.insert` or `np.delete` on 0-dimensional arrays with the `axis` parameter, unexpected behavior occurs without any errors. This can lead to confusing results... | diff --git a/doc/release/upcoming_changes/15802.expired.rst b/doc/release/upcoming_changes/15802.expired.rst
--- a/doc/release/upcoming_changes/15802.expired.rst
+++ b/doc/release/upcoming_changes/15802.expired.rst
@@ -0,0 +1,9 @@
+`numpy.insert` and `numpy.delete` can no longer be passed an axis on 0d arrays
+--------... | diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -509,12 +509,11 @@
insert(a, 1, a[:, 2, :], axis=1))
def test_0d(self):
- # This is an error in the fu... | null | null | namanjain12/numpy_final:f0e37e8088e55307ad33791a03cb3989f1b8118c | true | null | 2 | 29 | null | 1,633 | 0 | 0.75 | 1 | 0.75 | 1 | 0.368833 | 84.2315 | ||
3,504 | r2e_gym::train::2484 | r2e_gym | train | 2,484 | sympy__1bea2294bdce80a48ea42f37479ade942d54cffd | sympy | sympy/sympy | python | 1bea2294bdce80a48ea42f37479ade942d54cffd | Title: rf and ff do not raise ValueError for multivariate Poly inputs
Description:
When calling the rf and ff functions with a multivariate polynomial (i.e., a Poly with more than one generator), the functions are expected to raise a ValueError. For example, using a polynomial constructed with two generators should re... | diff --git a/sympy/functions/combinatorial/factorials.py b/sympy/functions/combinatorial/factorials.py
--- a/sympy/functions/combinatorial/factorials.py
+++ b/sympy/functions/combinatorial/factorials.py
@@ -483,12 +483,11 @@
else:
if isinstance(x, Poly):
... | diff --git a/sympy/functions/combinatorial/tests/test_comb_factorials.py b/sympy/functions/combinatorial/tests/test_comb_factorials.py
--- a/sympy/functions/combinatorial/tests/test_comb_factorials.py
+++ b/sympy/functions/combinatorial/tests/test_comb_factorials.py
@@ -45,9 +45,9 @@
assert rf(Poly(x**2 + 3*x, x... | null | null | namanjain12/sympy_final:1bea2294bdce80a48ea42f37479ade942d54cffd | true | null | 1 | 34 | null | 1,529 | 0 | 0.75 | 1 | 0.75 | 1 | 0.368167 | 84.2295 | ||
3,505 | r2e_gym::train::724 | r2e_gym | train | 724 | sympy__b54c0ad9c51c60d969ceffcfe4918c769bf4c103 | sympy | sympy/sympy | python | b54c0ad9c51c60d969ceffcfe4918c769bf4c103 | Title: Incorrect behavior when evaluating size and indexing for symbolic Range
Description:
When using Range with symbolic inputs, the behavior does not consistently match expectations, especially when computing the size or accessing an element by index. For example, when a symbol without sufficient integer constraint... | diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py
--- a/sympy/sets/fancysets.py
+++ b/sympy/sets/fancysets.py
@@ -759,9 +759,10 @@
n = dif/self.step
if n.is_infinite:
return S.Infinity
- if not n.is_integer or not all(i.is_integer for i in self.args):
- rais... | diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py
--- a/sympy/sets/tests/test_fancysets.py
+++ b/sympy/sets/tests/test_fancysets.py
@@ -848,6 +848,55 @@
raises(ValueError, lambda: ComplexRegion(r1*theta1, polar=2))
+def test_symbolic_Range():
+ n = Symbol('n')
+ raises(... | null | null | namanjain12/sympy_final:b54c0ad9c51c60d969ceffcfe4918c769bf4c103 | true | null | 1 | 11 | null | 1,980 | 0 | 0.75 | 1 | 0.75 | 1 | 0.366667 | 84.225 | ||
3,506 | r2e_gym::train::941 | r2e_gym | train | 941 | sympy__8f5fc1b68da9930b65e362fa33a4d8cbeb17bdbf | sympy | sympy/sympy | python | 8f5fc1b68da9930b65e362fa33a4d8cbeb17bdbf | Title: Incorrect Handling of Empty Initialization and 'strict' Parameter in PermutationGroup
Description:
There are two related issues reported concerning the PermutationGroup functionality.
First, creating a group without supplying any permutations results in an error. For example, the following code snippet causes ... | diff --git a/sympy/combinatorics/perm_groups.py b/sympy/combinatorics/perm_groups.py
--- a/sympy/combinatorics/perm_groups.py
+++ b/sympy/combinatorics/perm_groups.py
@@ -123,10 +123,10 @@
"""The default constructor. Accepts Cycle and Permutation forms.
Removes duplicates unless ``dups`` keyword is Fa... | diff --git a/sympy/combinatorics/tests/test_perm_groups.py b/sympy/combinatorics/tests/test_perm_groups.py
--- a/sympy/combinatorics/tests/test_perm_groups.py
+++ b/sympy/combinatorics/tests/test_perm_groups.py
@@ -60,6 +60,7 @@
b = Permutation([2, 1, 3, 4, 5, 6, 7, 8, 9, 0])
g = PermutationGroup([a, b])
... | null | null | namanjain12/sympy_final:8f5fc1b68da9930b65e362fa33a4d8cbeb17bdbf | true | null | 2 | 22 | null | 1,756 | 0 | 0.75 | 1 | 0.75 | 1 | 0.366 | 84.223 | ||
3,507 | r2e_gym::train::5720 | r2e_gym | train | 5,720 | scrapy__6ddd8147382348f4796ac905f0357925dfa81da1 | scrapy | scrapy/scrapy | python | 6ddd8147382348f4796ac905f0357925dfa81da1 | **Analysis:**
1. **Key Parts:**
- **Commit Message:** Support unicode tags in XML iterators (fixes #1665).
- **Test Results:** The `TestHelper.test_body_or_str` failed in the old commit but passes in the new commit.
- **Changed Function:** `_body_or_str` now includes `bytes` in its accepted types.
2. **Main ... | diff --git a/scrapy/utils/iterators.py b/scrapy/utils/iterators.py
--- a/scrapy/utils/iterators.py
+++ b/scrapy/utils/iterators.py
@@ -18,7 +18,7 @@
def xmliter(obj, nodename):
"""Return a iterator of Selector's over all nodes of a XML document,
- given tha name of the node to iterate. Useful for parsing ... | diff --git a/tests/test_utils_iterators.py b/tests/test_utils_iterators.py
--- a/tests/test_utils_iterators.py
+++ b/tests/test_utils_iterators.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
import os
from twisted.trial import unittest
@@ -45,6 +46,54 @@
for e in self.xmliter(response, 'matchme...')]... | null | null | namanjain12/scrapy_final:6ddd8147382348f4796ac905f0357925dfa81da1 | true | null | 1 | 10 | null | 1,987 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3645 | 84.2185 | ||
3,508 | swe_bench::test::1808 | swe_bench | test | 1,808 | sphinx-doc__sphinx-8075 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 487b8436c6e8dc596db4b8d4d06e9145105a2ac2 | References to figures without captions: errors in both HTML and LaTeX
**Describe the bug**
Using figures without captions causes errors in both HTML (though these are properly reported when source is processed) and in LaTeX (they are not reported until LaTeX says there were undefined references).
This was the test do... | diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -610,8 +610,6 @@ class StandardDomain(Domain):
dangling_warnings = {
'term': 'term not in glossary: %(target)s',
- 'ref': 'undefined label: %(target)s (if the link has no caption... | diff --git a/tests/roots/test-domain-py-xref-warning/conf.py b/tests/roots/test-domain-py-xref-warning/conf.py
new file mode 100644
diff --git a/tests/roots/test-domain-py-xref-warning/index.rst b/tests/roots/test-domain-py-xref-warning/index.rst
new file mode 100644
--- /dev/null
+++ b/tests/roots/test-domain-py-xref-... | ["tests/test_domain_py.py::test_warn_missing_reference"] | ["tests/test_domain_py.py::test_function_signatures", "tests/test_domain_py.py::test_domain_py_xrefs", "tests/test_domain_py.py::test_domain_py_objects", "tests/test_domain_py.py::test_resolve_xref_for_properties", "tests/test_domain_py.py::test_domain_py_find_obj", "tests/test_domain_py.py::test_get_full_qualified_nam... | null | true | 2020-08-08T11:20:59Z | 3 | 23 | 1 | 2,667 | 0 | 0.8 | 1 | 0.7 | 1 | 0.521167 | 84.2135 | ||
3,509 | swe_bench::dev::170 | swe_bench | dev | 170 | pyvista__pyvista-4414 | pyvista/pyvista | pyvista/pyvista | python | 438dd0d6ea2ebee73ecccdba878837af8fd83d7d | Adding ``CircularArc``s together does not provide a line
### Describe the bug, what's wrong, and what you expected.
Don't know if it can be considered a bug or not but...
If you define two consecutive ``pv.CircularArc`` and you plot them, weird things start to appear with the new PyVista 0.39 version. Run the followi... | IMO, we shouldn't be seeing a surface, but two consecutive lines as it is shown in PyVista 0.38.6. | diff --git a/pyvista/core/filters/poly_data.py b/pyvista/core/filters/poly_data.py
--- a/pyvista/core/filters/poly_data.py
+++ b/pyvista/core/filters/poly_data.py
@@ -420,11 +420,11 @@ def merge(
"""
# check if dataset or datasets are not polydata
if isinstance(dataset, (list, tuple, pyvista.... | diff --git a/tests/test_polydata.py b/tests/test_polydata.py
--- a/tests/test_polydata.py
+++ b/tests/test_polydata.py
@@ -340,6 +340,16 @@ def test_merge(sphere, sphere_shifted, hexbeam):
merged = mesh.merge(sphere_shifted, inplace=True)
assert merged is mesh
+ # test merge with lines
+ arc_1 = pyvis... | ["tests/test_polydata.py::test_merge"] | ["tests/test_polydata.py::test_init", "tests/test_polydata.py::test_init_from_pdata", "tests/test_polydata.py::test_init_from_arrays", "tests/test_polydata.py::test_init_from_arrays_with_vert", "tests/test_polydata.py::test_init_from_arrays_triangular", "tests/test_polydata.py::test_init_as_points", "tests/test_polydat... | null | true | 2023-05-12T03:06:04Z | 1 | 34 | 1 | 3,176 | 0 | 0.8 | 1 | 0.62 | 1 | 0.613333 | 84.21 | |
3,510 | r2e_gym::train::1079 | r2e_gym | train | 1,079 | sympy__2364485463a40e04750517ddb880295c5dd37707 | sympy | sympy/sympy | python | 2364485463a40e04750517ddb880295c5dd37707 | Title: DiscreteRV and FiniteRV should accept a 'check' keyword to bypass density verification
Description:
The recent changes to support disabling density verification for continuous distributions were not applied to discrete and finite distributions. When using a custom probability mass function with the check flag s... | diff --git a/sympy/stats/drv_types.py b/sympy/stats/drv_types.py
--- a/sympy/stats/drv_types.py
+++ b/sympy/stats/drv_types.py
@@ -33,10 +33,11 @@
]
-def rv(symbol, cls, *args):
+def rv(symbol, cls, *args, **kwargs):
args = list(map(sympify, args))
dist = cls(*args)
- dist.check(*args)
+ if kwargs.... | diff --git a/sympy/stats/tests/test_continuous_rv.py b/sympy/stats/tests/test_continuous_rv.py
--- a/sympy/stats/tests/test_continuous_rv.py
+++ b/sympy/stats/tests/test_continuous_rv.py
@@ -348,9 +348,10 @@
assert P(Z > 5) == exp(-5)
raises(ValueError, lambda: ContinuousRV(z, exp(-z), set=Interval(0, 10)))
... | null | null | namanjain12/sympy_final:2364485463a40e04750517ddb880295c5dd37707 | true | null | 2 | 34 | null | 1,486 | 0 | 0.75 | 1 | 0.75 | 1 | 0.361 | 84.208 | ||
3,511 | r2e_gym::train::2276 | r2e_gym | train | 2,276 | sympy__36bcecfeb5b359238a6047c7888555e196d43c89 | sympy | sympy/sympy | python | 36bcecfeb5b359238a6047c7888555e196d43c89 | Title: Incorrect Symbol Substitution in Solveset Causes TypeError in Stationary Points
Description:
When computing the stationary points for a function such as x * cot(5*x) in the real domain, an error is raised due to an incorrect substitution of the symbol in the underlying solveset. In this scenario, the substituti... | diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -70,9 +70,6 @@
pass
-_rc = Dummy("R", real=True), Dummy("C", complex=True)
-
-
def _masked(f, *atoms):
"""Return ``f``, with all objects given by ``atoms`` replaced with
... | diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -1,5 +1,6 @@
from math import isclose
+from sympy.calculus.util import stationary_points
from sympy.core.containers import Tuple
from sym... | null | null | namanjain12/sympy_final:36bcecfeb5b359238a6047c7888555e196d43c89 | true | null | 1 | 18 | null | 1,802 | 0 | 0.75 | 1 | 0.75 | 1 | 0.360333 | 84.206 | ||
3,512 | r2e_gym::train::1339 | r2e_gym | train | 1,339 | sympy__b82e53828cb3879c2a96468416d5a980555e18fd | sympy | sympy/sympy | python | b82e53828cb3879c2a96468416d5a980555e18fd | Title: Bug in minimal_polynomial for Algebraic Numbers Raised to Positive Integer Powers
Description:
There is an error when computing the minimal polynomial of an algebraic number raised to a positive integer power. When an algebraic number (for example, representing √2) is raised to a power like 3, the internal rout... | diff --git a/sympy/polys/numberfields/minpoly.py b/sympy/polys/numberfields/minpoly.py
--- a/sympy/polys/numberfields/minpoly.py
+++ b/sympy/polys/numberfields/minpoly.py
@@ -742,6 +742,33 @@
return a
def bottom_up_scan(ex):
+ """
+ Transform a given algebraic expression *ex* into a multiv... | diff --git a/sympy/polys/numberfields/tests/test_minpoly.py b/sympy/polys/numberfields/tests/test_minpoly.py
--- a/sympy/polys/numberfields/tests/test_minpoly.py
+++ b/sympy/polys/numberfields/tests/test_minpoly.py
@@ -422,6 +422,11 @@
I/(x + I)/6 - I/(x - I)/6
+def test_issue_22559():
+ alpha = Algebra... | null | null | namanjain12/sympy_final:b82e53828cb3879c2a96468416d5a980555e18fd | true | null | 1 | 32 | null | 1,520 | 0 | 0.75 | 1 | 0.75 | 1 | 0.36 | 84.205 | ||
3,513 | r2e_gym::train::1516 | r2e_gym | train | 1,516 | sympy__64a68cb6973062813a88298cbd62f00d7bb2ec91 | sympy | sympy/sympy | python | 64a68cb6973062813a88298cbd62f00d7bb2ec91 | Title: Inverse Transformation Raises "too many values to unpack" Error
Description:
When deriving the inverse of a coordinate transformation, the method fails unexpectedly with a "ValueError: too many values to unpack (expected 2)". This happens when trying to compute the inverse for a system defined by a two-dimensio... | diff --git a/sympy/diffgeom/diffgeom.py b/sympy/diffgeom/diffgeom.py
--- a/sympy/diffgeom/diffgeom.py
+++ b/sympy/diffgeom/diffgeom.py
@@ -357,17 +357,20 @@
@staticmethod
def _inverse_transformation(sys1, sys2):
# Find the transformation relation from sys2 to sys1
- forward_transform = sys1.tr... | diff --git a/sympy/diffgeom/tests/test_diffgeom.py b/sympy/diffgeom/tests/test_diffgeom.py
--- a/sympy/diffgeom/tests/test_diffgeom.py
+++ b/sympy/diffgeom/tests/test_diffgeom.py
@@ -1,10 +1,10 @@
-from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r, R3_c, R3_s
-from sympy.diffgeom import (Commutator, Differential, Tens... | null | null | namanjain12/sympy_final:64a68cb6973062813a88298cbd62f00d7bb2ec91 | true | null | 1 | 28 | null | 1,592 | 0 | 0.75 | 1 | 0.75 | 1 | 0.358667 | 84.201 | ||
3,514 | swe_bench::test::2266 | swe_bench | test | 2,266 | sympy__sympy-23021 | sympy/sympy | sympy/sympy | python | 706ab9045effd9886fcf3efd670644a592931b86 | decompogen doesn't like Min/Max
```
>>> decompogen(Min(5,x),x)
...
File "sympy\solvers\decompogen.py", line 57, in decompogen
result += [f1] + decompogen(f2, symbol)
File "sympy\solvers\decompogen.py", line 57, in decompogen
result += [f1] + decompogen(f2, symbol)
File "sympy\solvers\decompogen.py", line ... | I want to fix this bug :) May I?
ping @smichr please nudge me in the right direction so I may work on this :)
What are we expecting `>>>decompogen(Max(3, x), x)` to return?
Would it be `[max(3,x)]` ?
The issue still persists on `master`.
:white_check_mark:
Hi, I am the [SymPy bot](https://github.com/sympy/sympy-bo... | diff --git a/sympy/solvers/decompogen.py b/sympy/solvers/decompogen.py
--- a/sympy/solvers/decompogen.py
+++ b/sympy/solvers/decompogen.py
@@ -3,6 +3,7 @@
from sympy.core.singleton import S
from sympy.polys import Poly, decompose
from sympy.utilities.misc import func_name
+from sympy.functions.elementary.miscellaneo... | diff --git a/sympy/solvers/tests/test_decompogen.py b/sympy/solvers/tests/test_decompogen.py
--- a/sympy/solvers/tests/test_decompogen.py
+++ b/sympy/solvers/tests/test_decompogen.py
@@ -2,7 +2,7 @@
from sympy.core.symbol import symbols
from sympy.functions.elementary.complexes import Abs
from sympy.functions.elemen... | ["test_decompogen"] | ["test_decompogen_poly"] | null | true | 2022-02-05T14:37:33Z | 1 | 33 | 1 | 3,197 | 0 | 0.8 | 1 | 0.62 | 1 | 0.61 | 84.2 | |
3,515 | r2e_gym::train::42 | r2e_gym | train | 42 | orange3__9afaa96d86be534dcb13de9075e02dc215db0047 | orange3 | biolab/orange3 | python | 9afaa96d86be534dcb13de9075e02dc215db0047 | **Title:** Error Raised When DataFrames Have Mismatched Indices in `table_from_frames`
**Description:**
When using the `table_from_frames` function to combine multiple pandas DataFrames into an Orange `Table`, providing DataFrames with different indices leads to an unexpected error. Specifically, if the indices of the... | diff --git a/Orange/data/pandas_compat.py b/Orange/data/pandas_compat.py
--- a/Orange/data/pandas_compat.py
+++ b/Orange/data/pandas_compat.py
@@ -348,6 +348,15 @@
def table_from_frames(xdf, ydf, mdf):
+ if not (xdf.index.equals(ydf.index) and xdf.index.equals(mdf.index)):
+ raise ValueError(
+ ... | diff --git a/Orange/data/tests/test_pandas.py b/Orange/data/tests/test_pandas.py
--- a/Orange/data/tests/test_pandas.py
+++ b/Orange/data/tests/test_pandas.py
@@ -476,6 +476,39 @@
self.assertEqual(y.columns[0], d.class_var.name)
self.assertListEqual(m.columns.tolist(), [a.name for a in d.metas])
+ ... | null | null | namanjain12/orange3_final:9afaa96d86be534dcb13de9075e02dc215db0047 | true | null | 1 | 16 | null | 1,815 | 0 | 0.75 | 1 | 0.75 | 1 | 0.355833 | 84.1925 | ||
3,516 | swe_bench::test::1172 | swe_bench | test | 1,172 | psf__requests-1733 | psf/requests | psf/requests | python | a123f8351dc9f7ddfb06c5fafb25fedf6d119ff1 | allow Response class to be pickled
```
Python 2.7.4 (default, Apr 19 2013, 18:32:33)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle, requests
>>> pickle.dumps(requests.get('http://example.org'))
Traceback (most recent call last):
File "<stdin>", line 1, ... | Out of interest, what's the use case for this?
I want to use requests with the multiprocessing module and it uses pickle as the serialization method.
I may be able to produce a patch if you give me some directions.
If you want to take a crack at a patch @git2samus, take a look at the Session class. That's picklable ... | diff --git a/requests/models.py b/requests/models.py
--- a/requests/models.py
+++ b/requests/models.py
@@ -489,6 +489,19 @@ class Response(object):
server's response to an HTTP request.
"""
+ __attrs__ = [
+ '_content',
+ 'status_code',
+ 'headers',
+ 'url',
+ 'history'... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -433,7 +433,7 @@ def test_unicode_multipart_post_fieldnames(self):
prep = r.prepare()
assert b'name="stuff"' in prep.body
assert b'name="b\'stuff\'"' not in prep.body
-
+
def test_unicod... | ["test_requests.py::RequestsTestCase::test_cookie_persists_via_api", "test_requests.py::RequestsTestCase::test_cookie_removed_on_expire", "test_requests.py::RequestsTestCase::test_mixed_case_scheme_acceptable", "test_requests.py::RequestsTestCase::test_request_and_response_are_pickleable", "test_requests.py::RequestsTe... | ["test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_DIGEST_STREAM", "test_requests.py::RequestsTestCase::te... | null | true | 2013-11-09T22:49:23Z | 1 | 31 | 5 | 3,497 | 0 | 0.8 | 1 | 0.62 | 1 | 0.603333 | 84.18 | |
3,517 | r2e_gym::train::591 | r2e_gym | train | 591 | sympy__0a536f722df2ab8a24a46c6aef77f54bd66965d1 | sympy | sympy/sympy | python | 0a536f722df2ab8a24a46c6aef77f54bd66965d1 | Title: Passing None as load raises TypeError in KanesMethod
Description:
When calling the equations generator with an empty load, such as None or an empty tuple, the method unexpectedly raises a TypeError. In one scenario, when the load is provided as None, the error "TypeError: 'NoneType' object is not subscriptable"... | diff --git a/sympy/physics/mechanics/kane.py b/sympy/physics/mechanics/kane.py
--- a/sympy/physics/mechanics/kane.py
+++ b/sympy/physics/mechanics/kane.py
@@ -267,8 +267,9 @@
def _form_fr(self, fl):
"""Form the generalized active force."""
-
- if not iterable(fl):
+ if not fl or len(fl) ==... | diff --git a/sympy/physics/mechanics/tests/test_kane.py b/sympy/physics/mechanics/tests/test_kane.py
--- a/sympy/physics/mechanics/tests/test_kane.py
+++ b/sympy/physics/mechanics/tests/test_kane.py
@@ -31,6 +31,9 @@
assert expand(rhs[0]) == expand(-(q * k + u * c) / m)
assert (KM.linearize(A_and_B=True, new_... | null | null | namanjain12/sympy_final:0a536f722df2ab8a24a46c6aef77f54bd66965d1 | true | null | 1 | 12 | null | 1,864 | 0 | 0.75 | 1 | 0.75 | 1 | 0.350667 | 84.177 | ||
3,518 | r2e_gym::train::1199 | r2e_gym | train | 1,199 | sympy__9104980668755d0611af1de37d06e8401a0e2f98 | sympy | sympy/sympy | python | 9104980668755d0611af1de37d06e8401a0e2f98 | Title: AttributeError when computing composite dimensional dependencies
Description:
When computing dimensional dependencies for composite expressions involving addition or subtraction of dimensions, the system sometimes returns None instead of a dependency dictionary. For instance, when combining a derived unit with ... | diff --git a/sympy/physics/units/dimensions.py b/sympy/physics/units/dimensions.py
--- a/sympy/physics/units/dimensions.py
+++ b/sympy/physics/units/dimensions.py
@@ -411,6 +411,11 @@
return self.args[2]
def _get_dimensional_dependencies_for_name(self, name):
+ if isinstance(name, Dimension):
+ ... | diff --git a/sympy/physics/units/tests/test_dimensions.py b/sympy/physics/units/tests/test_dimensions.py
--- a/sympy/physics/units/tests/test_dimensions.py
+++ b/sympy/physics/units/tests/test_dimensions.py
@@ -3,7 +3,7 @@
from sympy import S, Symbol, sqrt
from sympy.physics.units.dimensions import Dimension
from sy... | null | null | namanjain12/sympy_final:9104980668755d0611af1de37d06e8401a0e2f98 | true | null | 1 | 18 | null | 1,741 | 0 | 0.75 | 1 | 0.75 | 1 | 0.350167 | 84.1755 | ||
3,519 | r2e_gym::train::6493 | r2e_gym | train | 6,493 | pillow__361f579579ca9cfed40a9bb4fc322e0ea99d60e4 | pillow | python-pillow/pillow | python | 361f579579ca9cfed40a9bb4fc322e0ea99d60e4 | **Incorrect Ordering of iCCP and PLTE Chunks in Saved PNGs**
When saving a PNG image with an ICC profile, the `iCCP` chunk is placed after the `PLTE` chunk. According to the PNG specification, the `iCCP` chunk should appear before the `PLTE` chunk. This incorrect ordering can lead to compatibility issues with some PNG... | diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py
--- a/PIL/PngImagePlugin.py
+++ b/PIL/PngImagePlugin.py
@@ -715,6 +715,18 @@
b'\0', # 11: filter category
b'\0') # 12: interlace flag
+ icc = im.encoderinfo.get("icc_profil... | diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py
--- a/Tests/test_file_png.py
+++ b/Tests/test_file_png.py
@@ -497,6 +497,25 @@
self.assertEqual(repr_png.format, 'PNG')
self.assert_image_equal(im, repr_png)
+ def test_chunk_order(self):
+ im = Image.open("Tests/images/icc_profi... | null | null | namanjain12/pillow_final:361f579579ca9cfed40a9bb4fc322e0ea99d60e4 | true | null | 1 | 24 | null | 1,612 | 0 | 0.75 | 1 | 0.75 | 1 | 0.348667 | 84.171 | ||
3,520 | r2e_gym::train::2463 | r2e_gym | train | 2,463 | sympy__9e80ddf82f9a94f895c1bd244b4f90df16bbc3cf | sympy | sympy/sympy | python | 9e80ddf82f9a94f895c1bd244b4f90df16bbc3cf | Title: IndexError in Cholesky Factorization with Matrix Transpose Addition
Description:
When evaluating the positive semidefiniteness using the Cholesky factorization with pivots, an IndexError occurs for matrices produced by adding a matrix to its transpose. In this case, the internal routine attempts to swap rows an... | diff --git a/sympy/matrices/eigen.py b/sympy/matrices/eigen.py
--- a/sympy/matrices/eigen.py
+++ b/sympy/matrices/eigen.py
@@ -793,14 +793,14 @@
for k in range(M.rows):
pivot = max(range(k, M.rows), key=lambda i: M[i, i])
if pivot > k:
- M[[k, pivot], :] = M[[pivot, k], :]
- ... | diff --git a/sympy/matrices/tests/test_eigen.py b/sympy/matrices/tests/test_eigen.py
--- a/sympy/matrices/tests/test_eigen.py
+++ b/sympy/matrices/tests/test_eigen.py
@@ -4,6 +4,11 @@
from sympy.matrices import eye, Matrix
from sympy.core.singleton import S
from sympy.testing.pytest import raises, XFAIL
+from sympy.... | null | null | namanjain12/sympy_final:9e80ddf82f9a94f895c1bd244b4f90df16bbc3cf | true | null | 1 | 16 | null | 1,766 | 0 | 0.75 | 1 | 0.75 | 1 | 0.347667 | 84.168 | ||
3,521 | r2e_gym::train::2049 | r2e_gym | train | 2,049 | sympy__f091a3cd813623284886ca2e382443cc50402ce5 | sympy | sympy/sympy | python | f091a3cd813623284886ca2e382443cc50402ce5 | Title: Non-numeric Limit Ratio Triggers TypeError in Convergence Check
Description:
When checking the convergence of series, a non-numeric limit ratio can trigger a TypeError. For example, evaluating the convergence of a series with a symbolic ratio (such as in the limit comparison test) leads to an error when perform... | diff --git a/sympy/concrete/summations.py b/sympy/concrete/summations.py
--- a/sympy/concrete/summations.py
+++ b/sympy/concrete/summations.py
@@ -439,10 +439,11 @@
next_sequence_term = sequence_term.xreplace({sym: sym + 1})
ratio = combsimp(powsimp(next_sequence_term/sequence_term))
lim_rati... | diff --git a/sympy/concrete/tests/test_sums_products.py b/sympy/concrete/tests/test_sums_products.py
--- a/sympy/concrete/tests/test_sums_products.py
+++ b/sympy/concrete/tests/test_sums_products.py
@@ -1016,3 +1016,9 @@
assert Sum((-1)**n/sqrt(n), (n, 1, oo)).is_absolutely_convergent() is S.false
assert Sum(... | null | null | namanjain12/sympy_final:f091a3cd813623284886ca2e382443cc50402ce5 | true | null | 1 | 18 | null | 1,722 | 0 | 0.75 | 1 | 0.75 | 1 | 0.347 | 84.166 | ||
3,522 | r2e_gym::train::1239 | r2e_gym | train | 1,239 | sympy__70ac2eeb8c99a72b69f27324e1f542d6f3f0b237 | sympy | sympy/sympy | python | 70ac2eeb8c99a72b69f27324e1f542d6f3f0b237 | Title: Incomplete Coordinate List Now Triggers Error Instead of Auto-Filling Missing Coordinates
Description:
With the recent changes, the gap filling behavior in coordinate generation has been removed. When supplying an incomplete list of generalized coordinates (for example, providing only 2 coordinates for a 3-coor... | diff --git a/sympy/physics/mechanics/joint.py b/sympy/physics/mechanics/joint.py
--- a/sympy/physics/mechanics/joint.py
+++ b/sympy/physics/mechanics/joint.py
@@ -6,7 +6,7 @@
from sympy.physics.mechanics.body import Body
from sympy.physics.vector import (Vector, dynamicsymbols, cross, Point,
... | diff --git a/sympy/physics/mechanics/tests/test_joint.py b/sympy/physics/mechanics/tests/test_joint.py
--- a/sympy/physics/mechanics/tests/test_joint.py
+++ b/sympy/physics/mechanics/tests/test_joint.py
@@ -50,27 +50,27 @@
# Test None
assert J._fill_coordinate_list(None, 1) == Matrix([qj])
assert J._fill... | null | null | namanjain12/sympy_final:70ac2eeb8c99a72b69f27324e1f542d6f3f0b237 | true | null | 1 | 10 | null | 1,875 | 0 | 0.75 | 1 | 0.75 | 1 | 0.345833 | 84.1625 | ||
3,523 | r2e_gym::train::4839 | r2e_gym | train | 4,839 | numpy__34a40a944a4011211104fbbf00b960777a34e982 | numpy | numpy/numpy | python | 34a40a944a4011211104fbbf00b960777a34e982 | **Title:** `read_array_header_*` methods do not return header data, causing unpacking and EOF errors
**Description:**
When using the `read_array_header_1_0` or `read_array_header_2_0` methods to read array headers, the functions fail to return the expected header information. Instead of returning a tuple with the arra... | diff --git a/numpy/lib/format.py b/numpy/lib/format.py
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -314,21 +314,19 @@
header = header + ' '*topad + '\n'
header = asbytes(_filter_header(header))
- if len(header) >= (256*256) and version == (1, 0):
- raise ValueError("header does not fit ... | diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -694,6 +694,26 @@
'',
])
+def test_read_magic():
+ s1 = BytesIO()
+ s2 = BytesIO()
+
+ arr = np.ones((3, 6), dtype=float)
+
+ format.write_array(s... | null | null | namanjain12/numpy_final:34a40a944a4011211104fbbf00b960777a34e982 | true | null | 1 | 28 | null | 1,509 | 0 | 0.75 | 1 | 0.75 | 1 | 0.344833 | 84.1595 | ||
3,524 | r2e_gym::train::4164 | r2e_gym | train | 4,164 | numpy__5856c486ac5dd62a6ac9b2a861aa86802e6e0edd | numpy | numpy/numpy | python | 5856c486ac5dd62a6ac9b2a861aa86802e6e0edd | **Title:** `np.ediff1d` Raises Error on Compatible `to_begin` and `to_end` Casts
**Description:**
When using the `np.ediff1d` function with the `to_begin` and `to_end` parameters, providing values that are compatible under the `same_kind` casting rule results in a `ValueError`. This behavior is inconsistent with other... | diff --git a/doc/release/upcoming_changes/14981.compatibility.rst b/doc/release/upcoming_changes/14981.compatibility.rst
--- a/doc/release/upcoming_changes/14981.compatibility.rst
+++ b/doc/release/upcoming_changes/14981.compatibility.rst
@@ -0,0 +1,10 @@
+`np.ediff1d` casting behaviour with ``to_end`` and ``to_begin``... | diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -2467,8 +2467,11 @@
x = np.array([1, 2, 4, 7, 0], dtype=np.int16)
res = np.ediff1d(x, to_begin=-99, to_end=np.array([88, 99]))
... | null | null | namanjain12/numpy_final:5856c486ac5dd62a6ac9b2a861aa86802e6e0edd | true | null | 2 | 36 | null | 1,348 | 0 | 0.75 | 1 | 0.75 | 1 | 0.344667 | 84.159 | ||
3,525 | r2e_gym::train::1877 | r2e_gym | train | 1,877 | sympy__97237b37a62a9d5db340b30f788e27baf9dacf25 | sympy | sympy/sympy | python | 97237b37a62a9d5db340b30f788e27baf9dacf25 | Title: cdir Parameter as Integer Leads to AttributeError in Leading Term and Limit Evaluations
Description:
When using the cdir parameter as an integer (e.g., 1) in functions that calculate the leading term or limits, the code fails with an AttributeError because it attempts to access the 'is_negative' attribute on an... | diff --git a/sympy/core/expr.py b/sympy/core/expr.py
--- a/sympy/core/expr.py
+++ b/sympy/core/expr.py
@@ -3489,6 +3489,7 @@
elif not symbols:
return self
x = sympify(symbols[0])
+ cdir = sympify(cdir)
if not x.is_symbol:
raise ValueError('expecting a Symbol b... | diff --git a/sympy/core/tests/test_expr.py b/sympy/core/tests/test_expr.py
--- a/sympy/core/tests/test_expr.py
+++ b/sympy/core/tests/test_expr.py
@@ -18,6 +18,7 @@
from sympy.core.sympify import sympify
from sympy.functions.combinatorial.factorials import factorial
from sympy.functions.elementary.exponential import... | null | null | namanjain12/sympy_final:97237b37a62a9d5db340b30f788e27baf9dacf25 | true | null | 2 | 7 | null | 1,928 | 0 | 0.75 | 1 | 0.75 | 1 | 0.344667 | 84.159 | ||
3,526 | swe_bench::test::2167 | swe_bench | test | 2,167 | sympy__sympy-18630 | sympy/sympy | sympy/sympy | python | 44664d9f625a1c68bc492006cfe1012cb0b49ee4 | AttributeError: integrate(1 / (1 + x**4)**(S(1)/4), [x, 0, oo])
```
>>> from sympy import *
>>> x = Symbol('x')
>>> integrate(1 / (1 + x**4)**(S(1)/4), [x, 0, oo])
Traceback (most recent call last):
File "test.py", line 40, in <module>
print(integrate(1 / (1 + x**4)**(S(1)/4), [x, 0, oo]))
File "/home/eward/se/... | It seems that `hyper` (and other special functions) should have a private `_eval_nseries` method implemented.
I would like to work on this. Could someone please guide where should i start.
I would start by studying the existing implementations. Those can be found by running `git grep 'def _eval_nseries'`.
Why are the f... | diff --git a/sympy/functions/special/hyper.py b/sympy/functions/special/hyper.py
--- a/sympy/functions/special/hyper.py
+++ b/sympy/functions/special/hyper.py
@@ -220,6 +220,34 @@ def _eval_rewrite_as_Sum(self, ap, bq, z, **kwargs):
return Piecewise((Sum(coeff * z**n / factorial(n), (n, 0, oo)),
... | diff --git a/sympy/functions/special/tests/test_hyper.py b/sympy/functions/special/tests/test_hyper.py
--- a/sympy/functions/special/tests/test_hyper.py
+++ b/sympy/functions/special/tests/test_hyper.py
@@ -341,10 +341,7 @@ def test_meijerg_eval():
def test_limits():
k, x = symbols('k, x')
assert hyper((1,),... | ["test_limits"] | ["test_TupleParametersBase", "test_hyper", "test_expand_func", "test_hyper_rewrite_sum", "test_radius_of_convergence", "test_meijer", "test_meijerg_derivative", "test_meijerg_period", "test_hyper_unpolarify", "test_appellf1", "test_derivative_appellf1"] | null | true | 2020-02-10T20:55:10Z | 1 | 28 | 1 | 3,454 | 0 | 0.8 | 1 | 0.62 | 1 | 0.593333 | 84.15 | |
3,527 | r2e_gym::train::1644 | r2e_gym | train | 1,644 | sympy__7486fb03a867c9c3e9ba7d5b010756202e29beca | sympy | sympy/sympy | python | 7486fb03a867c9c3e9ba7d5b010756202e29beca | Title: Incorrect Handling of Empty Domain and Invalid Symbol in Maximum/Minimum
Description:
When calling the maximum or minimum functions with an empty domain or with an invalid symbol, the functions fail to raise an error as expected. For example, when using an empty set as the domain, the function should raise a Va... | diff --git a/sympy/calculus/util.py b/sympy/calculus/util.py
--- a/sympy/calculus/util.py
+++ b/sympy/calculus/util.py
@@ -789,10 +789,13 @@
1/2
"""
- if isinstance(domain, EmptySet):
- return S.EmptySet
-
- return function_range(f, symbol, domain).sup
+ if type(symbol) == Symbol:
+ i... | diff --git a/sympy/calculus/tests/test_util.py b/sympy/calculus/tests/test_util.py
--- a/sympy/calculus/tests/test_util.py
+++ b/sympy/calculus/tests/test_util.py
@@ -236,6 +236,13 @@
assert maximum(cos(x)-sin(x), x, S.Reals) == sqrt(2)
assert maximum(y, x, S.Reals) == y
+ raises(ValueError, lambda : max... | null | null | namanjain12/sympy_final:7486fb03a867c9c3e9ba7d5b010756202e29beca | true | null | 1 | 22 | null | 1,603 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3405 | 84.1465 | ||
3,528 | r2e_gym::train::965 | r2e_gym | train | 965 | sympy__319769964c4f3fa3839b90f5764709736717e2cd | sympy | sympy/sympy | python | 319769964c4f3fa3839b90f5764709736717e2cd | Title: Incorrect indexing in MultivariateNormal density leads to TypeError with symbolic parameters
Description:
When using symbolic parameters with the MultivariateNormal distribution, evaluating its density sometimes raises a TypeError. In this scenario, trying to index the result of the exponential expression cause... | diff --git a/sympy/stats/joint_rv_types.py b/sympy/stats/joint_rv_types.py
--- a/sympy/stats/joint_rv_types.py
+++ b/sympy/stats/joint_rv_types.py
@@ -4,6 +4,7 @@
Intersection, Matrix, symbols, Product, IndexedBase)
from sympy.matrices import ImmutableMatrix, MatrixSymbol
from sympy.matrices.expre... | diff --git a/sympy/stats/tests/test_joint_rv.py b/sympy/stats/tests/test_joint_rv.py
--- a/sympy/stats/tests/test_joint_rv.py
+++ b/sympy/stats/tests/test_joint_rv.py
@@ -1,9 +1,11 @@
from sympy import (symbols, pi, oo, S, exp, sqrt, besselk, Indexed, Sum, simplify,
Rational, factorial, gamma, Piec... | null | null | namanjain12/sympy_final:319769964c4f3fa3839b90f5764709736717e2cd | true | null | 1 | 29 | null | 1,463 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3405 | 84.1465 | ||
3,529 | r2e_gym::train::2162 | r2e_gym | train | 2,162 | sympy__c0993ea7b111efb35d48697148230b7a84cd5fc9 | sympy | sympy/sympy | python | c0993ea7b111efb35d48697148230b7a84cd5fc9 | Title: LaTeX Parsing Module Failing with ImportError After Merge
Description:
It appears that after merging the recent changes (commit c0993ea7b111efb35d48697148230b7a84cd5fc9) related to a more cautious treatment of coefficient evaluation, the LaTeX parsing functionality now fails with an ImportError. For example, wh... | diff --git a/sympy/core/mul.py b/sympy/core/mul.py
--- a/sympy/core/mul.py
+++ b/sympy/core/mul.py
@@ -2050,24 +2050,24 @@
>>> _keep_coeff(S(-1), x + y, sign=True)
-(x + y)
"""
-
if not coeff.is_Number:
if factors.is_Number:
factors, coeff = coeff, factors
else:
... | diff --git a/sympy/parsing/tests/test_latex.py b/sympy/parsing/tests/test_latex.py
--- a/sympy/parsing/tests/test_latex.py
+++ b/sympy/parsing/tests/test_latex.py
@@ -76,8 +76,8 @@
GOOD_PAIRS = [
(r"0", 0),
(r"1", 1),
- (r"-3.14", _Mul(-1, 3.14)),
- (r"(-7.13)(1.5)", _Mul(_Mul(-1, 7.13), 1.5)),
+ (r... | null | null | namanjain12/sympy_final:c0993ea7b111efb35d48697148230b7a84cd5fc9 | true | null | 3 | 29 | null | 1,459 | 0 | 0.75 | 1 | 0.75 | 1 | 0.339833 | 84.1445 | ||
3,530 | r2e_gym::train::1977 | r2e_gym | train | 1,977 | sympy__2b2e1def46b9090cef164f2eace14da76f765159 | sympy | sympy/sympy | python | 2b2e1def46b9090cef164f2eace14da76f765159 | Title: Inconsistent Handling of UndefinedFunction in Limit and MRV Computations
Description:
When using an undefined function in series-related computations, the behavior differs between the limit routine and the MRV (Most Rapidly Varying) computation. For instance, when an expression like f(x) (where f is an undefine... | diff --git a/sympy/series/gruntz.py b/sympy/series/gruntz.py
--- a/sympy/series/gruntz.py
+++ b/sympy/series/gruntz.py
@@ -120,6 +120,7 @@
from sympy.core import Basic, S, Mul, PoleError
from sympy.core.cache import cacheit
+from sympy.core.function import UndefinedFunction
from sympy.core.intfunc import ilcm
fro... | diff --git a/sympy/series/tests/test_gruntz.py b/sympy/series/tests/test_gruntz.py
--- a/sympy/series/tests/test_gruntz.py
+++ b/sympy/series/tests/test_gruntz.py
@@ -1,4 +1,5 @@
from sympy.core import EulerGamma
+from sympy.core.function import Function
from sympy.core.numbers import (E, I, Integer, Rational, oo, pi... | null | null | namanjain12/sympy_final:2b2e1def46b9090cef164f2eace14da76f765159 | true | null | 2 | 6 | null | 1,916 | 0 | 0.75 | 1 | 0.75 | 1 | 0.339333 | 84.143 | ||
3,531 | r2e_gym::train::606 | r2e_gym | train | 606 | sympy__801e149d69d5f88919a735f8b55b6024f97c6950 | sympy | sympy/sympy | python | 801e149d69d5f88919a735f8b55b6024f97c6950 | Title: TypeError in parallel_axis method when providing a reference frame
Description:
When using the parallel_axis method with an optional reference frame, the method fails with a TypeError. Consider the following example:
```
from sympy.physics.mechanics import Point, ReferenceFrame, RigidBody, inertia
import sympy... | diff --git a/sympy/physics/mechanics/rigidbody.py b/sympy/physics/mechanics/rigidbody.py
--- a/sympy/physics/mechanics/rigidbody.py
+++ b/sympy/physics/mechanics/rigidbody.py
@@ -4,7 +4,6 @@
from sympy.utilities.exceptions import sympy_deprecation_warning
__all__ = ['RigidBody']
-
class RigidBody:
@@ -329,9 +3... | diff --git a/sympy/physics/mechanics/tests/test_rigidbody.py b/sympy/physics/mechanics/tests/test_rigidbody.py
--- a/sympy/physics/mechanics/tests/test_rigidbody.py
+++ b/sympy/physics/mechanics/tests/test_rigidbody.py
@@ -2,7 +2,7 @@
from sympy.physics.mechanics import Point, ReferenceFrame, Dyadic, RigidBody
from s... | null | null | namanjain12/sympy_final:801e149d69d5f88919a735f8b55b6024f97c6950 | true | null | 1 | 17 | null | 1,689 | 0 | 0.75 | 1 | 0.75 | 1 | 0.338167 | 84.1395 | ||
3,532 | r2e_gym::train::978 | r2e_gym | train | 978 | sympy__f8c1f50d1ff15dbfc311fc10574cfd3b073c6082 | sympy | sympy/sympy | python | f8c1f50d1ff15dbfc311fc10574cfd3b073c6082 | Title: Piecewise rewriting for Max/Min fails with non-real symbols
Description:
After the recent removal of the real-value check in the rewriting of Max/Min to Piecewise, the behavior for symbols not explicitly declared as real does not match expectations. When using symbols with no real assumption, rewriting expressi... | diff --git a/sympy/functions/elementary/miscellaneous.py b/sympy/functions/elementary/miscellaneous.py
--- a/sympy/functions/elementary/miscellaneous.py
+++ b/sympy/functions/elementary/miscellaneous.py
@@ -744,9 +744,7 @@
for j in args])
def _eval_rewrite_as_Piecewise(self, *args, **kwargs):
- ... | diff --git a/sympy/functions/elementary/tests/test_miscellaneous.py b/sympy/functions/elementary/tests/test_miscellaneous.py
--- a/sympy/functions/elementary/tests/test_miscellaneous.py
+++ b/sympy/functions/elementary/tests/test_miscellaneous.py
@@ -384,9 +384,9 @@
assert Min(x, y, a, b).rewrite(Piecewise) == P... | null | null | namanjain12/sympy_final:f8c1f50d1ff15dbfc311fc10574cfd3b073c6082 | true | null | 1 | 8 | null | 1,869 | 0 | 0.75 | 1 | 0.75 | 1 | 0.338167 | 84.1395 | ||
3,533 | r2e_gym::train::4125 | r2e_gym | train | 4,125 | numpy__144197146dec4097baa2783fdd28762015d0e32b | numpy | numpy/numpy | python | 144197146dec4097baa2783fdd28762015d0e32b | **Analysis:**
- **Key Parts:**
- **Commit Message:** "BUG: IndexError for empty list on structured MaskedArray.."
- **Test Result Before Commit:** The test `test_empty_list_on_structured` failed with an `IndexError: too many indices for array`.
- **Test Result After Commit:** All tests pass, including `test_empt... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -780,7 +780,7 @@
def is_string_or_list_of_strings(val):
return (isinstance(val, basestring) or
- (isinstance(val, list) and
+ (isinstance(val, list) and val and
builtins.all(isin... | diff --git a/numpy/ma/tests/test_regression.py b/numpy/ma/tests/test_regression.py
--- a/numpy/ma/tests/test_regression.py
+++ b/numpy/ma/tests/test_regression.py
@@ -84,3 +84,8 @@
assert_(a.mask.shape == (2,))
assert_(b.shape == (2, 2))
assert_(b.mask.shape == (2, 2))
+
+ def test_empty_l... | null | null | namanjain12/numpy_final:144197146dec4097baa2783fdd28762015d0e32b | true | null | 1 | 6 | null | 1,903 | 0 | 0.75 | 1 | 0.75 | 1 | 0.337167 | 84.1365 | ||
3,534 | swe_bench::test::2019 | swe_bench | test | 2,019 | sympy__sympy-14207 | sympy/sympy | sympy/sympy | python | 9ebcce18bd0ea331b55b8538d2c45e56a3821715 | Necessary parenthesis in printing of some multiplications
Reproducer:
```
from sympy import *
a = Symbol('a')
u = Symbol('u')
a2inv = Pow(Mul(a,a,evaluate=False), -1, evaluate=False)
d = Mul(-2, u, a2inv, evaluate=False)
print("This should be -2*u/(a*a)")
print(d)
```
Output:
```
This should be -2*u/(a*a)
-2*u/a*... | diff --git a/sympy/printing/codeprinter.py b/sympy/printing/codeprinter.py
--- a/sympy/printing/codeprinter.py
+++ b/sympy/printing/codeprinter.py
@@ -420,6 +420,8 @@ def _print_Mul(self, expr):
a = [] # items in the numerator
b = [] # items that are in the denominator (if any)
+ pow_paren ... | diff --git a/sympy/printing/tests/test_ccode.py b/sympy/printing/tests/test_ccode.py
--- a/sympy/printing/tests/test_ccode.py
+++ b/sympy/printing/tests/test_ccode.py
@@ -1,6 +1,6 @@
import warnings
-from sympy.core import (S, pi, oo, symbols, Rational, Integer, Float, Mod,
- GoldenRatio, EulerG... | ["test_ccode_Pow", "test_Mul"] | ["test_printmethod", "test_ccode_sqrt", "test_ccode_Max", "test_ccode_constants_mathh", "test_ccode_constants_other", "test_ccode_Rational", "test_ccode_Integer", "test_ccode_functions", "test_ccode_inline_function", "test_ccode_exceptions", "test_ccode_user_functions", "test_ccode_boolean", "test_ccode_Relational", "t... | null | true | 2018-02-14T17:34:16Z | 4 | 36 | 2 | 826 | 0 | 0.8 | 1 | 0.85 | 0.85 | 0.257667 | 84.1355 | ||
3,535 | r2e_gym::train::537 | r2e_gym | train | 537 | sympy__084b39efe9fec1683c4958d37ff5b8ee16428b1d | sympy | sympy/sympy | python | 084b39efe9fec1683c4958d37ff5b8ee16428b1d | Title: TypeError when sorting vertices from Polygon objects in integration routine
Description:
When integrating a polygon, the function responsible for sorting the polygon’s vertices fails with a TypeError. For instance, when the integration routine is called with a polygon-like object, an error occurs because the co... | diff --git a/sympy/integrals/intpoly.py b/sympy/integrals/intpoly.py
--- a/sympy/integrals/intpoly.py
+++ b/sympy/integrals/intpoly.py
@@ -62,9 +62,9 @@
clockwise = kwargs.get('clockwise', False)
max_degree = kwargs.get('max_degree', None)
- if clockwise is True:
+ if clockwise:
if isinstance... | diff --git a/sympy/integrals/tests/test_intpoly.py b/sympy/integrals/tests/test_intpoly.py
--- a/sympy/integrals/tests/test_intpoly.py
+++ b/sympy/integrals/tests/test_intpoly.py
@@ -3,11 +3,11 @@
from sympy.core import S
from sympy.integrals.intpoly import (decompose, best_origin,
- ... | null | null | namanjain12/sympy_final:084b39efe9fec1683c4958d37ff5b8ee16428b1d | true | null | 1 | 25 | null | 1,519 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3365 | 84.1345 | ||
3,536 | r2e_gym::train::6550 | r2e_gym | train | 6,550 | pillow__a7f5b25dc3008f7dbb6a190f5af66cedd0579f61 | pillow | python-pillow/pillow | python | a7f5b25dc3008f7dbb6a190f5af66cedd0579f61 | **Title:** GIF `save_all` with palette incorrectly includes palette with each frame, causing EOFError
**Description:**
When saving a GIF with multiple frames using the `save_all=True` option and specifying a palette, the palette is being included with each frame. This leads to an `EOFError` when attempting to access s... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -414,9 +414,26 @@
source_palette = bytearray(i // 3 for i in range(768))
im.palette = ImagePalette.ImagePalette("RGB", palette=source_palette)
- used_palette_c... | diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py
--- a/Tests/test_file_gif.py
+++ b/Tests/test_file_gif.py
@@ -821,6 +821,29 @@
assert_image_equal(reloaded, im)
+def test_palette_save_all_P(tmp_path):
+ frames = []
+ colors = ((255, 0, 0), (0, 255, 0))
+ for color in colors:
+ f... | null | null | namanjain12/pillow_final:a7f5b25dc3008f7dbb6a190f5af66cedd0579f61 | true | null | 1 | 26 | null | 1,496 | 0 | 0.75 | 1 | 0.75 | 1 | 0.336 | 84.133 | ||
3,537 | r2e_gym::train::952 | r2e_gym | train | 952 | sympy__a970aa97d58eb8f548829ecf8cd3a33ce2481933 | sympy | sympy/sympy | python | a970aa97d58eb8f548829ecf8cd3a33ce2481933 | Title: nextprime does not raise ValueError for non-positive ith values
Description:
When calling nextprime with a non-positive value for the ith argument, the function does not behave as expected. Instead of raising a ValueError, it returns a result. For example, using a value of 0 for ith should trigger an error, but... | diff --git a/sympy/ntheory/generate.py b/sympy/ntheory/generate.py
--- a/sympy/ntheory/generate.py
+++ b/sympy/ntheory/generate.py
@@ -544,7 +544,23 @@
def nextprime(n, ith=1):
""" Return the ith prime greater than n.
- i must be an integer.
+ Parameters
+ ==========
+
+ n : integer
... | diff --git a/sympy/ntheory/tests/test_generate.py b/sympy/ntheory/tests/test_generate.py
--- a/sympy/ntheory/tests/test_generate.py
+++ b/sympy/ntheory/tests/test_generate.py
@@ -129,6 +129,16 @@
assert nextprime(90) == 97
assert nextprime(10**40) == (10**40 + 121)
+ primelist = [2, 3, 5, 7, 11, 13, 17, ... | null | null | namanjain12/sympy_final:a970aa97d58eb8f548829ecf8cd3a33ce2481933 | true | null | 1 | 48 | null | 1,049 | 0 | 0.75 | 1 | 0.75 | 1 | 0.334833 | 84.1295 | ||
3,538 | r2e_gym::train::4912 | r2e_gym | train | 4,912 | datalad__d5569a647e7bb731c4363b658556e5f7a2bfe683 | datalad | datalad/datalad | python | d5569a647e7bb731c4363b658556e5f7a2bfe683 | **Title:** Missing `get_subpaths` Function Causes AttributeError When Processing Filenames with Double Slashes
**Description:**
When processing filenames that contain double slashes (`"//"`), the system attempts to use the `get_subpaths` function to extract subpaths. However, the `addurls` module does not have the `ge... | diff --git a/datalad/plugin/addurls.py b/datalad/plugin/addurls.py
--- a/datalad/plugin/addurls.py
+++ b/datalad/plugin/addurls.py
@@ -90,6 +90,36 @@
continue
yield field + "=" + value
+
+
+def get_subpaths(filename):
+ """Convert "//" marker in `filename` to a list of subpaths.
+
+ >>> ge... | diff --git a/datalad/plugin/tests/test_addurls.py b/datalad/plugin/tests/test_addurls.py
--- a/datalad/plugin/tests/test_addurls.py
+++ b/datalad/plugin/tests/test_addurls.py
@@ -74,6 +74,16 @@
addurls.clean_meta_args(["=value"]))
+def test_get_subpaths():
+ for fname, expect in [("no/dbl/slas... | null | null | namanjain12/datalad_final:d5569a647e7bb731c4363b658556e5f7a2bfe683 | true | null | 1 | 44 | null | 1,110 | 0 | 0.75 | 1 | 0.75 | 1 | 0.331667 | 84.12 | ||
3,539 | swe_bench::test::1611 | swe_bench | test | 1,611 | scikit-learn__scikit-learn-13620 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | f9af18b4e5b9d4b379867d32381296062782dc15 | Bug in Gradient Boosting: Feature Importances do not sum to 1
#### Description
I found conditions when Feature Importance values do not add up to 1 in ensemble tree methods, like Gradient Boosting Trees or AdaBoost Trees.
This error occurs once the ensemble reaches a large number of estimators. The exact conditions ... | thanks for the report. ping @pprett ?
Observation:
The estimators with feature importance sum 0 have only 1 node which is being caused by the following [code](https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/tree/_tree.pyx#L228-L229)
`is_leaf = (is_leaf or (impurity <= min_impurity_split))`
`is_leaf` ... | diff --git a/sklearn/ensemble/gradient_boosting.py b/sklearn/ensemble/gradient_boosting.py
--- a/sklearn/ensemble/gradient_boosting.py
+++ b/sklearn/ensemble/gradient_boosting.py
@@ -1709,17 +1709,26 @@ def feature_importances_(self):
Returns
-------
feature_importances_ : array, shape (n_fea... | diff --git a/sklearn/ensemble/tests/test_gradient_boosting.py b/sklearn/ensemble/tests/test_gradient_boosting.py
--- a/sklearn/ensemble/tests/test_gradient_boosting.py
+++ b/sklearn/ensemble/tests/test_gradient_boosting.py
@@ -1440,3 +1440,12 @@ def test_early_stopping_n_classes():
# No error if we let training da... | ["sklearn/ensemble/tests/test_gradient_boosting.py::test_gbr_degenerate_feature_importances"] | ["sklearn/ensemble/tests/test_gradient_boosting.py::test_classification_toy[deviance-auto]", "sklearn/ensemble/tests/test_gradient_boosting.py::test_classification_toy[deviance-True]", "sklearn/ensemble/tests/test_gradient_boosting.py::test_classification_toy[deviance-False]", "sklearn/ensemble/tests/test_gradient_boos... | null | true | 2019-04-11T16:46:24Z | 1 | 25 | 1 | 3,094 | 0 | 0.8 | 1 | 0.62 | 1 | 0.583333 | 84.12 | |
3,540 | r2e_gym::train::4374 | r2e_gym | train | 4,374 | numpy__5c7c696db3441ada1d66a26d907d39f2a5ae5049 | numpy | numpy/numpy | python | 5c7c696db3441ada1d66a26d907d39f2a5ae5049 | **[ISSUE]**
**Title:** `numpy.poly1d` Raises `ValueError` Instead of `LinAlgError` When Coefficients Contain NaNs
**Description:**
When creating a `numpy.poly1d` object with coefficients that include `NaN` values and attempting to access its roots, a `ValueError` is raised instead of the more specific `LinAlgError`. ... | diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -31,7 +31,6 @@
from numpy.core.overrides import set_module
from numpy.core import overrides
from numpy.lib.twodim_base import triu, eye
-from numpy.lib.function_base import asarray_chkfinite
fro... | diff --git a/numpy/lib/tests/test_regression.py b/numpy/lib/tests/test_regression.py
--- a/numpy/lib/tests/test_regression.py
+++ b/numpy/lib/tests/test_regression.py
@@ -53,7 +53,7 @@
def test_poly1d_nan_roots(self):
# Ticket #396
p = np.poly1d([np.nan, np.nan, 1], r=False)
- assert_raise... | null | null | namanjain12/numpy_final:5c7c696db3441ada1d66a26d907d39f2a5ae5049 | true | null | 1 | 14 | null | 1,710 | 0 | 0.75 | 1 | 0.75 | 1 | 0.331667 | 84.12 | ||
3,541 | r2e_gym::train::2480 | r2e_gym | train | 2,480 | sympy__c249a9aeea7d61146ff3bdcc8d53b6f584a2ea39 | sympy | sympy/sympy | python | c249a9aeea7d61146ff3bdcc8d53b6f584a2ea39 | Title: DomainMatrix to_sparse and to_dense Methods Lack Expected rep Attribute
Description:
When converting a DomainMatrix to its sparse or dense representation, the output is expected to retain a rep attribute containing the internal data. For example, a conversion to sparse should provide a representation like:
```
... | diff --git a/sympy/polys/matrices/domainmatrix.py b/sympy/polys/matrices/domainmatrix.py
--- a/sympy/polys/matrices/domainmatrix.py
+++ b/sympy/polys/matrices/domainmatrix.py
@@ -323,11 +323,11 @@
>>> from sympy.polys.matrices import DomainMatrix
>>> from sympy import QQ
- >>> A = DomainMatri... | diff --git a/sympy/polys/matrices/tests/test_domainmatrix.py b/sympy/polys/matrices/tests/test_domainmatrix.py
--- a/sympy/polys/matrices/tests/test_domainmatrix.py
+++ b/sympy/polys/matrices/tests/test_domainmatrix.py
@@ -113,6 +113,17 @@
Aq = A.to_field()
assert Aq == DomainMatrix([[QQ(1), QQ(2)], [QQ(3), Q... | null | null | namanjain12/sympy_final:c249a9aeea7d61146ff3bdcc8d53b6f584a2ea39 | true | null | 1 | 10 | null | 1,782 | 0 | 0.75 | 1 | 0.75 | 1 | 0.330333 | 84.116 | ||
3,542 | r2e_gym::train::1349 | r2e_gym | train | 1,349 | sympy__f3d3927bfc6799d0d93d56c4bde4702ff59be440 | sympy | sympy/sympy | python | f3d3927bfc6799d0d93d56c4bde4702ff59be440 | Title: Rational Expression Input Causes Unexpected TypeError in diophantine()
Description:
When passing a rational expression (for example, 1/x) to the diophantine() function, it currently raises a TypeError with the message "Equation should be a polynomial with Rational coefficients." According to expectations, ratio... | diff --git a/doc/src/modules/solvers/diophantine.rst b/doc/src/modules/solvers/diophantine.rst
--- a/doc/src/modules/solvers/diophantine.rst
+++ b/doc/src/modules/solvers/diophantine.rst
@@ -229,7 +229,7 @@
>>> diop_DN(5, 920)
[]
-Unfortunately, our equation does not have solutions.
+Unfortunately, our equation has... | diff --git a/sympy/solvers/tests/test_diophantine.py b/sympy/solvers/tests/test_diophantine.py
--- a/sympy/solvers/tests/test_diophantine.py
+++ b/sympy/solvers/tests/test_diophantine.py
@@ -486,6 +486,11 @@
# solvers have not been written for every type
raises(NotImplementedError, lambda: diophantine(x*y**2 ... | null | null | namanjain12/sympy_final:f3d3927bfc6799d0d93d56c4bde4702ff59be440 | true | null | 2 | 27 | null | 1,434 | 0 | 0.75 | 1 | 0.75 | 1 | 0.329 | 84.112 | ||
3,543 | r2e_gym::train::159 | r2e_gym | train | 159 | orange3__5d83588c15c96200008fdbf52fabbf2b207b072d | orange3 | biolab/orange3 | python | 5d83588c15c96200008fdbf52fabbf2b207b072d | **Title:** Mode Calculation Fails When All Group Values Are NaN
**Description:**
When performing a group-by operation where all values in a group are `NaN`, calculating the mode results in an error instead of returning `NaN`. This issue causes the data processing to fail unexpectedly.
**Example Buggy Code:**
```pytho... | diff --git a/Orange/widgets/data/owgroupby.py b/Orange/widgets/data/owgroupby.py
--- a/Orange/widgets/data/owgroupby.py
+++ b/Orange/widgets/data/owgroupby.py
@@ -5,6 +5,7 @@
from typing import Any, Dict, List, Optional, Set
import pandas as pd
+from numpy import nan
from AnyQt.QtCore import (
QAbstractTableM... | diff --git a/Orange/widgets/data/tests/test_owgroupby.py b/Orange/widgets/data/tests/test_owgroupby.py
--- a/Orange/widgets/data/tests/test_owgroupby.py
+++ b/Orange/widgets/data/tests/test_owgroupby.py
@@ -12,6 +12,8 @@
from Orange.data import (
Table,
table_to_frame,
+ Domain,
+ ContinuousVariable,
... | null | null | namanjain12/orange3_final:5d83588c15c96200008fdbf52fabbf2b207b072d | true | null | 1 | 10 | null | 1,771 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3285 | 84.1105 | ||
3,544 | r2e_gym::train::4804 | r2e_gym | train | 4,804 | numpy__3b3eaa60dc31677d1b19cb49e5c414d41ac4089a | numpy | numpy/numpy | python | 3b3eaa60dc31677d1b19cb49e5c414d41ac4089a | **Title:** `np.unique` Fails to Correctly Process 3D Arrays with `axis=2`
**Description:**
When using `np.unique` on a 3D array with `axis=2`, the function does not return the expected unique elements, resulting in incorrect array outputs.
**Example Code:**
```python
import numpy as np
# Define a 3D array
data3d = n... | diff --git a/doc/release/upcoming_changes/14255.improvement.rst b/doc/release/upcoming_changes/14255.improvement.rst
--- a/doc/release/upcoming_changes/14255.improvement.rst
+++ b/doc/release/upcoming_changes/14255.improvement.rst
@@ -0,0 +1,4 @@
+`unique` has consistent axes order (except the chosen one) when `axis` i... | diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -600,8 +600,11 @@
assert_array_equal(unique(data, axis=1), result.astype(dtype), msg)
msg = 'Unique with 3d array and axis=2 f... | null | null | namanjain12/numpy_final:3b3eaa60dc31677d1b19cb49e5c414d41ac4089a | true | null | 2 | 8 | null | 1,810 | 0 | 0.75 | 1 | 0.75 | 1 | 0.328333 | 84.11 | ||
3,545 | r2e_gym::train::1099 | r2e_gym | train | 1,099 | sympy__e466e851aa84e4d47718a9f79ed5f81451370a83 | sympy | sympy/sympy | python | e466e851aa84e4d47718a9f79ed5f81451370a83 | Title: adjugate and charpoly functions raise NotImplementedError for immutable matrix types
Description:
When using immutable matrix types with the adjugate and charpoly functions, the functions mistakenly treat them as matrix expressions and raise a NotImplementedError. For example, using an ImmutableDenseMatrix as i... | diff --git a/sympy/matrices/determinant.py b/sympy/matrices/determinant.py
--- a/sympy/matrices/determinant.py
+++ b/sympy/matrices/determinant.py
@@ -924,13 +924,17 @@
# this is clearer.
def adjugate(M, method="berkowitz", dotprodsimp=None):
- if isinstance(M, Expr):
+ from .matrices import MatrixBase
+
+ ... | diff --git a/sympy/matrices/tests/test_determinant.py b/sympy/matrices/tests/test_determinant.py
--- a/sympy/matrices/tests/test_determinant.py
+++ b/sympy/matrices/tests/test_determinant.py
@@ -25,6 +25,9 @@
assert isinstance(R, ImmutableSparseMatrix)
assert R == A
+ assert adjugate(ImmutableDenseMatrix... | null | null | namanjain12/sympy_final:e466e851aa84e4d47718a9f79ed5f81451370a83 | true | null | 1 | 15 | null | 1,656 | 0 | 0.75 | 1 | 0.75 | 1 | 0.326 | 84.103 | ||
3,546 | r2e_gym::train::6412 | r2e_gym | train | 6,412 | pillow__77da73c90fc9d3d5715ccf1361bda311350a394f | pillow | python-pillow/pillow | python | 77da73c90fc9d3d5715ccf1361bda311350a394f | **Title:** Verifying malformed PNG files raises `struct.error` instead of `SyntaxError`
**Description:**
When verifying a PNG file with incomplete or corrupted chunks, a `struct.error` is raised instead of a more descriptive `SyntaxError`. This makes it difficult to identify and handle issues related to malformed PNG ... | diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py
--- a/PIL/PngImagePlugin.py
+++ b/PIL/PngImagePlugin.py
@@ -36,6 +36,7 @@
import logging
import re
import zlib
+import struct
from PIL import Image, ImageFile, ImagePalette, _binary
@@ -106,17 +107,20 @@
def read(self):
"Fetch a new chun... | diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py
--- a/Tests/test_file_png.py
+++ b/Tests/test_file_png.py
@@ -252,6 +252,22 @@
im = Image.open(TEST_PNG_FILE)
im.load()
self.assertRaises(RuntimeError, im.verify)
+
+ def test_verify_struct_error(self):
+ # Check open/load... | null | null | namanjain12/pillow_final:77da73c90fc9d3d5715ccf1361bda311350a394f | true | null | 1 | 40 | null | 1,139 | 0 | 0.75 | 1 | 0.75 | 1 | 0.323167 | 84.0945 | ||
3,547 | r2e_gym::train::2754 | r2e_gym | train | 2,754 | sympy__9fc54369ebbf9694e1e504b111f867e80fcd6079 | sympy | sympy/sympy | python | 9fc54369ebbf9694e1e504b111f867e80fcd6079 | Title: Series expansion fails for logarithmic singularity with multiple symbols
Description:
When expanding series for expressions that combine symbolic exponents, such as those involving logarithmic singularities, the series algorithm fails. For example, consider the following minimal code snippet:
```
from sympy im... | diff --git a/sympy/series/formal.py b/sympy/series/formal.py
--- a/sympy/series/formal.py
+++ b/sympy/series/formal.py
@@ -23,6 +23,7 @@
from sympy.functions.elementary.piecewise import Piecewise
from sympy.series.limits import Limit
from sympy.series.order import Order
+from sympy.simplify.powsimp import powsimp
f... | diff --git a/sympy/series/tests/test_formal.py b/sympy/series/tests/test_formal.py
--- a/sympy/series/tests/test_formal.py
+++ b/sympy/series/tests/test_formal.py
@@ -408,8 +408,12 @@
O((1/x)**(-n)/x**6, (x, oo)))
f = x**(n/2)*cos(x)
- assert fps(f,x).truncate() == \
+ assert fps(f, x).truncate()... | null | null | namanjain12/sympy_final:9fc54369ebbf9694e1e504b111f867e80fcd6079 | true | null | 1 | 8 | null | 1,776 | 0 | 0.75 | 1 | 0.75 | 1 | 0.322667 | 84.093 | ||
3,548 | swe_bench::test::1363 | swe_bench | test | 1,363 | pylint-dev__pylint-8124 | pylint-dev/pylint | pylint-dev/pylint | python | eb950615d77a6b979af6e0d9954fdb4197f4a722 | false positive 'useless-import-alias' error for mypy-compatible explicit re-exports
### Bug description
Suppose a package has the following layout:
```console
package/
_submodule1.py # defines Api1
_submodule2.py # defines Api2
__init__.py # imports and re-exports Api1 and Api2
```
Since the submodules her... | > The reason for the as aliases here is to be explicit that these imports are for the purpose of re-export (without having to resort to defining __all__, which is error-prone).
I think ``__all__``is the way to be explicit about the API of a module.That way you have the API documented in one place at the top of the m... | diff --git a/pylint/checkers/imports.py b/pylint/checkers/imports.py
--- a/pylint/checkers/imports.py
+++ b/pylint/checkers/imports.py
@@ -439,6 +439,15 @@ class ImportsChecker(DeprecatedMixin, BaseChecker):
"help": "Allow wildcard imports from modules that define __all__.",
},
),... | diff --git a/tests/checkers/unittest_imports.py b/tests/checkers/unittest_imports.py
--- a/tests/checkers/unittest_imports.py
+++ b/tests/checkers/unittest_imports.py
@@ -137,3 +137,46 @@ def test_preferred_module(capsys: CaptureFixture[str]) -> None:
assert "Prefer importing 'sys' instead of 'os'" in output
... | ["tests/checkers/unittest_imports.py::TestImportsChecker::test_allow_reexport_package"] | ["tests/checkers/unittest_imports.py::TestImportsChecker::test_relative_beyond_top_level", "tests/checkers/unittest_imports.py::TestImportsChecker::test_relative_beyond_top_level_two", "tests/checkers/unittest_imports.py::TestImportsChecker::test_relative_beyond_top_level_three", "tests/checkers/unittest_imports.py::Te... | null | true | 2023-01-27T23:46:57Z | 1 | 22 | 1 | 5,736 | 0 | 0.8 | 1 | 0.62 | 1 | 0.573333 | 84.09 | |
3,549 | r2e_gym::train::5173 | r2e_gym | train | 5,173 | pyramid__7a2b72c2ba018d6b75ee151843e37da67bbfc2bb | pyramid | pylons/pyramid | python | 7a2b72c2ba018d6b75ee151843e37da67bbfc2bb | **Title:** Passing `principal` Argument to `remember()` Raises TypeError
**Description:**
When attempting to use the deprecated `principal` argument with the `remember()` function, a `TypeError` is raised indicating that the `userid` argument is missing. This behavior is unexpected, especially for existing codebases t... | diff --git a/docs/api/security.rst b/docs/api/security.rst
--- a/docs/api/security.rst
+++ b/docs/api/security.rst
@@ -16,7 +16,7 @@
.. autofunction:: forget
-.. autofunction:: remember
+.. autofunction:: remember(request, userid, **kwargs)
Authorization API Functions
---------------------------
diff --git a/p... | diff --git a/pyramid/tests/test_security.py b/pyramid/tests/test_security.py
--- a/pyramid/tests/test_security.py
+++ b/pyramid/tests/test_security.py
@@ -134,9 +134,9 @@
def tearDown(self):
testing.tearDown()
- def _callFUT(self, *arg):
+ def _callFUT(self, *arg, **kwarg):
from pyramid.s... | null | null | namanjain12/pyramid_final:7a2b72c2ba018d6b75ee151843e37da67bbfc2bb | true | null | 2 | 25 | null | 1,428 | 0 | 0.75 | 1 | 0.75 | 1 | 0.321333 | 84.089 | ||
3,550 | r2e_gym::train::2576 | r2e_gym | train | 2,576 | sympy__91ca5cb19b83ea78b719bf8ec47545c04e3dce3d | sympy | sympy/sympy | python | 91ca5cb19b83ea78b719bf8ec47545c04e3dce3d | Title: solveset raises NotImplementedError when solving equations with symbolic function arguments
Description:
When using solveset with equations involving symbolic functions, providing a function call as the variable leads to an unexpected error. For example, the following code that solves an equation with f(1) does... | diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -898,7 +898,19 @@
free_symbols = f.free_symbols
- if not free_symbols:
+ if symbol is None:
+ if len(free_symbols) == 1:
+ symbol = free_symbols.pop()
+ ... | diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -893,9 +893,15 @@
def test_solveset():
x = Symbol('x')
+ f = Function('f')
raises(ValueError, lambda: solveset(x + y))
as... | null | null | namanjain12/sympy_final:91ca5cb19b83ea78b719bf8ec47545c04e3dce3d | true | null | 1 | 27 | null | 1,370 | 0 | 0.75 | 1 | 0.75 | 1 | 0.318333 | 84.08 | ||
3,551 | r2e_gym::train::1575 | r2e_gym | train | 1,575 | sympy__6a80305bd489f45833eca2ecd115075841f2200c | sympy | sympy/sympy | python | 6a80305bd489f45833eca2ecd115075841f2200c | Title: RecursionError When Solving Factorized Nonlinear Equations
Description:
When solving certain nonlinear equations with factorized terms, the factorization process within solveset appears to trigger infinite recursion. For example, consider the following code that sets up a nonlinear system and then a separate eq... | diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -1109,7 +1109,11 @@
# non-trivial factoring of equation
# but use form with constants
... | diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -1,3 +1,6 @@
+from math import isclose
+
+from sympy.core.add import Add
from sympy.core.containers import Tuple
from sympy.core.function im... | null | null | namanjain12/sympy_final:6a80305bd489f45833eca2ecd115075841f2200c | true | null | 1 | 6 | null | 1,782 | 0 | 0.75 | 1 | 0.75 | 1 | 0.317 | 84.076 | ||
3,552 | r2e_gym::train::204 | r2e_gym | train | 204 | orange3__7b57bbdd74a1aaf0f3875a45e1e33184eaa995ff | orange3 | biolab/orange3 | python | 7b57bbdd74a1aaf0f3875a45e1e33184eaa995ff | **Title:** OWDataInfo Widget Fails to Update Status Bar on Data Input and Clearing
**Description:**
When data is provided to the `OWDataInfo` widget or cleared, the status bar does not update to reflect the current data summary. This behavior causes the widget to display outdated or no information in the status bar, l... | diff --git a/Orange/widgets/data/owdatainfo.py b/Orange/widgets/data/owdatainfo.py
--- a/Orange/widgets/data/owdatainfo.py
+++ b/Orange/widgets/data/owdatainfo.py
@@ -4,6 +4,7 @@
from Orange.widgets import widget, gui
from Orange.widgets.utils.widgetpreview import WidgetPreview
+from Orange.widgets.utils.state_summ... | diff --git a/Orange/widgets/data/tests/test_owdatainfo.py b/Orange/widgets/data/tests/test_owdatainfo.py
--- a/Orange/widgets/data/tests/test_owdatainfo.py
+++ b/Orange/widgets/data/tests/test_owdatainfo.py
@@ -1,8 +1,11 @@
# Test methods with long descriptive names can omit docstrings
-# pylint: disable=missing-docst... | null | null | namanjain12/orange3_final:7b57bbdd74a1aaf0f3875a45e1e33184eaa995ff | true | null | 1 | 7 | null | 1,757 | 0 | 0.75 | 1 | 0.75 | 1 | 0.316167 | 84.0735 | ||
3,553 | r2e_gym::train::2043 | r2e_gym | train | 2,043 | sympy__355585fefef28c691e515c5743a0450d755379a1 | sympy | sympy/sympy | python | 355585fefef28c691e515c5743a0450d755379a1 | Title: Intersection with Polygon Raises TypeError instead of Computing Intersection Points
Description:
When computing the intersection between a circle (or ellipse) and a polygon (such as a triangle), the operation fails by raising a TypeError instead of returning the expected intersection points. For example, when a... | diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py
--- a/sympy/geometry/ellipse.py
+++ b/sympy/geometry/ellipse.py
@@ -23,7 +23,7 @@
from sympy.polys.polyutils import _not_a_coeff, _nsort
from sympy.solvers import solve
from sympy.utilities.iterables import uniq
-from sympy.utilities.misc import fill... | diff --git a/sympy/geometry/tests/test_ellipse.py b/sympy/geometry/tests/test_ellipse.py
--- a/sympy/geometry/tests/test_ellipse.py
+++ b/sympy/geometry/tests/test_ellipse.py
@@ -203,6 +203,9 @@
assert intersection(Circle(Point(0, 0), 2), Circle(Point(7, 0), 1)) == []
assert intersection(Ellipse(Point(0, 0), ... | null | null | namanjain12/sympy_final:355585fefef28c691e515c5743a0450d755379a1 | true | null | 2 | 13 | null | 1,635 | 0 | 0.75 | 1 | 0.75 | 1 | 0.315833 | 84.0725 | ||
3,554 | r2e_gym::train::929 | r2e_gym | train | 929 | sympy__a32972789942c7828b9e24d90cf2ceef294579ef | sympy | sympy/sympy | python | a32972789942c7828b9e24d90cf2ceef294579ef | Title: AttributeError when using numeric generator in degree function
Description:
When computing the degree of an expression using a number as the generator, an AttributeError is raised instead of returning the expected degree. For instance, when evaluating the degree of y**2 + x**3 using 1 as the generator, the func... | diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py
--- a/sympy/polys/polytools.py
+++ b/sympy/polys/polytools.py
@@ -4383,7 +4383,7 @@
@public
-def degree(f, *gens, **args):
+def degree(f, gen=0):
"""
Return the degree of ``f`` in the given variable.
@@ -4402,15 +4402,32 @@
>>> degre... | diff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py
--- a/sympy/polys/tests/test_polytools.py
+++ b/sympy/polys/tests/test_polytools.py
@@ -1158,17 +1158,26 @@
assert Poly(2*y, x, y).degree(gen=y) == 1
assert Poly(x*y, x, y).degree(gen=y) == 1
+ assert degree(0, x) == -... | null | null | namanjain12/sympy_final:a32972789942c7828b9e24d90cf2ceef294579ef | true | null | 1 | 37 | null | 1,150 | 0 | 0.75 | 1 | 0.75 | 1 | 0.315 | 84.07 | ||
3,555 | r2e_gym::train::4051 | r2e_gym | train | 4,051 | coveragepy__2e63e41be0774e51b7683457f31500d99c75c9f1 | coveragepy | nedbat/coveragepy | python | 2e63e41be0774e51b7683457f31500d99c75c9f1 | **[ISSUE]**
**Title:** Setting Unknown Configuration Options Does Not Raise Exceptions
**Description:**
When attempting to set or retrieve configuration options that are undefined or associated with non-existent plugins, the system does not raise the expected `CoverageException`. This lack of error handling can lead ... | diff --git a/coverage/config.py b/coverage/config.py
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -2,6 +2,8 @@
import os, re, sys
from coverage.backward import string_class, iitems
+from coverage.misc import CoverageException
+
# In py3, # ConfigParser was renamed to the more-standard configparser
try:
... | diff --git a/tests/test_config.py b/tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -135,6 +135,32 @@
self.assertFalse(cov.config["run:timid"])
self.assertFalse(cov.config["run:branch"])
self.assertEqual(cov.config["run:data_file"], "fooey.dat")
+
+ def test_t... | null | null | namanjain12/coveragepy_final:2e63e41be0774e51b7683457f31500d99c75c9f1 | true | null | 1 | 29 | null | 1,305 | 0 | 0.75 | 1 | 0.75 | 1 | 0.314167 | 84.0675 | ||
3,556 | swe_bench::test::1486 | swe_bench | test | 1,486 | pytest-dev__pytest-9681 | pytest-dev/pytest | pytest-dev/pytest | python | fc72ffa39ed3b34b21fba83d6f80144ab0ae8a36 | 7.0.0 regression: Existence of conftest.py messes up package discovery with importlib + pythonpath mode (ModuleNotFoundError: No module named 'tests.<test-packages>')
Consider the following demo project:
**`setup.cfg`**
```ini
# The idea is to use `pythonpath = .` to enable imports from the `tests` folder
# like `impo... | Bisected to b706a2c04840a8057610f41071fbcf3da1290eb5 (PR #7870), cc @nicoddemus.
Hi @bluenote10,
Thanks for the detailed report, we definitely appreciate it.
> What's particularly surprising: The example works, when renaming the conftest.py to e.g. conftest2.py
That's because `conftest2.py` are not special to... | diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py
--- a/src/_pytest/pathlib.py
+++ b/src/_pytest/pathlib.py
@@ -603,11 +603,20 @@ def insert_missing_modules(modules: Dict[str, ModuleType], module_name: str) ->
module_parts = module_name.split(".")
while module_name:
if module_name not in m... | diff --git a/testing/test_collection.py b/testing/test_collection.py
--- a/testing/test_collection.py
+++ b/testing/test_collection.py
@@ -1507,6 +1507,35 @@ def test_modules_not_importable_as_side_effect(self, pytester: Pytester) -> None
]
)
+ def test_using_python_path(self, pytester: Pytes... | ["testing/test_collection.py::TestImportModeImportlib::test_using_python_path"] | ["testing/test_collection.py::TestCollector::test_collect_versus_item", "testing/test_pathlib.py::TestFNMatcherPort::test_matching[*.py-foo.py]", "testing/test_pathlib.py::TestFNMatcherPort::test_matching[*.py-bar/foo.py]", "testing/test_pathlib.py::TestFNMatcherPort::test_matching[test_*.py-foo/test_foo.py]", "testing... | null | true | 2022-02-13T12:46:19Z | 1 | 19 | 1 | 3,053 | 0 | 0.8 | 1 | 0.62 | 1 | 0.563333 | 84.06 | |
3,557 | r2e_gym::train::2005 | r2e_gym | train | 2,005 | sympy__084e4728cf082cf944439f0d8eb66ac1f9b45b1f | sympy | sympy/sympy | python | 084e4728cf082cf944439f0d8eb66ac1f9b45b1f | Title: Unexpected Error Handling in multiline_latex for Unknown Environments
Description:
The recent updates to the multiline_latex function modify how the environment parameter is handled. In previous versions, providing an unknown environment string (e.g., "foo") was silently accepted, resulting in incorrect output.... | diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -2514,6 +2514,7 @@
\end{eqnarray}
Using "IEEEeqnarray":
+ >>> print(multiline_latex(x, expr, terms_per_line=2, environment="IEEEeqnarray"))
\begin{IEEEeqnarray}{rCl}
x &... | diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -1923,6 +1923,7 @@
r'\end{align*}'
assert multiline_latex(f, expr, 3) == expected3align
+ assert multiline_latex(f, expr, 3, environmen... | null | null | namanjain12/sympy_final:084e4728cf082cf944439f0d8eb66ac1f9b45b1f | true | null | 1 | 9 | null | 1,688 | 0 | 0.75 | 1 | 0.75 | 1 | 0.311333 | 84.059 | ||
3,558 | r2e_gym::train::2308 | r2e_gym | train | 2,308 | sympy__d146f1cb703b1fda846e88bdd5469c871727831d | sympy | sympy/sympy | python | d146f1cb703b1fda846e88bdd5469c871727831d | Title: acc() method raises KeyError for missing velocity when computing acceleration
Description:
When computing the acceleration for a point in a given reference frame, the code unexpectedly raises a KeyError if the velocity for that frame has not been explicitly set. For example, consider a point with zero velocity ... | diff --git a/sympy/physics/vector/point.py b/sympy/physics/vector/point.py
--- a/sympy/physics/vector/point.py
+++ b/sympy/physics/vector/point.py
@@ -244,10 +244,10 @@
_check_frame(frame)
if not (frame in self._acc_dict):
- if self._vel_dict[frame] != 0:
- return (self._ve... | diff --git a/sympy/physics/vector/tests/test_point.py b/sympy/physics/vector/tests/test_point.py
--- a/sympy/physics/vector/tests/test_point.py
+++ b/sympy/physics/vector/tests/test_point.py
@@ -33,8 +33,10 @@
O.set_vel(N, 0)
assert P.a1pt_theory(O, N, B) == -(qd**2) * B.x + qdd * B.y
P.set_vel(B, q2d * ... | null | null | namanjain12/sympy_final:d146f1cb703b1fda846e88bdd5469c871727831d | true | null | 1 | 6 | null | 1,721 | 0 | 0.75 | 1 | 0.75 | 1 | 0.306833 | 84.0455 | ||
3,559 | r2e_gym::train::2531 | r2e_gym | train | 2,531 | sympy__8b24589e070639c829f2483f28f651a6bda508cc | sympy | sympy/sympy | python | 8b24589e070639c829f2483f28f651a6bda508cc | Title: solveset_real fails for equations with Eq by raising NotImplementedError
Description:
When passing an equation expressed using Eq (for example, Eq(x, 1)) to solveset_real, the function previously triggers a NotImplementedError instead of returning the expected result. This issue is observed when the equation is... | diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -393,6 +393,16 @@
raise ValueError(" %s is not a symbol" % (symbol))
f = sympify(f)
+ if isinstance(f, Eq):
+ from sympy.core import Add
+ f = Add(f.lhs,... | diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -898,3 +898,10 @@
assert solveset(x**2 + a, x) == Intersection(S.Reals,
FiniteSet(-sqrt(-a), sqrt(-a)))
+
+
+def test_issue_96... | null | null | namanjain12/sympy_final:8b24589e070639c829f2483f28f651a6bda508cc | true | null | 1 | 10 | null | 1,640 | 0 | 0.75 | 1 | 0.75 | 1 | 0.306667 | 84.045 | ||
3,560 | r2e_gym::train::2729 | r2e_gym | train | 2,729 | sympy__db2b54bb59efb90ea04ff95c71d215698ac3db64 | sympy | sympy/sympy | python | db2b54bb59efb90ea04ff95c71d215698ac3db64 | Title: Crash when substituting non-sympifyable objects in subs
Description:
When using the substitution method with non-sympifyable arguments, such as a vector from the mechanics module, a crash occurs instead of silently ignoring the substitution. For example, using a ReferenceFrame’s component as a substitution argu... | diff --git a/sympy/core/basic.py b/sympy/core/basic.py
--- a/sympy/core/basic.py
+++ b/sympy/core/basic.py
@@ -849,15 +849,20 @@
sequence = list(sequence)
for i in range(len(sequence)):
- o, n = sequence[i]
- so, sn = sympify(o), sympify(n)
- if not isinstance(so, Ba... | diff --git a/sympy/core/tests/test_subs.py b/sympy/core/tests/test_subs.py
--- a/sympy/core/tests/test_subs.py
+++ b/sympy/core/tests/test_subs.py
@@ -678,3 +678,15 @@
eq = x**3 - 17*x**2 + 81*x - 118
r = RootOf(eq, 0)
assert (x < r).subs(x, r) is S.false
+
+
+def test_issue_8886():
+ from sympy.physi... | null | null | namanjain12/sympy_final:db2b54bb59efb90ea04ff95c71d215698ac3db64 | true | null | 2 | 28 | null | 1,277 | 0 | 0.75 | 1 | 0.75 | 1 | 0.306167 | 84.0435 | ||
3,561 | r2e_gym::train::1590 | r2e_gym | train | 1,590 | sympy__562d30b43f98bf27941ce791dd9e9c8d24e510c7 | sympy | sympy/sympy | python | 562d30b43f98bf27941ce791dd9e9c8d24e510c7 | Title: Missing ang_vel_in Method in Body Causes Angular Velocity Query to Fail
Description:
When attempting to retrieve the angular velocity of a body’s reference frame relative to another, the Body object does not expose the ang_vel_in method, causing an AttributeError. Consider the following example:
```
from sympy... | diff --git a/sympy/physics/mechanics/body.py b/sympy/physics/mechanics/body.py
--- a/sympy/physics/mechanics/body.py
+++ b/sympy/physics/mechanics/body.py
@@ -217,7 +217,7 @@
def vel(self, body=None):
"""
- Returns the velocity of self's masscenter wrt body's refernceframe or
+ Returns the... | diff --git a/sympy/physics/mechanics/tests/test_body.py b/sympy/physics/mechanics/tests/test_body.py
--- a/sympy/physics/mechanics/tests/test_body.py
+++ b/sympy/physics/mechanics/tests/test_body.py
@@ -133,5 +133,13 @@
assert A.vel() == 10*A.frame.y
N = ReferenceFrame('N')
B = Body('B', frame=N)
- A.... | null | null | namanjain12/sympy_final:562d30b43f98bf27941ce791dd9e9c8d24e510c7 | true | null | 1 | 31 | null | 1,217 | 0 | 0.75 | 1 | 0.75 | 1 | 0.306167 | 84.0435 | ||
3,562 | r2e_gym::train::2195 | r2e_gym | train | 2,195 | sympy__57d7f50a400dafcba5ea19bca19609d47318be5b | sympy | sympy/sympy | python | 57d7f50a400dafcba5ea19bca19609d47318be5b | Title: Incorrect handling of integer and empty indices in array creation and modification
Description:
There are two related bugs in the array module concerning indexing. When an array is created from an empty list, and when accessing or modifying elements via integer indices, the errors do not match the expected beha... | diff --git a/sympy/tensor/array/ndim_array.py b/sympy/tensor/array/ndim_array.py
--- a/sympy/tensor/array/ndim_array.py
+++ b/sympy/tensor/array/ndim_array.py
@@ -145,10 +145,12 @@
def _parse_index(self, index):
if isinstance(index, (SYMPY_INTS, Integer)):
- raise ValueError("Only a tuple ind... | diff --git a/sympy/tensor/array/tests/test_ndim_array.py b/sympy/tensor/array/tests/test_ndim_array.py
--- a/sympy/tensor/array/tests/test_ndim_array.py
+++ b/sympy/tensor/array/tests/test_ndim_array.py
@@ -9,6 +9,11 @@
ImmutableSparseNDimArray, MutableSparseNDimArray)
from sympy.abc import x, y
+
+mutable_arra... | null | null | namanjain12/sympy_final:57d7f50a400dafcba5ea19bca19609d47318be5b | true | null | 1 | 15 | null | 1,531 | 0 | 0.75 | 1 | 0.75 | 1 | 0.305167 | 84.0405 | ||
3,563 | r2e_gym::train::2745 | r2e_gym | train | 2,745 | sympy__08d06e74f8a948c19733a4b8f89fa7f81f2d0c5a | sympy | sympy/sympy | python | 08d06e74f8a948c19733a4b8f89fa7f81f2d0c5a | Title: Incorrect Order Handling at Negative Infinity Causes Type Errors
Description:
When expanding expressions at negative infinity, using the Order function leads to variable substitution errors. For example, evaluating the order term for an expression like 1/x² + 1/x⁴ using negative infinity as the expansion point ... | diff --git a/sympy/core/expr.py b/sympy/core/expr.py
--- a/sympy/core/expr.py
+++ b/sympy/core/expr.py
@@ -2652,11 +2652,12 @@
raise ValueError("Dir must be '+' or '-'")
if x0 in [S.Infinity, S.NegativeInfinity]:
- dir = {S.Infinity: '+', S.NegativeInfinity: '-'}[x0]
- s = ... | diff --git a/sympy/series/tests/test_order.py b/sympy/series/tests/test_order.py
--- a/sympy/series/tests/test_order.py
+++ b/sympy/series/tests/test_order.py
@@ -428,3 +428,10 @@
assert O(x, (x, oo)).contains(O(x, (x, 0))) is None
assert O(x, (x, 0)).contains(O(x, (x, oo))) is None
raises(NotImplemented... | null | null | namanjain12/sympy_final:08d06e74f8a948c19733a4b8f89fa7f81f2d0c5a | true | null | 2 | 12 | null | 1,584 | 0 | 0.75 | 1 | 0.75 | 1 | 0.304 | 84.037 | ||
3,564 | r2e_gym::train::2418 | r2e_gym | train | 2,418 | sympy__c811f6bc1fef10350ddd69200d8f7c7f11be73ba | sympy | sympy/sympy | python | c811f6bc1fef10350ddd69200d8f7c7f11be73ba | Title: Diagonal Extraction Fails for Valid Off-Main Diagonals in Non-Square Matrices
Description:
When extracting a diagonal from non-square matrices, the current implementation incorrectly raises an error for valid diagonals. For example, consider a 2x3 matrix filled with ones. Requesting the diagonal with an offset ... | diff --git a/sympy/matrices/common.py b/sympy/matrices/common.py
--- a/sympy/matrices/common.py
+++ b/sympy/matrices/common.py
@@ -523,8 +523,12 @@
k = as_int(k)
r = 0 if k > 0 else -k
c = 0 if r else k
- for i in range(min(self.shape) - max(r, c)):
- rv.append(self[r + i, c... | diff --git a/sympy/matrices/tests/test_commonmatrix.py b/sympy/matrices/tests/test_commonmatrix.py
--- a/sympy/matrices/tests/test_commonmatrix.py
+++ b/sympy/matrices/tests/test_commonmatrix.py
@@ -21,7 +21,7 @@
from sympy.matrices.matrices import (MatrixDeterminant,
MatrixReductions, MatrixSubspaces, MatrixEige... | null | null | namanjain12/sympy_final:c811f6bc1fef10350ddd69200d8f7c7f11be73ba | true | null | 1 | 8 | null | 1,661 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3035 | 84.0355 | ||
3,565 | r2e_gym::train::1130 | r2e_gym | train | 1,130 | sympy__70bdcdbbc6d853a5ed707b3dd77c97d7d933ab15 | sympy | sympy/sympy | python | 70bdcdbbc6d853a5ed707b3dd77c97d7d933ab15 | Title: RecursionError in solveset for Rational Functions with Variable in Denominator
Description:
When solving an equation like the one below using solveset in the real domain, a recursion error occurs instead of returning the expected finite set of solutions. In our case, the equation is a rational function where th... | diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -454,6 +454,12 @@
original_eq = f
f = together(f)
+
+ # In this, unlike in solveset_complex, expression should only
+ # be expanded when fraction(f)[1] does not contain... | diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -1017,3 +1017,9 @@
def test_issue_9953():
assert linsolve([ ], x) == S.EmptySet
+
+
+def test_issue_9913():
+ assert solveset(2*x +... | null | null | namanjain12/sympy_final:70bdcdbbc6d853a5ed707b3dd77c97d7d933ab15 | true | null | 1 | 6 | null | 1,686 | 0 | 0.75 | 1 | 0.75 | 1 | 0.301 | 84.028 | ||
3,566 | r2e_gym::train::902 | r2e_gym | train | 902 | sympy__1b57a3ce55881cb63fa85b344a55cc7bf6da7fb0 | sympy | sympy/sympy | python | 1b57a3ce55881cb63fa85b344a55cc7bf6da7fb0 | Title: Deprecated Decorator Causes TypeError for Classes with __new__ and __init__
Description:
When decorating a class with both __new__ and __init__ methods, applying the deprecation decorator results in a TypeError. For example, if a class defines a custom __new__ method, the deprecation warning is fired, but the c... | diff --git a/sympy/utilities/decorator.py b/sympy/utilities/decorator.py
--- a/sympy/utilities/decorator.py
+++ b/sympy/utilities/decorator.py
@@ -311,9 +311,13 @@
__name__ = wrapped.__name__
__module__ = wrapped.__module__
_sympy_deprecated_func = wrapped
- ... | diff --git a/sympy/utilities/tests/test_decorator.py b/sympy/utilities/tests/test_decorator.py
--- a/sympy/utilities/tests/test_decorator.py
+++ b/sympy/utilities/tests/test_decorator.py
@@ -94,8 +94,36 @@
deprecated_since_version='1.10',
active_deprecations_target='active-deprecations... | null | null | namanjain12/sympy_final:1b57a3ce55881cb63fa85b344a55cc7bf6da7fb0 | true | null | 1 | 8 | null | 1,643 | 0 | 0.75 | 1 | 0.75 | 1 | 0.3005 | 84.0265 | ||
3,567 | r2e_gym::train::4819 | r2e_gym | train | 4,819 | numpy__8a81c08e777996b933fe4568ee5a6a0e01416faf | numpy | numpy/numpy | python | 8a81c08e777996b933fe4568ee5a6a0e01416faf | **Title:** `np.require` Raises KeyError When Using 'ENSUREARRAY' Requirement
**Description:**
When attempting to use the `'ENSUREARRAY'` (`'E'`) requirement with `np.require`, a `KeyError` is raised indicating an unknown flag. This prevents users from ensuring that the returned array is a base `ndarray` instead of a s... | diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -597,7 +597,9 @@
a : array_like
The object to be converted to a type-and-requirement-satisfying array.
dtype : data-type
- The required data-type, the default data-type is float6... | diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -2148,5 +2148,79 @@
assert_equal(res1, out1)
assert_equal(np.outer(arr2, arr3, out2), out2)
+class TestRequire(object):
+ flag_names = ['C', 'C... | null | null | namanjain12/numpy_final:8a81c08e777996b933fe4568ee5a6a0e01416faf | true | null | 1 | 47 | null | 858 | 0 | 0.75 | 1 | 0.75 | 1 | 0.299667 | 84.024 | ||
3,568 | r2e_gym::train::576 | r2e_gym | train | 576 | sympy__0b35d6df9f2c51dc8adeda99823d4112f3f6b260 | sympy | sympy/sympy | python | 0b35d6df9f2c51dc8adeda99823d4112f3f6b260 | Title: denoms fails when a single symbol is passed causing a TypeError
Description:
It appears that after updating the function signature for denoms to accept a variable number of symbols, passing a single symbol (instead of an iterable) now leads to a TypeError. For example, using denoms with an inequality expression... | diff --git a/sympy/solvers/solvers.py b/sympy/solvers/solvers.py
--- a/sympy/solvers/solvers.py
+++ b/sympy/solvers/solvers.py
@@ -77,10 +77,10 @@
return dens
-def denoms(eq, symbols=None):
+def denoms(eq, *symbols):
"""Return (recursively) set of all denominators that appear in eq
- that contain any s... | diff --git a/sympy/solvers/tests/test_solvers.py b/sympy/solvers/tests/test_solvers.py
--- a/sympy/solvers/tests/test_solvers.py
+++ b/sympy/solvers/tests/test_solvers.py
@@ -12,7 +12,7 @@
from sympy.solvers import solve_linear_system, solve_linear_system_LU, \
solve_undetermined_coeffs
from sympy.solvers.solver... | null | null | namanjain12/sympy_final:0b35d6df9f2c51dc8adeda99823d4112f3f6b260 | true | null | 2 | 17 | null | 1,458 | 0 | 0.75 | 1 | 0.75 | 1 | 0.299667 | 84.024 | ||
3,569 | swe_bench::dev::105 | swe_bench | dev | 105 | pydicom__pydicom-1720 | pydicom/pydicom | pydicom/pydicom | python | a8be738418dee0a2b93c241fbd5e0bc82f4b8680 | Strict adherence to VR during parsing is detrimental due to commonplace vendor interpretations
**Describe the bug**
DICOM Files from GE modalities, which when parsed, raise a TypeError caused by "violating" the VR imposed by the DICOM standard; however, real world modalities have and continue to generate such files for... | Thank you for that thorough explanation (and of course we all know and respect David Clunie 😄 )!
I understand the specific problem with `Exposure Time` (for a similar reason, there exists the tag `Exposure in μAs` additionally to `Exposure`, but no such thing exists for `Exposure Time`), and I am aware that this is n... | diff --git a/pydicom/config.py b/pydicom/config.py
--- a/pydicom/config.py
+++ b/pydicom/config.py
@@ -268,6 +268,18 @@ def disable_value_validation() -> Generator:
settings._writing_validation_mode = writing_mode
+@contextmanager
+def strict_reading() -> Generator:
+ """Context manager to temporarily e... | diff --git a/pydicom/tests/test_json.py b/pydicom/tests/test_json.py
--- a/pydicom/tests/test_json.py
+++ b/pydicom/tests/test_json.py
@@ -5,6 +5,7 @@
import pytest
+from pydicom import config
from pydicom import dcmread
from pydicom.data import get_testdata_file
from pydicom.dataelem import DataElement, RawDat... | ["pydicom/tests/test_json.py::TestPersonName::test_json_pn_from_file", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_to_json", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_from_json", "pydicom/tests/test_json.py::TestPersonName::test_empty_value", "pydicom/tests/test_json.py::TestPe... | [] | null | true | 2022-10-26T19:54:28Z | 3 | 96 | 345 | 6,286 | 0 | 0.8 | 0.75 | 0.8 | 1 | 0.82 | 84.0225 | |
3,570 | r2e_gym::train::4159 | r2e_gym | train | 4,159 | numpy__ce779dc607baa0630095dc456f5b9ad001095cca | numpy | numpy/numpy | python | ce779dc607baa0630095dc456f5b9ad001095cca | **Title:** `ediff1d` Raises `TypeError` Instead of `ValueError` for Incompatible `to_begin` and `to_end` Arguments
**Description:**
When using the `np.ediff1d` function, providing `to_begin` or `to_end` arguments that cannot be safely cast to the input array's data type results in a `TypeError`. This behavior is unexp... | diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -94,8 +94,7 @@
# force a 1d array
ary = np.asanyarray(ary).ravel()
- # we have unit tests enforcing
- # propagation of the dtype of input
+ # enforce propagation of the ... | diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -46,7 +46,7 @@
assert_array_equal(a, b)
def test_typeNA(self):
- # Issue gh-515
+ # Issue gh-515
with ... | null | null | namanjain12/numpy_final:ce779dc607baa0630095dc456f5b9ad001095cca | true | null | 1 | 26 | null | 1,267 | 0 | 0.75 | 1 | 0.75 | 1 | 0.297833 | 84.0185 | ||
3,571 | r2e_gym::train::2354 | r2e_gym | train | 2,354 | sympy__c7767bf8c2c069aad853e6415f1b3782fb4e1fb8 | sympy | sympy/sympy | python | c7767bf8c2c069aad853e6415f1b3782fb4e1fb8 | Title: rsolve fails with valid recurrence containing trigonometric coefficients
Description:
When solving a recurrence that includes a cosine term as a coefficient, rsolve erroneously raises a ValueError. The recurrence below is valid, but previously rsolve misinterpreted the cosine term as an unexpected function.
Fo... | diff --git a/sympy/solvers/recurr.py b/sympy/solvers/recurr.py
--- a/sympy/solvers/recurr.py
+++ b/sympy/solvers/recurr.py
@@ -66,6 +66,7 @@
from sympy.concrete import product
from sympy.core.compatibility import default_sort_key
from sympy.utilities.iterables import numbered_symbols
+from sympy.core.basic import pr... | diff --git a/sympy/solvers/tests/test_recurr.py b/sympy/solvers/tests/test_recurr.py
--- a/sympy/solvers/tests/test_recurr.py
+++ b/sympy/solvers/tests/test_recurr.py
@@ -1,5 +1,5 @@
from sympy import Eq, factorial, Function, Lambda, rf, S, sqrt, symbols, I, \
- expand_func, binomial, gamma, Rational
+ expand_fu... | null | null | namanjain12/sympy_final:c7767bf8c2c069aad853e6415f1b3782fb4e1fb8 | true | null | 1 | 26 | null | 1,262 | 0 | 0.75 | 1 | 0.75 | 1 | 0.297 | 84.016 | ||
3,572 | r2e_gym::train::2148 | r2e_gym | train | 2,148 | sympy__f3e4a375ba7b40b4e0c8f905fb675cb7fbb31397 | sympy | sympy/sympy | python | f3e4a375ba7b40b4e0c8f905fb675cb7fbb31397 | Title: Avoid TypeError in Membership Checks for ConditionSet and Union
Description:
There is an issue when evaluating containment conditions that involve substitutions leading to invalid comparisons (for example, comparing the special value zoo with real numbers). Consider the following example:
```
from sympy import... | diff --git a/sympy/sets/conditionset.py b/sympy/sets/conditionset.py
--- a/sympy/sets/conditionset.py
+++ b/sympy/sets/conditionset.py
@@ -177,7 +177,11 @@
def _contains(self, other):
d = Dummy()
- return self.as_relational(d).subs(d, other)
+ try:
+ return self.as_relational(d)... | diff --git a/sympy/sets/tests/test_conditionset.py b/sympy/sets/tests/test_conditionset.py
--- a/sympy/sets/tests/test_conditionset.py
+++ b/sympy/sets/tests/test_conditionset.py
@@ -168,3 +168,4 @@
).contains(8) is S.false
assert ConditionSet(x, y > 5, Interval(1, 7)
).contains(w) == And(S(1) <=... | null | null | namanjain12/sympy_final:f3e4a375ba7b40b4e0c8f905fb675cb7fbb31397 | true | null | 2 | 8 | null | 1,616 | 0 | 0.75 | 1 | 0.75 | 1 | 0.296 | 84.013 | ||
3,573 | r2e_gym::train::938 | r2e_gym | train | 938 | sympy__98d4798a7e37ae58a1b9b4146499f273e65385ea | sympy | sympy/sympy | python | 98d4798a7e37ae58a1b9b4146499f273e65385ea | Title: randMatrix() fails with unexpected 'prng' keyword argument
Description:
When trying to use a custom pseudo-random number generator with randMatrix, the function raises a TypeError. For example, using the following code:
```
import random
from sympy.matrices.dense import randMatrix
# Create a specific random n... | diff --git a/sympy/matrices/dense.py b/sympy/matrices/dense.py
--- a/sympy/matrices/dense.py
+++ b/sympy/matrices/dense.py
@@ -1578,11 +1578,22 @@
return Matrix(k, k, f).det()
-def randMatrix(r, c=None, min=0, max=99, seed=None, symmetric=False, percent=100):
+def randMatrix(r, c=None, min=0, max=99, seed=None... | diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py
--- a/sympy/matrices/tests/test_matrices.py
+++ b/sympy/matrices/tests/test_matrices.py
@@ -1,4 +1,5 @@
import collections
+import random
from sympy import (
Abs, Add, E, Float, I, Integer, Max, Min, N, Poly, Pow, PurePo... | null | null | namanjain12/sympy_final:98d4798a7e37ae58a1b9b4146499f273e65385ea | true | null | 1 | 19 | null | 1,391 | 0 | 0.75 | 1 | 0.75 | 1 | 0.295167 | 84.0105 | ||
3,574 | r2e_gym::train::5309 | r2e_gym | train | 5,309 | aiohttp__dd3fabd091bf40137ff87a66b226b47f172a0298 | aiohttp | aio-libs/aiohttp | python | dd3fabd091bf40137ff87a66b226b47f172a0298 | **Title:** FormData.add_field Allows Non-String Types for filename, content_type, and content_transfer_encoding
**Description:**
When using the `FormData.add_field` method to add a field with non-string types for `filename`, `content_type`, or `content_transfer_encoding`, no error is raised. This can lead to unexpecte... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -42,6 +42,7 @@
Simon Kennedy
Stephen Granade
Taras Voinarovskyi
+Tolga Tezel
Vaibhav Sagar
Vitaly Haritonsky
W. Trevor King
diff --git a/aiohttp/helpers.py b/aiohttp/helpers.py
--- a/aiohttp/helpers.py
+++ b/aiohttp/... | diff --git a/tests/test_helpers.py b/tests/test_helpers.py
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -62,6 +62,29 @@
with self.assertRaises(TypeError):
helpers.FormData('as') # 2-char str is not allowed
+ def test_invalid_formdata_content_type(self):
+ form = helpers.... | null | null | namanjain12/aiohttp_final:dd3fabd091bf40137ff87a66b226b47f172a0298 | true | null | 2 | 10 | null | 1,570 | 0 | 0.75 | 1 | 0.75 | 1 | 0.295 | 84.01 | ||
3,575 | r2e_gym::train::1889 | r2e_gym | train | 1,889 | sympy__935ffed64e57ab64548af3310ff788f0b66a9d1e | sympy | sympy/sympy | python | 935ffed64e57ab64548af3310ff788f0b66a9d1e | Title: check_dimensions Incorrectly Raises Error for Compatible Derived Dimensions
Description:
When combining expressions with derived units, such as newton*meter and joule, the function check_dimensions unexpectedly raises an error instead of recognizing that these expressions are dimensionally compatible. In a simp... | diff --git a/sympy/physics/units/util.py b/sympy/physics/units/util.py
--- a/sympy/physics/units/util.py
+++ b/sympy/physics/units/util.py
@@ -152,8 +152,8 @@
def check_dimensions(expr, unit_system="SI"):
- """Return expr if there are not unitless values added to
- dimensional quantities, else raise a ValueE... | diff --git a/sympy/physics/units/tests/test_util.py b/sympy/physics/units/tests/test_util.py
--- a/sympy/physics/units/tests/test_util.py
+++ b/sympy/physics/units/tests/test_util.py
@@ -122,6 +122,7 @@
assert check_dimensions(length + x) == length + x
# after subs we get 2*length; check will clear the consta... | null | null | namanjain12/sympy_final:935ffed64e57ab64548af3310ff788f0b66a9d1e | true | null | 1 | 19 | null | 1,390 | 0 | 0.75 | 1 | 0.75 | 1 | 0.295 | 84.01 | ||
3,576 | swe_bench::test::1654 | swe_bench | test | 1,654 | scikit-learn__scikit-learn-14878 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | b02217d8a5651760353e310701e749c1eaece6df | DataFrames not properly validated in SimpleImputer
```python
import pandas as pd
from sklearn.impute import SimpleImputer
SimpleImputer().fit(pd.DataFrame({'a': ['b', 'c']}))
```
is not validated correctly:
```pythontb
---------------------------------------------------------------------------
ValueError ... | diff --git a/sklearn/impute/_base.py b/sklearn/impute/_base.py
--- a/sklearn/impute/_base.py
+++ b/sklearn/impute/_base.py
@@ -182,9 +182,9 @@ def _validate_input(self, X):
force_all_finite=force_all_finite, copy=self.copy)
except ValueError as ve:
if "could not conver... | diff --git a/sklearn/impute/tests/test_impute.py b/sklearn/impute/tests/test_impute.py
--- a/sklearn/impute/tests/test_impute.py
+++ b/sklearn/impute/tests/test_impute.py
@@ -237,8 +237,23 @@ def test_imputation_mean_median_error_invalid_type(strategy, dtype):
X = np.array([["a", "b", 3],
[4, "e... | ["sklearn/impute/tests/test_impute.py::test_imputation_mean_median_error_invalid_type[None-mean]", "sklearn/impute/tests/test_impute.py::test_imputation_mean_median_error_invalid_type[None-median]", "sklearn/impute/tests/test_impute.py::test_imputation_mean_median_error_invalid_type[object-mean]", "sklearn/impute/tests... | ["sklearn/impute/tests/test_impute.py::test_imputation_shape[mean]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[median]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[most_frequent]", "sklearn/impute/tests/test_impute.py::test_imputation_shape[constant]", "sklearn/impute/tests/test_imput... | null | true | 2019-09-03T22:39:43Z | 1 | 6 | 10 | 2,589 | 0 | 0.8 | 1 | 0.7 | 1 | 0.4515 | 84.0045 | ||
3,577 | r2e_gym::train::406 | r2e_gym | train | 406 | orange3__dc24036876a4b48546c5c1a010a7d5e256167ede | orange3 | biolab/orange3 | python | dc24036876a4b48546c5c1a010a7d5e256167ede | **Title:** `get_unique_names` Raises TypeError When Using `equal_numbers` Parameter
**Description:**
When attempting to assign unique names with differing indices using the `equal_numbers` parameter, the `get_unique_names` function raises a `TypeError`. This occurs because the function does not recognize the `equal_nu... | diff --git a/Orange/data/util.py b/Orange/data/util.py
--- a/Orange/data/util.py
+++ b/Orange/data/util.py
@@ -10,7 +10,7 @@
import bottleneck as bn
from scipy import sparse as sp
-RE_FIND_INDEX = r"(^{} \()(\d{{1,}})(\)$)"
+RE_FIND_INDEX = r"(^{})( \((\d{{1,}})\))?$"
def one_hot(
@@ -167,11 +167,11 @@
:p... | diff --git a/Orange/data/tests/test_util.py b/Orange/data/tests/test_util.py
--- a/Orange/data/tests/test_util.py
+++ b/Orange/data/tests/test_util.py
@@ -48,6 +48,78 @@
self.assertEqual(get_unique_names(domain, "foo"), "foo (1)")
self.assertEqual(get_unique_names(domain, "baz"), "baz (4)")
+ def... | null | null | namanjain12/orange3_final:dc24036876a4b48546c5c1a010a7d5e256167ede | true | null | 1 | 29 | null | 1,167 | 0 | 0.75 | 1 | 0.75 | 1 | 0.291167 | 83.9985 | ||
3,578 | r2e_gym::train::684 | r2e_gym | train | 684 | sympy__0a9a3c9093030f7cc0c60d04b823f982779dc039 | sympy | sympy/sympy | python | 0a9a3c9093030f7cc0c60d04b823f982779dc039 | Title: uniq does not raise RuntimeError when the sequence is modified during iteration
Description:
When iterating over a sequence with the uniq function, modifying the sequence (for example, by removing elements) should immediately trigger an error. There is an issue where the function continues the iteration without... | diff --git a/sympy/utilities/iterables.py b/sympy/utilities/iterables.py
--- a/sympy/utilities/iterables.py
+++ b/sympy/utilities/iterables.py
@@ -2088,8 +2088,12 @@
def uniq(seq, result=None):
"""
Yield unique elements from ``seq`` as an iterator. The second
- parameter ``result`` is used internally; it... | diff --git a/sympy/utilities/tests/test_iterables.py b/sympy/utilities/tests/test_iterables.py
--- a/sympy/utilities/tests/test_iterables.py
+++ b/sympy/utilities/tests/test_iterables.py
@@ -703,6 +703,10 @@
[([1], 2, 2), (2, [1], 2), (2, 2, [1])]
assert list(uniq([2, 3, 2, 4, [2], [1], [2], [3], [1]])) =... | null | null | namanjain12/sympy_final:0a9a3c9093030f7cc0c60d04b823f982779dc039 | true | null | 1 | 20 | null | 1,347 | 0 | 0.75 | 1 | 0.75 | 1 | 0.291167 | 83.9985 | ||
3,579 | r2e_gym::train::1776 | r2e_gym | train | 1,776 | sympy__2d876b3632aa7795dc9d761de36f3affd96c8f2c | sympy | sympy/sympy | python | 2d876b3632aa7795dc9d761de36f3affd96c8f2c | Title: AttributeError during series expansion in exponential function evaluation
Description:
When evaluating limits involving exponential functions with non-integer power series, an error is raised due to the inappropriate method call on a power expression. For example, using the following code:
```
from sympy impor... | diff --git a/sympy/core/expr.py b/sympy/core/expr.py
--- a/sympy/core/expr.py
+++ b/sympy/core/expr.py
@@ -3136,11 +3136,15 @@
n = 0
series = self._eval_nseries(x, n=n, logx=logx)
if not series.is_Order:
- if series.is_Add:
- yield series.removeO()
+ newse... | diff --git a/sympy/core/tests/test_expr.py b/sympy/core/tests/test_expr.py
--- a/sympy/core/tests/test_expr.py
+++ b/sympy/core/tests/test_expr.py
@@ -468,7 +468,7 @@
assert (2 + pi + x).as_leading_term(x) == 2 + pi
assert (2*x + pi*x + x**2).as_leading_term(x) == (2 + pi)*x
-@XFAIL
+
def test_as_leading_t... | null | null | namanjain12/sympy_final:2d876b3632aa7795dc9d761de36f3affd96c8f2c | true | null | 2 | 16 | null | 1,426 | 0 | 0.75 | 1 | 0.75 | 1 | 0.291 | 83.998 | ||
3,580 | r2e_gym::train::5553 | r2e_gym | train | 5,553 | aiohttp__b0536ae6babf160105d4025ea87c02b9fa5629f1 | aiohttp | aio-libs/aiohttp | python | b0536ae6babf160105d4025ea87c02b9fa5629f1 | **Title:** Server Follows Symlinks for Compressed File Variants, Causing Errors and Incorrect Responses
**Description:**
When serving compressed file variants, the server incorrectly follows symbolic links. This behavior results in unexpected errors and improper HTTP responses, such as returning a successful status w... | diff --git a/CHANGES/8652.bugfix.rst b/CHANGES/8652.bugfix.rst
--- a/CHANGES/8652.bugfix.rst
+++ b/CHANGES/8652.bugfix.rst
@@ -0,0 +1 @@
+Fixed incorrectly following symlinks for compressed file variants -- by :user:`steverep`.
diff --git a/aiohttp/web_fileresponse.py b/aiohttp/web_fileresponse.py
--- a/aiohttp/web_fil... | diff --git a/tests/test_web_sendfile.py b/tests/test_web_sendfile.py
--- a/tests/test_web_sendfile.py
+++ b/tests/test_web_sendfile.py
@@ -19,9 +19,9 @@
)
gz_filepath = mock.create_autospec(Path, spec_set=True)
- gz_filepath.stat.return_value.st_size = 1024
- gz_filepath.stat.return_value.st_mtime_ns ... | null | null | namanjain12/aiohttp_final:b0536ae6babf160105d4025ea87c02b9fa5629f1 | true | null | 2 | 6 | null | 1,624 | 0 | 0.75 | 1 | 0.75 | 1 | 0.290667 | 83.997 | ||
3,581 | r2e_gym::train::2235 | r2e_gym | train | 2,235 | sympy__9a1ae184c4f510c6a3eb7b9d3b694f4beeb34b9e | sympy | sympy/sympy | python | 9a1ae184c4f510c6a3eb7b9d3b694f4beeb34b9e | Title: TensAdd.doit() Fails to Drop Zero Subterms Leading to Index Check Error
Description:
When simplifying tensor expressions containing subterms that evaluate to zero, TensAdd.doit() fails to filter these out, causing an index check error. For example, combining a valid tensor with a term that multiplies to zero (e... | diff --git a/sympy/tensor/tensor.py b/sympy/tensor/tensor.py
--- a/sympy/tensor/tensor.py
+++ b/sympy/tensor/tensor.py
@@ -2481,29 +2481,16 @@
else:
args = self.args
- if not args:
+ # if any of the args are zero (after doit), drop them. Otherwise, _tensAdd_check will complain abou... | diff --git a/sympy/tensor/tests/test_tensor.py b/sympy/tensor/tests/test_tensor.py
--- a/sympy/tensor/tests/test_tensor.py
+++ b/sympy/tensor/tests/test_tensor.py
@@ -600,6 +600,8 @@
assert t1 != t2
assert t2 != TensMul.from_data(0, [], [], [])
+ #Test whether TensAdd.doit chokes on subterms that are zer... | null | null | namanjain12/sympy_final:9a1ae184c4f510c6a3eb7b9d3b694f4beeb34b9e | true | null | 1 | 23 | null | 1,283 | 0 | 0.75 | 1 | 0.75 | 1 | 0.2905 | 83.9965 | ||
3,582 | r2e_gym::train::5006 | r2e_gym | train | 5,006 | datalad__6b6d671fe7a7efffe0106c3607d89143ea428402 | datalad | datalad/datalad | python | 6b6d671fe7a7efffe0106c3607d89143ea428402 | **Title:** `decode_source_spec` Fails to Handle Dataset Aliases in RIA URIs
**Description:**
When attempting to decode a RIA URI that includes a dataset alias, the `decode_source_spec` function raises a `ValueError` instead of successfully parsing the alias. This prevents the proper installation of datasets identified... | diff --git a/datalad/core/distributed/clone.py b/datalad/core/distributed/clone.py
--- a/datalad/core/distributed/clone.py
+++ b/datalad/core/distributed/clone.py
@@ -141,9 +141,9 @@
dict(text="Install the main superdataset from datasets.datalad.org",
code_py="clone(source='///')",
... | diff --git a/datalad/core/distributed/tests/test_clone.py b/datalad/core/distributed/tests/test_clone.py
--- a/datalad/core/distributed/tests/test_clone.py
+++ b/datalad/core/distributed/tests/test_clone.py
@@ -631,6 +631,19 @@
# not a dataset UUID
assert_raises(ValueError, decode_source_spec, 'ria+http://exa... | null | null | namanjain12/datalad_final:6b6d671fe7a7efffe0106c3607d89143ea428402 | true | null | 2 | 27 | null | 1,192 | 0 | 0.75 | 1 | 0.75 | 1 | 0.288667 | 83.991 | ||
3,583 | swe_bench::test::1266 | swe_bench | test | 1,266 | pydata__xarray-5180 | pydata/xarray | pydata/xarray | python | c54ec94a6e4c3276eac3e2bbea3c77a040d5674a | open_dataset uses cftime, not datetime64, when calendar attribute is "Gregorian"
**What happened**:
I used `xarray.open_dataset` to open a NetCDF file whose `time` coordinate had the `calendar` attribute set to `Gregorian`. All dates were within the Timestamp-valid range.
The resulting dataset represented the `time`... | Many thanks for the clear report. I totally agree we should be able to handle this. It would be great if you could put together a PR with a fix and some added test coverage.
My only suggestion would be to implement your fix at a higher level in the call stack, e.g. by converting the input `calendar` to lowercase w... | diff --git a/xarray/coding/times.py b/xarray/coding/times.py
--- a/xarray/coding/times.py
+++ b/xarray/coding/times.py
@@ -68,6 +68,10 @@
)
+def _is_standard_calendar(calendar):
+ return calendar.lower() in _STANDARD_CALENDARS
+
+
def _netcdf_to_numpy_timeunit(units):
units = units.lower()
if not uni... | diff --git a/xarray/tests/test_coding_times.py b/xarray/tests/test_coding_times.py
--- a/xarray/tests/test_coding_times.py
+++ b/xarray/tests/test_coding_times.py
@@ -26,7 +26,7 @@
from xarray.coding.variables import SerializationWarning
from xarray.conventions import _update_bounds_attributes, cf_encoder
from xarra... | ["xarray/tests/test_coding_times.py::test_decode_encode_roundtrip_with_non_lowercase_letters[Gregorian]", "xarray/tests/test_coding_times.py::test_decode_encode_roundtrip_with_non_lowercase_letters[GREGORIAN]"] | ["xarray/tests/test_coding_times.py::test_cf_datetime[num_dates0-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates1-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates2-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates3-days", "xarray/tests/test_coding_times.py:... | null | true | 2021-04-17T20:44:57Z | 1 | 12 | 2 | 4,190 | 0 | 0.8 | 1 | 0.62 | 1 | 0.54 | 83.99 | |
3,584 | swe_bench::test::2245 | swe_bench | test | 2,245 | sympy__sympy-21849 | sympy/sympy | sympy/sympy | python | f57d98d8e54169678e8bba7805f0f71546c11e75 | LambertW displaying in jupyter lab
When using JupyterLab and trying to raise LambertW function to some power (for example multiplying with itself) then it raises error when trying to display it. Same thing happens if I use sp.Pow() method as well.
For example sp.Pow(sp.LambertW(2), 2) causes the error as well.
```Pyt... | This can be fixed with something like:
```diff
diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
index debc81ca8d..5bf0cff782 100644
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -2422,11 +2422,15 @@ def _print_DMF(self, p):
def _print_Object(self, object):
return sel... | diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -2422,11 +2422,15 @@ def _print_DMF(self, p):
def _print_Object(self, object):
return self._print(Symbol(object.name))
- def _print_LambertW(self, expr):
+ def _print_Lambe... | diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -594,6 +594,10 @@ def test_latex_functions():
assert latex(LambertW(n)) == r'W\left(n\right)'
assert latex(LambertW(n, -1)) == r'W_{-1}\left... | ["test_latex_functions"] | ["test_printmethod", "test_latex_basic", "test_latex_builtins", "test_latex_SingularityFunction", "test_latex_cycle", "test_latex_permutation", "test_latex_Float", "test_latex_vector_expressions", "test_latex_symbols", "test_function_subclass_different_name", "test_hyper_printing", "test_latex_bessel", "test_latex_fres... | null | true | 2021-08-10T20:07:44Z | 1 | 12 | 1 | 3,252 | 0 | 0.8 | 1 | 0.62 | 1 | 0.54 | 83.99 | |
3,585 | swe_bench::test::1434 | swe_bench | test | 1,434 | pytest-dev__pytest-7220 | pytest-dev/pytest | pytest-dev/pytest | python | 56bf819c2f4eaf8b36bd8c42c06bb59d5a3bfc0f | Wrong path to test file when directory changed in fixture
Files are shown as relative to new directory when working directory is changed in a fixture. This makes it impossible to jump to the error as the editor is unaware of the directory change. The displayed directory should stay relative to the original directory.
... | diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py
--- a/src/_pytest/nodes.py
+++ b/src/_pytest/nodes.py
@@ -29,6 +29,7 @@
from _pytest.mark.structures import MarkDecorator
from _pytest.mark.structures import NodeKeywords
from _pytest.outcomes import fail
+from _pytest.pathlib import Path
from _pytest.store i... | diff --git a/testing/test_nodes.py b/testing/test_nodes.py
--- a/testing/test_nodes.py
+++ b/testing/test_nodes.py
@@ -58,3 +58,30 @@ class FakeSession:
outside = py.path.local("/outside")
assert nodes._check_initialpaths_for_relpath(FakeSession, outside) is None
+
+
+def test_failure_with_changed_cwd(testd... | ["testing/test_nodes.py::test_failure_with_changed_cwd"] | ["testing/test_nodes.py::test_ischildnode[--True]", "testing/test_nodes.py::test_ischildnode[-foo-True]", "testing/test_nodes.py::test_ischildnode[-foo/bar-True]", "testing/test_nodes.py::test_ischildnode[-foo/bar::TestBaz-True]", "testing/test_nodes.py::test_ischildnode[foo-food-False]", "testing/test_nodes.py::test_i... | null | true | 2020-05-16T14:57:17Z | 1 | 10 | 1 | 2,472 | 0 | 0.8 | 1 | 0.7 | 1 | 0.445333 | 83.986 | ||
3,586 | r2e_gym::train::971 | r2e_gym | train | 971 | sympy__f09951bf50bbc176d24679aa45430f288d730e2a | sympy | sympy/sympy | python | f09951bf50bbc176d24679aa45430f288d730e2a | Title: NotImplementedError when Computing Minimal Polynomial for Unevaluated Algebraic Expressions
Description:
When computing the minimal polynomial for unevaluated algebraic expressions, the process fails with a NotImplementedError. For example, when handling expressions like an exponentiated imaginary number or an ... | diff --git a/sympy/polys/numberfields/minpoly.py b/sympy/polys/numberfields/minpoly.py
--- a/sympy/polys/numberfields/minpoly.py
+++ b/sympy/polys/numberfields/minpoly.py
@@ -86,11 +86,9 @@
def _is_sum_surds(p):
- args = p.args if p.is_Add else [p]
- for y in args:
- if not ((y**2).is_Rational and y.i... | diff --git a/sympy/polys/numberfields/tests/test_minpoly.py b/sympy/polys/numberfields/tests/test_minpoly.py
--- a/sympy/polys/numberfields/tests/test_minpoly.py
+++ b/sympy/polys/numberfields/tests/test_minpoly.py
@@ -186,6 +186,12 @@
assert minimal_polynomial(sqrt(2) - zero, x) == x**2 - 2
+def test_issue_83... | null | null | namanjain12/sympy_final:f09951bf50bbc176d24679aa45430f288d730e2a | true | null | 2 | 9 | null | 1,531 | 0 | 0.75 | 1 | 0.75 | 1 | 0.285167 | 83.9805 | ||
3,587 | r2e_gym::train::566 | r2e_gym | train | 566 | sympy__90849e5c4d85f5059d6ef29f520c0efad8c103a6 | sympy | sympy/sympy | python | 90849e5c4d85f5059d6ef29f520c0efad8c103a6 | Title: Bidirectional limit with dir="+-" raises error unexpectedly
Description:
When computing limits with a bidirectional direction (using dir set to "+-"), the code fails to evaluate the limit and instead throws a NotImplementedError. For example, evaluating the limit of sin(x)/x as x approaches 0 using a bidirectio... | diff --git a/sympy/series/limits.py b/sympy/series/limits.py
--- a/sympy/series/limits.py
+++ b/sympy/series/limits.py
@@ -68,18 +68,7 @@
limit_seq : returns the limit of a sequence.
"""
- if dir == "+-":
- llim = Limit(e, z, z0, dir="-").doit(deep=False)
- rlim = Limit(e, z, z0, dir="+").... | diff --git a/sympy/series/tests/test_limits.py b/sympy/series/tests/test_limits.py
--- a/sympy/series/tests/test_limits.py
+++ b/sympy/series/tests/test_limits.py
@@ -551,3 +551,10 @@
assert abs(re) < 1e-12
assert abs(im - 1.08633774961570) < 1e-12
+
+
+def test_issue_17325():
+ assert Limit(sin(x)/x, x,... | null | null | namanjain12/sympy_final:90849e5c4d85f5059d6ef29f520c0efad8c103a6 | true | null | 1 | 29 | null | 1,123 | 0 | 0.75 | 1 | 0.75 | 1 | 0.283833 | 83.9765 | ||
3,588 | swe_bench::test::2229 | swe_bench | test | 2,229 | sympy__sympy-21313 | sympy/sympy | sympy/sympy | python | 546e10799fe55b3e59dea8fa6b3a6d6e71843d33 | don't canonicalize imageset based on Float
While writing this [answer](https://stackoverflow.com/a/67053708/1089161) about how to get something resembling a float-version for range to work, I tried to think about how I would do this in SymPy. Although Floats present their own difficulties, there is canonicalization bei... | diff --git a/sympy/sets/handlers/functions.py b/sympy/sets/handlers/functions.py
--- a/sympy/sets/handlers/functions.py
+++ b/sympy/sets/handlers/functions.py
@@ -1,4 +1,4 @@
-from sympy import Set, symbols, exp, log, S, Wild, Dummy, oo
+from sympy import Set, symbols, exp, log, S, Wild, Dummy, oo, Float
from sympy.co... | diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py
--- a/sympy/sets/tests/test_fancysets.py
+++ b/sympy/sets/tests/test_fancysets.py
@@ -480,6 +480,9 @@ def test_Integers_eval_imageset():
y = Symbol('y')
L = imageset(x, 2*x + y, S.Integers)
assert y + 4 in L
+ a, b, c... | ["test_Integers_eval_imageset"] | ["test_naturals", "test_naturals0", "test_integers", "test_ImageSet", "test_image_is_ImageSet", "test_halfcircle", "test_ImageSet_iterator_not_injective", "test_inf_Range_len", "test_Range_set", "test_Range_symbolic", "test_range_range_intersection", "test_range_interval_intersection", "test_range_is_finite_set", "test... | null | true | 2021-04-13T17:15:18Z | 1 | 6 | 1 | 2,531 | 0 | 0.8 | 1 | 0.7 | 1 | 0.441833 | 83.9755 | ||
3,589 | r2e_gym::train::2338 | r2e_gym | train | 2,338 | sympy__9536f2863ce5c1294321b092dfce81dcf0a74fb8 | sympy | sympy/sympy | python | 9536f2863ce5c1294321b092dfce81dcf0a74fb8 | Title: rsolve Raises ValueError Instead of Returning None for Certain Hypergeometric Recurrences
Description:
When solving certain recurrences with the rsolve function, an empty sequence is passed to max() which results in a ValueError instead of returning a graceful None. For instance, when computing a recurrence lik... | diff --git a/sympy/solvers/recurr.py b/sympy/solvers/recurr.py
--- a/sympy/solvers/recurr.py
+++ b/sympy/solvers/recurr.py
@@ -51,7 +51,7 @@
from collections import defaultdict
from sympy.core.singleton import S
-from sympy.core.numbers import Rational
+from sympy.core.numbers import Rational, I
from sympy.core.sy... | diff --git a/sympy/solvers/tests/test_recurr.py b/sympy/solvers/tests/test_recurr.py
--- a/sympy/solvers/tests/test_recurr.py
+++ b/sympy/solvers/tests/test_recurr.py
@@ -72,7 +72,7 @@
assert rsolve_hyper([1, 1, 1], 0, n).expand() == \
C0*(-S(1)/2 - sqrt(3)*I/2)**n + C1*(-S(1)/2 + sqrt(3)*I/2)**n
- a... | null | null | namanjain12/sympy_final:9536f2863ce5c1294321b092dfce81dcf0a74fb8 | true | null | 1 | 11 | null | 1,467 | 0 | 0.75 | 1 | 0.75 | 1 | 0.281167 | 83.9685 | ||
3,590 | r2e_gym::train::1246 | r2e_gym | train | 1,246 | sympy__34555f1ebe2a2ed1fab2a0a2ae9a8457a75eaa26 | sympy | sympy/sympy | python | 34555f1ebe2a2ed1fab2a0a2ae9a8457a75eaa26 | Title: to_rotation_matrix() Fails with 'normal' Keyword Argument
Description:
When using the rotation matrix function with the keyword argument "normal", the function raises a TypeError. The function is intended to accept "normal" in place of "homogeneous" for symbolic optimizations, but the implementation does not re... | diff --git a/sympy/algebras/quaternion.py b/sympy/algebras/quaternion.py
--- a/sympy/algebras/quaternion.py
+++ b/sympy/algebras/quaternion.py
@@ -856,7 +856,7 @@
return t
- def to_rotation_matrix(self, v=None, homogeneous=False):
+ def to_rotation_matrix(self, v=None, normal=False):
"""Retu... | diff --git a/sympy/algebras/tests/test_quaternion.py b/sympy/algebras/tests/test_quaternion.py
--- a/sympy/algebras/tests/test_quaternion.py
+++ b/sympy/algebras/tests/test_quaternion.py
@@ -233,9 +233,9 @@
[0, 0, 0, 1]])
-def test_rotation_matrix_homogeneous():
- q = Quaterni... | null | null | namanjain12/sympy_final:34555f1ebe2a2ed1fab2a0a2ae9a8457a75eaa26 | true | null | 1 | 27 | null | 1,144 | 0 | 0.75 | 1 | 0.75 | 1 | 0.280667 | 83.967 | ||
3,591 | r2e_gym::train::1962 | r2e_gym | train | 1,962 | sympy__bf9a9639c87c893dbad9dba656042287fc044a81 | sympy | sympy/sympy | python | bf9a9639c87c893dbad9dba656042287fc044a81 | Title: Singular Matrix Power: Invalid Exponents Not Raising Expected Error
Description:
When attempting to raise a singular matrix to a negative or non-integer power, the operation should signal an error. For instance, raising a singular 2×2 matrix (with duplicate rows) to a negative power is an invalid operation and ... | diff --git a/sympy/matrices/matrices.py b/sympy/matrices/matrices.py
--- a/sympy/matrices/matrices.py
+++ b/sympy/matrices/matrices.py
@@ -1547,6 +1547,10 @@
def jordan_cell_power(jc, n):
N = jc.shape[0]
l = jc[0, 0]
+ if l == 0 and (n < N - 1) != False:
+ ra... | diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py
--- a/sympy/matrices/tests/test_matrices.py
+++ b/sympy/matrices/tests/test_matrices.py
@@ -223,6 +223,28 @@
# testing a matrix that cannot be jordan blocked issue 11766
m = Matrix([[3, 0, 0, 0, -3], [0, -3, -3, 0, 3], ... | null | null | namanjain12/sympy_final:bf9a9639c87c893dbad9dba656042287fc044a81 | true | null | 1 | 17 | null | 1,336 | 0 | 0.75 | 1 | 0.75 | 1 | 0.279333 | 83.963 | ||
3,592 | swe_bench::test::1282 | swe_bench | test | 1,282 | pydata__xarray-6598 | pydata/xarray | pydata/xarray | python | 6bb2b855498b5c68d7cca8cceb710365d58e6048 | xarray improperly decodes times from a NetCDF when it is a uint
### What happened?
`xarray` improperly decodes times from a NetCDF when it is a `uint`. The [attached CDL file](https://github.com/pydata/xarray/files/8663212/both_times.txt) generates a NetCDF file with the right time ('good_time') and the wrong time ('... | Thanks @sappjw -- this is a distillation of the bug derived from your example:
```
>>> import numpy as np
>>> import xarray as xr
>>> xr.coding.times.decode_cf_datetime(np.uint32(50), "seconds since 2018-08-22T03:23:03Z")
array('2018-08-22T03:23:05.755359744', dtype='datetime64[ns]')
```
I believe the soluti... | diff --git a/xarray/coding/times.py b/xarray/coding/times.py
--- a/xarray/coding/times.py
+++ b/xarray/coding/times.py
@@ -218,9 +218,12 @@ def _decode_datetime_with_pandas(flat_num_dates, units, calendar):
pd.to_timedelta(flat_num_dates.max(), delta) + ref_date
# To avoid integer overflow when converti... | diff --git a/xarray/tests/test_coding_times.py b/xarray/tests/test_coding_times.py
--- a/xarray/tests/test_coding_times.py
+++ b/xarray/tests/test_coding_times.py
@@ -1121,3 +1121,30 @@ def test_should_cftime_be_used_target_not_npable():
ValueError, match="Calendar 'noleap' is only valid with cftime."
):
... | ["xarray/tests/test_coding_times.py::test_decode_cf_datetime_uint[uint8]", "xarray/tests/test_coding_times.py::test_decode_cf_datetime_uint[uint16]", "xarray/tests/test_coding_times.py::test_decode_cf_datetime_uint[uint32]"] | ["xarray/tests/test_coding_times.py::test_cf_datetime[num_dates0-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates1-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates2-days", "xarray/tests/test_coding_times.py::test_cf_datetime[num_dates3-days", "xarray/tests/test_coding_times.py:... | null | true | 2022-05-12T11:14:15Z | 1 | 9 | 3 | 3,223 | 0 | 0.8 | 1 | 0.62 | 1 | 0.53 | 83.96 | |
3,593 | r2e_gym::train::5804 | r2e_gym | train | 5,804 | tornado__f2b3d8eb9f550b3b1a8daab5a76b81884fd6e1a9 | tornado | tornadoweb/tornado | python | f2b3d8eb9f550b3b1a8daab5a76b81884fd6e1a9 | **Title:** Undecorated Coroutine Test Methods Raise Unexpected Errors
**Description:**
When defining a test method as a coroutine without decorating it with `gen_test`, the test framework raises an unexpected `ValueError` instead of providing a clear message about the missing decorator.
**Buggy Code Example:**
```pyt... | diff --git a/tornado/testing.py b/tornado/testing.py
--- a/tornado/testing.py
+++ b/tornado/testing.py
@@ -34,6 +34,7 @@
from tornado.stack_context import ExceptionStackContext
from tornado.util import raise_exc_info, basestring_type
import functools
+import inspect
import logging
import os
import re
@@ -50,6 +51... | diff --git a/tornado/test/testing_test.py b/tornado/test/testing_test.py
--- a/tornado/test/testing_test.py
+++ b/tornado/test/testing_test.py
@@ -5,11 +5,11 @@
from tornado import gen, ioloop
from tornado.log import app_log
from tornado.testing import AsyncTestCase, gen_test, ExpectLog
-from tornado.test.util impor... | null | null | namanjain12/tornado_final:f2b3d8eb9f550b3b1a8daab5a76b81884fd6e1a9 | true | null | 1 | 24 | null | 1,189 | 0 | 0.75 | 1 | 0.75 | 1 | 0.278167 | 83.9595 | ||
3,594 | swe_bench::test::1001 | swe_bench | test | 1,001 | matplotlib__matplotlib-23031 | matplotlib/matplotlib | matplotlib/matplotlib | python | c3cf938bc02cbbb0d853c54255c4197b6e90ea1e | [MNT]: Require that matplotlibrc/style files use utf-8 (or have an encoding cookie)
### Summary
Currently, matplotlibrc and style files are read with the locale encoding, since #3575. There's even a test for it in test_rcparams.py, which reads
```python
def test_Issue_1713(tmpdir):
rcpath = Path(tmpdir) / 'test_r... | I agree. | diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -754,10 +754,7 @@ def _open_file_or_url(fname):
yield (line.decode('utf-8') for line in f)
else:
fname = os.path.expanduser(fname)
- encoding = loca... | diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py
--- a/lib/matplotlib/tests/test_rcparams.py
+++ b/lib/matplotlib/tests/test_rcparams.py
@@ -39,7 +39,7 @@ def test_rcparams(tmpdir):
linewidth = mpl.rcParams['lines.linewidth']
rcpath = Path(tmpdir) / 'test_rcparams.r... | ["lib/matplotlib/tests/test_rcparams.py::test_Issue_1713"] | ["lib/matplotlib/tests/test_rcparams.py::test_rcparams", "lib/matplotlib/tests/test_rcparams.py::test_RcParams_class", "lib/matplotlib/tests/test_rcparams.py::test_Bug_2543", "lib/matplotlib/tests/test_rcparams.py::test_legend_colors[same", "lib/matplotlib/tests/test_rcparams.py::test_legend_colors[inherited", "lib/mat... | null | true | 2022-05-10T15:30:51Z | 2 | 16 | 1 | 2,296 | 0 | 0.8 | 1 | 0.7 | 1 | 0.436 | 83.958 | |
3,595 | r2e_gym::train::5666 | r2e_gym | train | 5,666 | scrapy__2fd8b7c28c255148f6d7320cb97292ab2d569eff | scrapy | scrapy/scrapy | python | 2fd8b7c28c255148f6d7320cb97292ab2d569eff | **[ISSUE]**
**Title:** Missing `redirect_reasons` in `Request.meta` During Redirect Processing
**Description:**
When handling redirect responses, the `redirect_reasons` key is not added to `Request.meta`. This causes errors when trying to access the reasons for each redirect, making it difficult to track the sequence... | diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rst
--- a/docs/topics/downloader-middleware.rst
+++ b/docs/topics/downloader-middleware.rst
@@ -733,6 +733,17 @@
The urls which the request goes through (while being redirected) can be found
in the ``redirect_urls`` :attr:`Request.... | diff --git a/tests/test_downloadermiddleware_redirect.py b/tests/test_downloadermiddleware_redirect.py
--- a/tests/test_downloadermiddleware_redirect.py
+++ b/tests/test_downloadermiddleware_redirect.py
@@ -138,6 +138,16 @@
self.assertEqual(req2.meta['redirect_urls'], ['http://scrapytest.org/first'])
... | null | null | namanjain12/scrapy_final:2fd8b7c28c255148f6d7320cb97292ab2d569eff | true | null | 3 | 19 | null | 1,283 | 0 | 0.75 | 1 | 0.75 | 1 | 0.277167 | 83.9565 | ||
3,596 | r2e_gym::train::894 | r2e_gym | train | 894 | sympy__e8f522a4e652e41ce24acb20576e88f5d786b19b | sympy | sympy/sympy | python | e8f522a4e652e41ce24acb20576e88f5d786b19b | Title: codegen() does not accept printer argument causing error with custom printer
Description:
We have encountered an issue where passing a custom printer to the code generation function results in a TypeError. When executing code similar to the snippet below, an error is raised indicating that the "printer" keyword... | diff --git a/sympy/utilities/codegen.py b/sympy/utilities/codegen.py
--- a/sympy/utilities/codegen.py
+++ b/sympy/utilities/codegen.py
@@ -1945,7 +1945,7 @@
-def get_code_generator(language, project=None, standard=None):
+def get_code_generator(language, project=None, standard=None, printer = None):
if langu... | diff --git a/sympy/utilities/tests/test_codegen.py b/sympy/utilities/tests/test_codegen.py
--- a/sympy/utilities/tests/test_codegen.py
+++ b/sympy/utilities/tests/test_codegen.py
@@ -1506,3 +1506,33 @@
result = codegen(('expr', expr), header=False, empty=False, code_gen=gen)
source = result[0][1]
assert ... | null | null | namanjain12/sympy_final:e8f522a4e652e41ce24acb20576e88f5d786b19b | true | null | 1 | 8 | null | 1,502 | 0 | 0.75 | 1 | 0.75 | 1 | 0.277 | 83.956 | ||
3,597 | r2e_gym::train::2755 | r2e_gym | train | 2,755 | sympy__7bcca9249a18dd73ab58e66ec9571d09fbdf5bdc | sympy | sympy/sympy | python | 7bcca9249a18dd73ab58e66ec9571d09fbdf5bdc | Title: TypeError While Ordering EX Expressions Causes factor_list to Fail
Description:
When using expressions from the EX domain with functions that rely on ordering, a TypeError is raised. For example, operations like sorting EX elements or factoring expressions that include generators lead to an error during factor_... | diff --git a/sympy/polys/domains/expressiondomain.py b/sympy/polys/domains/expressiondomain.py
--- a/sympy/polys/domains/expressiondomain.py
+++ b/sympy/polys/domains/expressiondomain.py
@@ -61,6 +61,9 @@
except SympifyError:
return None
+ def __lt__(f, g):
+ return f.e... | diff --git a/sympy/polys/domains/tests/test_domains.py b/sympy/polys/domains/tests/test_domains.py
--- a/sympy/polys/domains/tests/test_domains.py
+++ b/sympy/polys/domains/tests/test_domains.py
@@ -1171,6 +1171,11 @@
assert EX.unify(EXRAW) == EXRAW
+def test_EX_ordering():
+ elements = [EX(1), EX(x), EX(3)... | null | null | namanjain12/sympy_final:7bcca9249a18dd73ab58e66ec9571d09fbdf5bdc | true | null | 2 | 8 | null | 1,497 | 0 | 0.75 | 1 | 0.75 | 1 | 0.276167 | 83.9535 | ||
3,598 | r2e_gym::train::2690 | r2e_gym | train | 2,690 | sympy__606d0c6858c9003c2b241d6cf4f300e1899cdd3b | sympy | sympy/sympy | python | 606d0c6858c9003c2b241d6cf4f300e1899cdd3b | Title: Calling remove_load() without arguments results in a TypeError
Description:
When attempting to remove a torque load by calling the remove_load method without any arguments, the function currently raises a TypeError. The intent is for the absence of an argument to indicate that the torque applied using the body'... | diff --git a/sympy/physics/mechanics/body.py b/sympy/physics/mechanics/body.py
--- a/sympy/physics/mechanics/body.py
+++ b/sympy/physics/mechanics/body.py
@@ -365,16 +365,18 @@
self._loads = []
- def remove_load(self, about):
+ def remove_load(self, about=None):
"""
Remove load abou... | diff --git a/sympy/physics/mechanics/tests/test_body.py b/sympy/physics/mechanics/tests/test_body.py
--- a/sympy/physics/mechanics/tests/test_body.py
+++ b/sympy/physics/mechanics/tests/test_body.py
@@ -239,6 +239,10 @@
B.loads == [(P1, f1), (P2, f2)]
B.remove_load(P2)
B.loads == [(P1, f1)]
+ B.apply_... | null | null | namanjain12/sympy_final:606d0c6858c9003c2b241d6cf4f300e1899cdd3b | true | null | 1 | 14 | null | 1,371 | 0 | 0.75 | 1 | 0.75 | 1 | 0.275167 | 83.9505 | ||
3,599 | r2e_gym::train::5488 | r2e_gym | train | 5,488 | aiohttp__e40283338eab5b501e8e91e5b24c2c38cb1a0c71 | aiohttp | aio-libs/aiohttp | python | e40283338eab5b501e8e91e5b24c2c38cb1a0c71 | **[ISSUE]**
**Title:** URL Construction Fails with Hosts Containing Ports or IPv6 Addresses
**Description:**
When building a URL using `BaseRequest`, providing a host that includes a port number or an IPv6 address results in a `ValueError`. This issue prevents the correct construction of URLs in scenarios where the h... | diff --git a/CHANGES/9309.bugfix.rst b/CHANGES/9309.bugfix.rst
--- a/CHANGES/9309.bugfix.rst
+++ b/CHANGES/9309.bugfix.rst
@@ -0,0 +1 @@
+Fixed assembling the :class:`~yarl.URL` for web requests when the host contains a non-default port or IPv6 address -- by :user:`bdraco`.
diff --git a/aiohttp/web_request.py b/aiohttp... | diff --git a/tests/test_web_request.py b/tests/test_web_request.py
--- a/tests/test_web_request.py
+++ b/tests/test_web_request.py
@@ -505,6 +505,16 @@
def test_url_url() -> None:
req = make_mocked_request("GET", "/path", headers={"HOST": "example.com"})
assert URL("http://example.com/path") == req.url
+
+
+... | null | null | namanjain12/aiohttp_final:e40283338eab5b501e8e91e5b24c2c38cb1a0c71 | true | null | 2 | 11 | null | 1,430 | 0 | 0.75 | 1 | 0.75 | 1 | 0.275 | 83.95 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.