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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,200 | r2e_gym::train::4080 | r2e_gym | train | 4,080 | coveragepy__da1b282d3b39a6232e4cb798838389f7b16a0795 | coveragepy | nedbat/coveragepy | python | da1b282d3b39a6232e4cb798838389f7b16a0795 | **Title:** Source Detection Fails for Files Inside `.whl` Archives
**Description:**
When checking for the existence of source files within `.whl` archives, the system incorrectly reports that the source does not exist.
**Example:**
Attempting to verify if `foo.py` exists inside `src/files.whl` fails.
```python
to_ma... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,6 +20,9 @@
Unreleased
----------
+- When checking if a file mapping resolved to a file that exists, we weren't
+ considering files in .whl files. This is now fixed, closing `issue 1511`_.
+
- File pattern rules were too strict, for... | diff --git a/tests/test_files.py b/tests/test_files.py
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -86,6 +86,7 @@
("a/b/c/foo.py", "a/b/c/foo.py", True),
("a/b/c/foo.py", "a/b/c/bar.py", False),
("src/files.zip", "src/files.zip/foo.py", True),
+ ("src/files.w... | null | null | namanjain12/coveragepy_final:da1b282d3b39a6232e4cb798838389f7b16a0795 | true | null | 2 | 8 | null | 775 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.155833 | 80.38625 | ||
9,201 | r2e_gym::train::4114 | r2e_gym | train | 4,114 | numpy__11593aa176d491beb0cc5ffcc393956a5435a2bf | numpy | numpy/numpy | python | 11593aa176d491beb0cc5ffcc393956a5435a2bf | **Title:** ValueError Raised When Padding an Empty Array with 'reflect' Mode
**Description:**
Attempting to pad an empty NumPy array using the `'reflect'` mode results in a `ValueError`, even when the padding should be logically permissible.
**Example Code:**
```python
import numpy as np
from numpy.lib import pad
# ... | diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py
--- a/numpy/lib/arraypad.py
+++ b/numpy/lib/arraypad.py
@@ -1406,10 +1406,15 @@
newmat = _append_min(newmat, pad_after, chunk_after, axis)
elif mode == 'reflect':
- if narray.size == 0:
- raise ValueError("There aren't any ... | diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py
--- a/numpy/lib/tests/test_arraypad.py
+++ b/numpy/lib/tests/test_arraypad.py
@@ -637,6 +637,11 @@
def test_check_03(self):
a = pad([1, 2, 3], 4, 'reflect')
b = np.array([1, 2, 3, 2, 1, 2, 3, 2, 1, 2, 3])
+ as... | null | null | namanjain12/numpy_final:11593aa176d491beb0cc5ffcc393956a5435a2bf | true | null | 1 | 11 | null | 715 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.155833 | 80.38625 | ||
9,202 | r2e_gym::train::6598 | r2e_gym | train | 6,598 | pillow__e258baf30c86ed92b576ae95b2a1df43a6f828d6 | pillow | python-pillow/pillow | python | e258baf30c86ed92b576ae95b2a1df43a6f828d6 | **Title:** Image.new() Raises ValueError When Size is Provided as a List
**Description:**
When creating a new image using `Image.new()`, providing the `size` argument as a list results in a `ValueError`. The function currently expects the size to be a tuple, but supporting lists would offer more flexibility.
**Exampl... | diff --git a/PIL/Image.py b/PIL/Image.py
--- a/PIL/Image.py
+++ b/PIL/Image.py
@@ -1020,7 +1020,7 @@
4-tuple defining the left, upper, right, and lower pixel
coordinate.
- Note: Prior to Pillow 3.4.0, this was a lazy operation.
+ Note: Prior to Pillow 3.4.0, this was a lazy operation.... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -238,7 +238,7 @@
self.assert_image_similar(im2, im3, 110)
def test_check_size(self):
- # Checking that the _check_size function throws value errors when we want it to.
+ # Checkin... | null | null | namanjain12/pillow_final:e258baf30c86ed92b576ae95b2a1df43a6f828d6 | true | null | 1 | 6 | null | 805 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.154167 | 80.38125 | ||
9,203 | r2e_gym::train::6459 | r2e_gym | train | 6,459 | pillow__8ada23ed04ee18730d44d14dd82b0aabc12a0917 | pillow | python-pillow/pillow | python | 8ada23ed04ee18730d44d14dd82b0aabc12a0917 | **Title:** AttributeError Raised When Accessing IFD1 in EXIF Data
**Description:**
When attempting to retrieve the `IFD1` data from an image's EXIF information, an `AttributeError` is thrown because `IFD1` is not recognized within the `ExifTags.IFD` enumeration.
**Example Buggy Code:**
```python
from PIL import Image... | diff --git a/src/PIL/ExifTags.py b/src/PIL/ExifTags.py
--- a/src/PIL/ExifTags.py
+++ b/src/PIL/ExifTags.py
@@ -353,3 +353,4 @@
GPSInfo = 34853
Makernote = 37500
Interop = 40965
+ IFD1 = -1
diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -3641,17 +3641,... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -7,7 +7,14 @@
import pytest
-from PIL import Image, ImageDraw, ImagePalette, UnidentifiedImageError, features
+from PIL import (
+ ExifTags,
+ Image,
+ ImageDraw,
+ ImagePalette,
+ Unidentif... | null | null | namanjain12/pillow_final:8ada23ed04ee18730d44d14dd82b0aabc12a0917 | true | null | 2 | 11 | null | 704 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.154 | 80.38075 | ||
9,204 | r2e_gym::train::6219 | r2e_gym | train | 6,219 | pillow__193c7561392fd12c3bd93bc232d9041c89bec4f6 | pillow | python-pillow/pillow | python | 193c7561392fd12c3bd93bc232d9041c89bec4f6 | **Title**: Saving 'RGBA' Images as JPEG Raises Error Instead of Warning and Conversion
**Description**:
When attempting to save an image with mode 'RGBA' as JPEG, an error is raised instead of implicitly converting the image to 'RGB' and issuing a deprecation warning.
**Example Code**:
```python
from PIL import Image... | diff --git a/PIL/JpegImagePlugin.py b/PIL/JpegImagePlugin.py
--- a/PIL/JpegImagePlugin.py
+++ b/PIL/JpegImagePlugin.py
@@ -534,6 +534,7 @@
"1": "L",
"L": "L",
"RGB": "RGB",
+ "RGBA": "RGB",
"RGBX": "RGB",
"CMYK": "CMYK;I", # assume adobe conventions
"YCbCr": "YCbCr",
@@ -581,6 +582,14 ... | diff --git a/Tests/helper.py b/Tests/helper.py
--- a/Tests/helper.py
+++ b/Tests/helper.py
@@ -99,7 +99,7 @@
" average pixel value difference %.4f > epsilon %.4f" % (
ave_diff, epsilon))
- def assert_warning(self, warn_class, func):
+ def assert_warning(self, warn_class, func, *arg... | null | null | namanjain12/pillow_final:193c7561392fd12c3bd93bc232d9041c89bec4f6 | true | null | 1 | 9 | null | 744 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.154 | 80.38075 | ||
9,205 | r2e_gym::train::4044 | r2e_gym | train | 4,044 | coveragepy__7fb846e8c12b33f9f82964bbb1cef7cc2795d42d | coveragepy | nedbat/coveragepy | python | 7fb846e8c12b33f9f82964bbb1cef7cc2795d42d | **Title:** `runpy.run_path(path)` crashes when `path` is a `pathlib.Path` object
**Description:**
When using `runpy.run_path()` with a `pathlib.Path` object, it results in a crash due to an unexpected attribute error.
**Example Code:**
```python
import runpy
from pathlib import Path
script_path = Path('script.py')
r... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -23,7 +23,11 @@
Unreleased
----------
-Nothing yet.
+- Fix: coverage used to fail when measuring code using :func:`runpy.run_path
+ <python:runpy.run_path>` with a :class:`Path <python:pathlib.Path>` argument.
+ This is now fixed, thank... | diff --git a/tests/test_python.py b/tests/test_python.py
--- a/tests/test_python.py
+++ b/tests/test_python.py
@@ -63,3 +63,24 @@
# If both pyw and py exist, py is preferred
a_py.write_text("")
assert source_for_file(src + 'c') == src
+
+
+class RunpyTest(CoverageTest):
+ """Tests using runpy."""
+
+ ... | null | null | namanjain12/coveragepy_final:7fb846e8c12b33f9f82964bbb1cef7cc2795d42d | true | null | 3 | 10 | null | 724 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.154 | 80.38075 | ||
9,206 | r2e_gym::train::5421 | r2e_gym | train | 5,421 | aiohttp__e4ae01c2077d2cfa116aa82e4ff6866857f7c466 | aiohttp | aio-libs/aiohttp | python | e4ae01c2077d2cfa116aa82e4ff6866857f7c466 | **Title:** Missing Validation Allows HTTP Methods with Non-Token Characters
**Description:**
The system currently accepts HTTP methods that contain non-token characters without validation. This can lead to unexpected behavior or potential security vulnerabilities when invalid methods are used.
**Example Code:**
```py... | diff --git a/CHANGES/6533.feature b/CHANGES/6533.feature
--- a/CHANGES/6533.feature
+++ b/CHANGES/6533.feature
@@ -0,0 +1 @@
+Add HTTP method validation.
diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py
--- a/aiohttp/client_reqrep.py
+++ b/aiohttp/client_reqrep.py
@@ -81,6 +81,7 @@
from .tracing im... | diff --git a/tests/test_client_request.py b/tests/test_client_request.py
--- a/tests/test_client_request.py
+++ b/tests/test_client_request.py
@@ -87,6 +87,11 @@
def test_method3(make_request) -> None:
req = make_request("HEAD", "http://python.org/")
assert req.method == "HEAD"
+
+
+def test_method_invalid(m... | null | null | namanjain12/aiohttp_final:e4ae01c2077d2cfa116aa82e4ff6866857f7c466 | true | null | 2 | 10 | null | 722 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.153667 | 80.37975 | ||
9,207 | r2e_gym::train::5507 | r2e_gym | train | 5,507 | aiohttp__6104dde0eb17d390e8a89c03cbb1fc18d93cc3d0 | aiohttp | aio-libs/aiohttp | python | 6104dde0eb17d390e8a89c03cbb1fc18d93cc3d0 | **Title:** HTTP parser does not reject malformed methods and versions
**Description:**
The HTTP parser fails to properly validate HTTP method names and version strings. When it receives requests with invalid methods or versions, it does not raise the expected exceptions, allowing malformed HTTP requests to be processe... | diff --git a/CHANGES/7700.bugfix b/CHANGES/7700.bugfix
--- a/CHANGES/7700.bugfix
+++ b/CHANGES/7700.bugfix
@@ -0,0 +1 @@
+Fix issue with insufficient HTTP method and version validation.
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -51,6 +51,7 @@
Austin Scola
Ben Ba... | diff --git a/tests/test_http_parser.py b/tests/test_http_parser.py
--- a/tests/test_http_parser.py
+++ b/tests/test_http_parser.py
@@ -728,7 +728,7 @@
def test_http_request_parser_bad_method(parser) -> None:
with pytest.raises(http_exceptions.BadStatusLine):
- parser.feed_data(b'=":<G>(e),[T];?" /get HTT... | null | null | namanjain12/aiohttp_final:6104dde0eb17d390e8a89c03cbb1fc18d93cc3d0 | true | null | 3 | 8 | null | 761 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1535 | 80.37925 | ||
9,208 | r2e_gym::train::4570 | r2e_gym | train | 4,570 | numpy__7744de5cb61f279a05f5a8b139e5a8a58b4d8c98 | numpy | numpy/numpy | python | 7744de5cb61f279a05f5a8b139e5a8a58b4d8c98 | **Title:** `numpy.ma.round` Raises AttributeError on Zero-Dimensional Arrays
**Description:**
When using `numpy.ma.round` on a zero-dimensional masked array, an `AttributeError` is raised instead of returning the expected rounded scalar or `np.ma.masked`.
**Example Code:**
```python
from numpy.ma import array, masked... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5107,8 +5107,12 @@
"""
result = self._data.round(decimals=decimals, out=out).view(type(self))
- result._mask = self._mask
- result._update_from(self)
+ if result.ndim:
+ ... | diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -3443,6 +3443,31 @@
result = xm.round(decimals=2, out=output)
self.assertTrue(result is output)
+ def test_round_with_scalar(self):
+ # Testing roun... | null | null | namanjain12/numpy_final:7744de5cb61f279a05f5a8b139e5a8a58b4d8c98 | true | null | 1 | 8 | null | 761 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1535 | 80.37925 | ||
9,209 | r2e_gym::train::7 | r2e_gym | train | 7 | orange3__9b5494e26f407b75e79699c9d40be6df1d80a040 | orange3 | biolab/orange3 | python | 9b5494e26f407b75e79699c9d40be6df1d80a040 | ### Error When Using L1 Penalty with LogisticRegressionLearner
When configuring `LogisticRegressionLearner` with `penalty='l1'`, an error is raised because the solver does not support the L1 penalty.
**Example Code:**
```python
learn = LogisticRegressionLearner(penalty='l1')
model = learn(iris_data)
```
**Error Mess... | diff --git a/Orange/classification/logistic_regression.py b/Orange/classification/logistic_regression.py
--- a/Orange/classification/logistic_regression.py
+++ b/Orange/classification/logistic_regression.py
@@ -36,7 +36,22 @@
def __init__(self, penalty="l2", dual=False, tol=0.0001, C=1.0,
fit_i... | diff --git a/Orange/tests/test_logistic_regression.py b/Orange/tests/test_logistic_regression.py
--- a/Orange/tests/test_logistic_regression.py
+++ b/Orange/tests/test_logistic_regression.py
@@ -131,3 +131,23 @@
self.assertEqual(len(np.unique(t.Y)), 1)
lr = sklearn.linear_model.LogisticRegression()
... | null | null | namanjain12/orange3_final:9b5494e26f407b75e79699c9d40be6df1d80a040 | true | null | 1 | 17 | null | 576 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.152667 | 80.37675 | ||
9,210 | r2e_gym::train::5444 | r2e_gym | train | 5,444 | aiohttp__56445fc9c043aa46fe9fd0a3dcf6da113c9b20ce | aiohttp | aio-libs/aiohttp | python | 56445fc9c043aa46fe9fd0a3dcf6da113c9b20ce | **Title:** `add_route` Raises AssertionError Instead of ValueError for Invalid HTTP Methods
**Description:**
When attempting to add a route with an unsupported HTTP method, the `add_route` function raises an `AssertionError` instead of a `ValueError`. This behavior is misleading as `AssertionError` is generally used f... | diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py
--- a/aiohttp/web_urldispatcher.py
+++ b/aiohttp/web_urldispatcher.py
@@ -356,15 +356,17 @@
def add_route(self, method, path, handler,
*, name=None, expect_handler=None):
- assert callable(handler), handler
... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -550,3 +550,8 @@
with self.assertRaises(ValueError):
handler = self.make_handler()
self.router.add_route('GET', 'invalid_path', handler)
+
+ def tes... | null | null | namanjain12/aiohttp_final:56445fc9c043aa46fe9fd0a3dcf6da113c9b20ce | true | null | 1 | 6 | null | 796 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.152667 | 80.37675 | ||
9,211 | r2e_gym::train::6119 | r2e_gym | train | 6,119 | pillow__3c482b1b0b286aa5bc54c6a4547d92abe7b87e75 | pillow | python-pillow/pillow | python | 3c482b1b0b286aa5bc54c6a4547d92abe7b87e75 | **Title**: TypeError When Accessing XMP Description Attributes
**Description**
When retrieving XMP metadata from an image, accessing the "Description" field as a dictionary results in a TypeError because it is actually a list of dictionaries.
**Example Code**
```python
from PIL import Image
with Image.open("Tests/im... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1334,10 +1334,10 @@
if marker == b"http://ns.adobe.com/xap/1.0/":
root = xml.etree.ElementTree.fromstring(xmp_tags)
for element in root.findall(".//"):
- ... | diff --git a/Tests/test_image_getxmp.py b/Tests/test_image_getxmp.py
--- a/Tests/test_image_getxmp.py
+++ b/Tests/test_image_getxmp.py
@@ -6,4 +6,4 @@
xmp = im.getxmp()
assert isinstance(xmp, dict)
- assert xmp["Description"][0]["Version"] == "10.4"
+ assert xmp["Description"]["Version... | null | null | namanjain12/pillow_final:3c482b1b0b286aa5bc54c6a4547d92abe7b87e75 | true | null | 1 | 8 | null | 755 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1525 | 80.37625 | ||
9,212 | r2e_gym::train::5616 | r2e_gym | train | 5,616 | scrapy__2c65066ad9e293630da2c594af06ad483abe800d | scrapy | scrapy/scrapy | python | 2c65066ad9e293630da2c594af06ad483abe800d | **Title:** Copying CaseInsensitiveDict Raises KeyError Exception
**Description:**
When attempting to copy a `CaseInsensitiveDict`, a `KeyError` is raised unexpectedly. This prevents the dictionary from being copied successfully, which disrupts functionality that relies on creating duplicates of the dictionary.
**Exam... | diff --git a/scrapy/utils/datatypes.py b/scrapy/utils/datatypes.py
--- a/scrapy/utils/datatypes.py
+++ b/scrapy/utils/datatypes.py
@@ -94,8 +94,11 @@
def __setitem__(self, key: AnyStr, value: Any) -> None:
normalized_key = self._normkey(key)
- if normalized_key.lower() in self._keys:
- ... | diff --git a/tests/test_utils_datatypes.py b/tests/test_utils_datatypes.py
--- a/tests/test_utils_datatypes.py
+++ b/tests/test_utils_datatypes.py
@@ -187,9 +187,15 @@
def test_copy(self):
h1 = self.dict_class({'header1': 'value'})
h2 = copy.copy(h1)
+ assert isinstance(h2, self.dict_class... | null | null | namanjain12/scrapy_final:2c65066ad9e293630da2c594af06ad483abe800d | true | null | 1 | 7 | null | 772 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.152 | 80.37475 | ||
9,213 | r2e_gym::train::5441 | r2e_gym | train | 5,441 | aiohttp__91751450c87e73d26d1464c6a61133e298b26ae2 | aiohttp | aio-libs/aiohttp | python | 91751450c87e73d26d1464c6a61133e298b26ae2 | **Title:** Chunked encoding not properly restricted for HTTP/1.0 requests
**Description:**
When handling an HTTP/1.0 request, enabling chunked encoding does not raise an error as expected. This oversight can lead to compatibility issues with clients that do not support chunked responses.
**Example Code:**
```python
r... | diff --git a/aiohttp/web_reqrep.py b/aiohttp/web_reqrep.py
--- a/aiohttp/web_reqrep.py
+++ b/aiohttp/web_reqrep.py
@@ -24,7 +24,7 @@
CIMultiDict,
MultiDictProxy,
MultiDict)
-from .protocol import Response as ResponseImpl, HttpVersion10
+from .pr... | diff --git a/tests/test_web_response.py b/tests/test_web_response.py
--- a/tests/test_web_response.py
+++ b/tests/test_web_response.py
@@ -18,8 +18,9 @@
def tearDown(self):
self.loop.close()
- def make_request(self, method, path, headers=CIMultiDict()):
- message = RawRequestMessage(method, pa... | null | null | namanjain12/aiohttp_final:91751450c87e73d26d1464c6a61133e298b26ae2 | true | null | 2 | 11 | null | 692 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.152 | 80.37475 | ||
9,214 | r2e_gym::train::4429 | r2e_gym | train | 4,429 | numpy__3071778e37112377b592b180769f0a44496dc2da | numpy | numpy/numpy | python | 3071778e37112377b592b180769f0a44496dc2da | **Title:** Missing `bits` Attribute in `np.finfo` Causes AttributeError
**Description:**
When attempting to access the `bits` attribute of a `finfo` object, an `AttributeError` is raised because the attribute does not exist.
**Example Code:**
```python
import numpy as np
info = np.finfo(np.float32)
print(info.bits)
... | diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py
--- a/numpy/core/getlimits.py
+++ b/numpy/core/getlimits.py
@@ -30,6 +30,8 @@
Attributes
----------
+ bits : int
+ The number of bits occupied by the type.
eps : float
The smallest representable positive number such that
... | diff --git a/numpy/core/tests/test_getlimits.py b/numpy/core/tests/test_getlimits.py
--- a/numpy/core/tests/test_getlimits.py
+++ b/numpy/core/tests/test_getlimits.py
@@ -42,6 +42,19 @@
ftype2 = finfo(longdouble)
assert_equal(id(ftype), id(ftype2))
+class TestFinfo(TestCase):
+ def test_basic(sel... | null | null | namanjain12/numpy_final:3071778e37112377b592b180769f0a44496dc2da | true | null | 1 | 17 | null | 568 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.151333 | 80.37275 | ||
9,215 | r2e_gym::train::4147 | r2e_gym | train | 4,147 | numpy__d51b538ba80d36841cc57911d77ea61cd1d3fb25 | numpy | numpy/numpy | python | d51b538ba80d36841cc57911d77ea61cd1d3fb25 | **Title:** TypeError when using `divmod` with `ArrayLike` objects
**Description:**
When using the `divmod` function with an `ArrayLike` instance and an integer, a `TypeError` is raised, preventing the operation from completing successfully.
**Example Code:**
```python
import numpy as np
array_like = ArrayLike(np.arr... | diff --git a/numpy/lib/mixins.py b/numpy/lib/mixins.py
--- a/numpy/lib/mixins.py
+++ b/numpy/lib/mixins.py
@@ -70,8 +70,7 @@
implement.
This class does not yet implement the special operators corresponding
- to ``divmod`` or ``matmul`` (``@``), because these operation do not yet
- have corresponding N... | diff --git a/numpy/lib/tests/test_mixins.py b/numpy/lib/tests/test_mixins.py
--- a/numpy/lib/tests/test_mixins.py
+++ b/numpy/lib/tests/test_mixins.py
@@ -56,11 +56,47 @@
return '%s(%r)' % (type(self).__name__, self.value)
+def wrap_array_like(result):
+ if type(result) is tuple:
+ return tuple(A... | null | null | namanjain12/numpy_final:d51b538ba80d36841cc57911d77ea61cd1d3fb25 | true | null | 1 | 8 | null | 747 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.151167 | 80.37225 | ||
9,216 | r2e_gym::train::6334 | r2e_gym | train | 6,334 | pillow__e817ed0d3eb838e63836dd5f976a007a9775ce89 | pillow | python-pillow/pillow | python | e817ed0d3eb838e63836dd5f976a007a9775ce89 | **Title:** `ContainerIO` Methods Mixing `str` and `bytes` Causes TypeError
**Description:**
When using `ContainerIO` to handle binary data, attempting to read from the container results in a `TypeError`. This issue occurs because some methods return `str` instead of `bytes`, leading to type mismatches during operation... | diff --git a/src/PIL/ContainerIO.py b/src/PIL/ContainerIO.py
--- a/src/PIL/ContainerIO.py
+++ b/src/PIL/ContainerIO.py
@@ -82,7 +82,7 @@
else:
n = self.length - self.pos
if not n: # EOF
- return ""
+ return b""
self.pos = self.pos + n
return self.f... | diff --git a/Tests/test_file_container.py b/Tests/test_file_container.py
--- a/Tests/test_file_container.py
+++ b/Tests/test_file_container.py
@@ -20,7 +20,7 @@
def test_seek_mode_0():
# Arrange
mode = 0
- with open(TEST_FILE) as fh:
+ with open(TEST_FILE, "rb") as fh:
container = ContainerIO.... | null | null | namanjain12/pillow_final:e817ed0d3eb838e63836dd5f976a007a9775ce89 | true | null | 1 | 6 | null | 785 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.150833 | 80.37125 | ||
9,217 | r2e_gym::train::315 | r2e_gym | train | 315 | orange3__fd0c090a76bd2e4baba87e2df253a480b85660c7 | orange3 | biolab/orange3 | python | fd0c090a76bd2e4baba87e2df253a480b85660c7 | **Title:** Removing Unused Values Results in NaN Mapping for Target Variable
**Description:**
When attempting to remove unused values from a categorical variable in the dataset, the target variable `Y` unexpectedly contains `NaN` values instead of properly mapped integers.
**Example:**
```python
housing = Table("hous... | diff --git a/Orange/preprocess/remove.py b/Orange/preprocess/remove.py
--- a/Orange/preprocess/remove.py
+++ b/Orange/preprocess/remove.py
@@ -2,7 +2,7 @@
import numpy as np
-from Orange.data import Domain, DiscreteVariable, Table
+from Orange.data import Domain, DiscreteVariable
from Orange.preprocess.transforma... | diff --git a/Orange/tests/test_remove.py b/Orange/tests/test_remove.py
--- a/Orange/tests/test_remove.py
+++ b/Orange/tests/test_remove.py
@@ -6,7 +6,7 @@
import numpy as np
from Orange.data import Table
-from Orange.preprocess import Remove
+from Orange.preprocess import Remove, discretize
from Orange.tests impor... | null | null | namanjain12/orange3_final:fd0c090a76bd2e4baba87e2df253a480b85660c7 | true | null | 1 | 7 | null | 762 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.150333 | 80.36975 | ||
9,218 | r2e_gym::train::5096 | r2e_gym | train | 5,096 | pyramid__f10d1e8f9e7a8d65218b9fb09efe3b6fa9511bdd | pyramid | pylons/pyramid | python | f10d1e8f9e7a8d65218b9fb09efe3b6fa9511bdd | **Title:** ConfigurationError Raised When Adding NotFound View Without Providing a View Callable
**Description:**
When configuring a notfound view without specifying a view callable, the system raises a `ConfigurationError` instead of using the default exception response view as expected.
**Example Code:**
```python
... | diff --git a/pyramid/config/views.py b/pyramid/config/views.py
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -53,6 +53,7 @@
from pyramid.httpexceptions import (
HTTPForbidden,
HTTPNotFound,
+ default_exceptionresponse_view,
)
from pyramid.registry import (
@@ -1671,6 +1672,9 @@
... | diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py
--- a/pyramid/tests/test_config/test_views.py
+++ b/pyramid/tests/test_config/test_views.py
@@ -1859,6 +1859,21 @@
request_iface=IRequest)
result = view(None, request)
s... | null | null | namanjain12/pyramid_final:f10d1e8f9e7a8d65218b9fb09efe3b6fa9511bdd | true | null | 1 | 7 | null | 760 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.15 | 80.36875 | ||
9,219 | swe_bench::test::15 | swe_bench | test | 15 | astropy__astropy-13132 | astropy/astropy | astropy/astropy | python | 3a0cd2d8cd7b459cdc1e1b97a14f3040ccc1fffc | Add __array_func__ for astropy.time.Time
### Description
xref https://github.com/astropy/astropy/issues/8610. This provides some numpy array functions for `Time` objects. Most notably, one can now do the following without an errror(!):
```python
from astropy.time import Time, TimeDelta
import numpy as np
t0 = Time('... | 👋 Thank you for your draft pull request! Do you know that you can use `[ci skip]` or `[skip ci]` in your commit messages to skip running continuous integration tests until you are ready?
I think this is good for review now. Somewhat limited in scope to just `linspace`, but once the structure of implementing the numpy ... | diff --git a/astropy/time/core.py b/astropy/time/core.py
--- a/astropy/time/core.py
+++ b/astropy/time/core.py
@@ -31,6 +31,7 @@
# Import TimeFromEpoch to avoid breaking code that followed the old example of
# making a custom timescale in the documentation.
from .formats import TimeFromEpoch # noqa
+from .time_help... | diff --git a/astropy/time/tests/test_basic.py b/astropy/time/tests/test_basic.py
--- a/astropy/time/tests/test_basic.py
+++ b/astropy/time/tests/test_basic.py
@@ -2317,3 +2317,65 @@ def test_location_init_fail():
with pytest.raises(ValueError,
match='cannot concatenate times unless all loca... | ["astropy/time/tests/test_basic.py::test_linspace", "astropy/time/tests/test_basic.py::test_linspace_steps", "astropy/time/tests/test_basic.py::test_linspace_fmts"] | ["astropy/time/tests/test_basic.py::TestBasic::test_different_dimensions", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[jd]", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[mjd]", "astropy/time/tests/test_basic.py::TestBasic::test_empty_value[decimalyear]", "astropy/time/tests/test_bas... | null | true | 2022-04-21T01:37:30Z | 3 | 61 | 3 | 2,196 | 0.03125 | 0.8 | 1 | 0.55 | 1 | 0.569333 | 80.368547 | |
9,220 | r2e_gym::train::5664 | r2e_gym | train | 5,664 | scrapy__770a501fb32b7582acaa5900ac2f41ea46a321cd | scrapy | scrapy/scrapy | python | 770a501fb32b7582acaa5900ac2f41ea46a321cd | **Title:** TypeError When Assigning to `kwargs` After Copying a Request
**Description:**
When copying a `Request` object and attempting to assign a value to its `kwargs`, a `TypeError` is raised because `kwargs` is `None`. This issue prevents proper configuration of the copied request's keyword arguments.
**Example C... | diff --git a/scrapy/http/request/__init__.py b/scrapy/http/request/__init__.py
--- a/scrapy/http/request/__init__.py
+++ b/scrapy/http/request/__init__.py
@@ -40,8 +40,14 @@
self.dont_filter = dont_filter
self._meta = dict(meta) if meta else None
+ self._kwargs = dict(kwargs) if kwargs else N... | diff --git a/tests/test_http_request.py b/tests/test_http_request.py
--- a/tests/test_http_request.py
+++ b/tests/test_http_request.py
@@ -177,6 +177,7 @@
r1 = self.request_class("http://www.example.com", flags=['f1', 'f2'],
callback=somecallback, errback=somecallback)
... | null | null | namanjain12/scrapy_final:770a501fb32b7582acaa5900ac2f41ea46a321cd | true | null | 1 | 8 | null | 739 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.149833 | 80.36825 | ||
9,221 | r2e_gym::train::4831 | r2e_gym | train | 4,831 | numpy__a67d9ad6b0934f533f832cd4cc13ccb7dfd69c9e | numpy | numpy/numpy | python | a67d9ad6b0934f533f832cd4cc13ccb7dfd69c9e | **Title:** `np.errstate` Allows Sequential Multiple Entries, Causing Potential Thread-Safety Issues
**Description:**
When using the `np.errstate` context manager, entering it more than once in a row does not raise an error, which can lead to thread-safety problems.
**Example Code:**
```python
import numpy as np
errs... | diff --git a/doc/release/upcoming_changes/23936.change.rst b/doc/release/upcoming_changes/23936.change.rst
--- a/doc/release/upcoming_changes/23936.change.rst
+++ b/doc/release/upcoming_changes/23936.change.rst
@@ -1,5 +1,4 @@
* Being fully context and thread-safe, ``np.errstate`` can only
- be entered once now. It ... | diff --git a/numpy/core/tests/test_errstate.py b/numpy/core/tests/test_errstate.py
--- a/numpy/core/tests/test_errstate.py
+++ b/numpy/core/tests/test_errstate.py
@@ -71,6 +71,18 @@
foo()
+ def test_errstate_enter_once(self):
+ errstate = np.errstate(invalid="warn")
+ with errs... | null | null | namanjain12/numpy_final:a67d9ad6b0934f533f832cd4cc13ccb7dfd69c9e | true | null | 2 | 7 | null | 758 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.149667 | 80.36775 | ||
9,222 | r2e_gym::train::4102 | r2e_gym | train | 4,102 | coveragepy__28c29a72242e76dab658fe07f104961889c85c12 | coveragepy | nedbat/coveragepy | python | 28c29a72242e76dab658fe07f104961889c85c12 | **Title:** AttributeError: 'PYBEHAVIOR' has no attribute 'bug39114' during test execution
**Description:**
When running the test suite, several tests attempt to access the `bug39114` attribute of the `PYBEHAVIOR` object. However, this attribute is not defined, resulting in an `AttributeError`.
**Example Buggy Code:**... | diff --git a/appveyor.yml b/appveyor.yml
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -90,14 +90,14 @@
- JOB: "3.9 32-bit"
TOXENV: "py39"
PYTHON: "C:\\Python39"
- PYTHON_VERSION: "3.9.0a1"
+ PYTHON_VERSION: "3.9.0a2"
PYTHON_ARCH: "32"
COVERAGE_NO_PYTRACER: "1"
- JOB: "3.9 6... | diff --git a/tests/coveragetest.py b/tests/coveragetest.py
--- a/tests/coveragetest.py
+++ b/tests/coveragetest.py
@@ -15,6 +15,7 @@
import sys
import types
+import pytest
from unittest_mixins import (
EnvironmentAwareMixin, StdStreamCapturingMixin, TempDirMixin,
DelayedAssertionMixin,
@@ -98,6 +99,10 @@... | null | null | namanjain12/coveragepy_final:28c29a72242e76dab658fe07f104961889c85c12 | true | null | 2 | 8 | null | 738 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.149667 | 80.36775 | ||
9,223 | r2e_gym::train::6637 | r2e_gym | train | 6,637 | pillow__c50503a14d5b04dd42030adb77b05732e800b153 | pillow | python-pillow/pillow | python | c50503a14d5b04dd42030adb77b05732e800b153 | **Title:** `load_byte` method returns a tuple instead of a byte string when `legacy_api` is disabled
**Description:**
When using the `load_byte` method with `legacy_api` set to `False`, the method incorrectly returns a tuple of integers instead of a single byte string. This discrepancy causes tests that expect a byte ... | diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py
--- a/PIL/TiffImagePlugin.py
+++ b/PIL/TiffImagePlugin.py
@@ -544,8 +544,7 @@
self.tagtype[tag] = 2
if self.tagtype[tag] == 7 and bytes is not str:
- values = [value.encode("ascii", 'replace') if isinstance(v... | diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py
--- a/Tests/test_file_tiff.py
+++ b/Tests/test_file_tiff.py
@@ -287,7 +287,7 @@
ifd = TiffImagePlugin.ImageFileDirectory_v2()
data = b"abc"
ret = ifd.load_byte(data, legacy_api)
- self.assertEqual(ret, b"abc... | null | null | namanjain12/pillow_final:c50503a14d5b04dd42030adb77b05732e800b153 | true | null | 1 | 6 | null | 772 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.148667 | 80.36475 | ||
9,224 | r2e_gym::train::6471 | r2e_gym | train | 6,471 | pillow__05fe86654cb079b5b77d077e053bf5ee6d2b6f5b | pillow | python-pillow/pillow | python | 05fe86654cb079b5b77d077e053bf5ee6d2b6f5b | **Title:** AttributeError: '_repr_png' method missing for Image objects in IPython
**Description:**
When attempting to display `Image` objects within an IPython environment, calling the `_repr_png` method results in an `AttributeError`. This prevents the image from being rendered correctly in the output cell.
**Examp... | diff --git a/PIL/Image.py b/PIL/Image.py
--- a/PIL/Image.py
+++ b/PIL/Image.py
@@ -597,6 +597,16 @@
self.mode, self.size[0], self.size[1],
id(self)
)
+
+ def _repr_png(self):
+ """ iPython display hook support
+
+ :returns: png version of the image as byte... | 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
@@ -374,6 +374,14 @@
im = roundtrip(im)
self.assertEqual(im.info['icc_profile'], expected_icc)
+ def test_repr_png(self):
+ im = hopper()
+
+ repr_png = Image.open(... | null | null | namanjain12/pillow_final:05fe86654cb079b5b77d077e053bf5ee6d2b6f5b | true | null | 1 | 10 | null | 688 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.148 | 80.36275 | ||
9,225 | r2e_gym::train::6138 | r2e_gym | train | 6,138 | pillow__04052e85c949bfd2fd67297ed8c43960b4abbf3a | pillow | python-pillow/pillow | python | 04052e85c949bfd2fd67297ed8c43960b4abbf3a | **Title:** Unable to Save Spider Image to File-like Object Without Filename
**Description:**
When attempting to save a Spider format image using a file-like object, the operation fails because the system tries to open a filename for writing. This prevents saving images to in-memory file-like objects such as `Temporary... | diff --git a/PIL/SpiderImagePlugin.py b/PIL/SpiderImagePlugin.py
--- a/PIL/SpiderImagePlugin.py
+++ b/PIL/SpiderImagePlugin.py
@@ -267,16 +267,10 @@
raise IOError("Error creating Spider header")
# write the SPIDER header
- try:
- fp = open(filename, 'wb')
- except:
- raise IOError("U... | diff --git a/Tests/test_file_spider.py b/Tests/test_file_spider.py
--- a/Tests/test_file_spider.py
+++ b/Tests/test_file_spider.py
@@ -3,6 +3,8 @@
from PIL import Image
from PIL import ImageSequence
from PIL import SpiderImagePlugin
+
+import tempfile
TEST_FILE = "Tests/images/hopper.spider"
@@ -29,6 +31,21 @@
... | null | null | namanjain12/pillow_final:04052e85c949bfd2fd67297ed8c43960b4abbf3a | true | null | 1 | 6 | null | 764 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.147333 | 80.36075 | ||
9,226 | r2e_gym::train::332 | r2e_gym | train | 332 | orange3__d545b386cf695819000b5cdb412eb4021b3bb3a8 | orange3 | biolab/orange3 | python | d545b386cf695819000b5cdb412eb4021b3bb3a8 | **Title**: Unable to Unlock Derived Table Subclasses Loaded from File or URL
**Description**:
When using a subclass of `Table` to load data from a file or URL, attempting to unlock the table results in a `ValueError`. This error indicates that a part of the table is a view into another table and cannot be unlocked.
*... | diff --git a/Orange/data/table.py b/Orange/data/table.py
--- a/Orange/data/table.py
+++ b/Orange/data/table.py
@@ -1077,11 +1077,6 @@
reader.select_sheet(sheet)
data = reader.read()
- # Readers return plain table. Make sure to cast it to appropriate
- # (subclass) type
- if cls ... | diff --git a/Orange/data/tests/test_table.py b/Orange/data/tests/test_table.py
--- a/Orange/data/tests/test_table.py
+++ b/Orange/data/tests/test_table.py
@@ -384,6 +384,16 @@
self.assertTrue(unpickled.is_copy())
with unpickled.unlocked():
unpickled.X[0, 0] = 42
+
+ @staticmethod
+ ... | null | null | namanjain12/orange3_final:d545b386cf695819000b5cdb412eb4021b3bb3a8 | true | null | 1 | 7 | null | 741 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.146833 | 80.35925 | ||
9,227 | r2e_gym::train::6240 | r2e_gym | train | 6,240 | pillow__e16ab0ad2ead98205143d06940f79a45300b4f33 | pillow | python-pillow/pillow | python | e16ab0ad2ead98205143d06940f79a45300b4f33 | **Title:** `getchannel` Method Raises `TypeError` When Using String Channel Names
**Description**
When attempting to retrieve an image channel using its string name (e.g., `'R'`, `'G'`, `'B'`), the `getchannel` method raises a `TypeError` instead of correctly processing the string input.
**Example Buggy Code:**
```py... | diff --git a/PIL/Image.py b/PIL/Image.py
--- a/PIL/Image.py
+++ b/PIL/Image.py
@@ -1975,9 +1975,12 @@
"""
self.load()
- if isStringType(channel) and len(channel) == 1:
- if channel in self.im.mode:
- channel = self.im.mode.index(channel)
+ if isStringType(chan... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -145,14 +145,28 @@
self.assertEqual(im.size[1], orig_size[1] + 2*ymargin)
def test_getbands(self):
- # Arrange
- im = hopper()
-
- # Act
- bands = im.getbands()
-
- ... | null | null | namanjain12/pillow_final:e16ab0ad2ead98205143d06940f79a45300b4f33 | true | null | 1 | 9 | null | 695 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.145833 | 80.35625 | ||
9,228 | r2e_gym::train::4177 | r2e_gym | train | 4,177 | numpy__530c3eb948c50d24ce09232ec65a0496498ce74e | numpy | numpy/numpy | python | 530c3eb948c50d24ce09232ec65a0496498ce74e | **Title:** `numpy.ma.round` Raises AttributeError on Zero-Dimensional Arrays
**Description:**
When rounding a zero-dimensional masked array, an `AttributeError` is raised because the resulting scalar does not have a `_mask` attribute.
**Example Code:**
```python
import numpy as np
from numpy.ma import array, masked
... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5107,8 +5107,12 @@
"""
result = self._data.round(decimals=decimals, out=out).view(type(self))
- result._mask = self._mask
- result._update_from(self)
+ if result.ndim > 0:
+ ... | diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -3443,6 +3443,31 @@
result = xm.round(decimals=2, out=output)
self.assertTrue(result is output)
+ def test_round_with_scalar(self):
+ # Testing roun... | null | null | namanjain12/numpy_final:530c3eb948c50d24ce09232ec65a0496498ce74e | true | null | 1 | 12 | null | 631 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.145167 | 80.35425 | ||
9,229 | swe_bench::dev::181 | swe_bench | dev | 181 | sqlfluff__sqlfluff-2336 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 37a993f7ad841ab3035d1db5ce6525f2e5584fd5 | L026: Rule incorrectly flag column does not exist in `FROM` clause in an UPDATE statement.
## Expected Behaviour
L026 should not fail when a subquery in an UPDATE statement references a column from the UPDATE target.
## Observed Behaviour
L026 failed due to reference was not found in the FROM clause with the followi... | diff --git a/src/sqlfluff/core/rules/analysis/select.py b/src/sqlfluff/core/rules/analysis/select.py
--- a/src/sqlfluff/core/rules/analysis/select.py
+++ b/src/sqlfluff/core/rules/analysis/select.py
@@ -124,7 +124,7 @@ def _has_value_table_function(table_expr, dialect):
# We need the dialect to get the value t... | diff --git a/test/core/rules/reference_test.py b/test/core/rules/reference_test.py
new file mode 100644
--- /dev/null
+++ b/test/core/rules/reference_test.py
@@ -0,0 +1,72 @@
+"""Test components for working with object and table references."""
+import pytest
+
+from sqlfluff.core.rules import reference
+
+
+@pytest.mar... | ["test/core/rules/reference_test.py::test_object_ref_matches_table[possible_references0-targets0-True]", "test/core/rules/reference_test.py::test_object_ref_matches_table[possible_references1-targets1-True]", "test/core/rules/reference_test.py::test_object_ref_matches_table[possible_references2-targets2-False]", "test/... | [] | null | true | 2022-01-17T21:35:10Z | 6 | 273 | 14 | 1,072 | 0 | 0.8 | 1 | 0.85 | 0.6375 | 0.678667 | 80.351625 | ||
9,230 | r2e_gym::train::5785 | r2e_gym | train | 5,785 | tornado__80df78ac77e020ce23ac16c81368906c75867558 | tornado | tornadoweb/tornado | python | 80df78ac77e020ce23ac16c81368906c75867558 | **Title:** OptionParser Does Not Support Item Assignment, Raising TypeError
**Description:**
When trying to assign a value to an option using the item assignment syntax, a `TypeError` is raised because the `OptionParser` object does not support item assignment.
**Example Code:**
```python
options = OptionParser()
opt... | diff --git a/tornado/options.py b/tornado/options.py
--- a/tornado/options.py
+++ b/tornado/options.py
@@ -132,8 +132,10 @@
return name in self._options
def __getitem__(self, name):
- name = self._normalize_name(name)
- return self._options[name].value()
+ return self.__getattr__(na... | diff --git a/tornado/test/options_test.py b/tornado/test/options_test.py
--- a/tornado/test/options_test.py
+++ b/tornado/test/options_test.py
@@ -130,6 +130,12 @@
def test_getitem(self):
options = self._sample_options()
self.assertEqual(1, options['a'])
+
+ def test_setitem(self):
+ op... | null | null | namanjain12/tornado_final:80df78ac77e020ce23ac16c81368906c75867558 | true | null | 1 | 6 | null | 742 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.143667 | 80.34975 | ||
9,231 | swe_bench::test::1586 | swe_bench | test | 1,586 | scikit-learn__scikit-learn-13241 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | f8b108d0c6f2f82b2dc4e32a6793f9d9ac9cf2f4 | Differences among the results of KernelPCA with rbf kernel
Hi there,
I met with a problem:
#### Description
When I run KernelPCA for dimension reduction for the same datasets, the results are different in signs.
#### Steps/Code to Reproduce
Just to reduce the dimension to 7 with rbf kernel:
pca = KernelPCA(n_componen... | Looks like this sign flip thing was already noticed as part of https://github.com/scikit-learn/scikit-learn/issues/5970.
Using `sklearn.utils.svd_flip` may be the fix to have a deterministic sign.
Can you provide a stand-alone snippet to reproduce the problem ? Please read https://stackoverflow.com/help/mcve. Sta... | diff --git a/sklearn/decomposition/kernel_pca.py b/sklearn/decomposition/kernel_pca.py
--- a/sklearn/decomposition/kernel_pca.py
+++ b/sklearn/decomposition/kernel_pca.py
@@ -8,6 +8,7 @@
from scipy.sparse.linalg import eigsh
from ..utils import check_random_state
+from ..utils.extmath import svd_flip
from ..utils.... | diff --git a/sklearn/decomposition/tests/test_kernel_pca.py b/sklearn/decomposition/tests/test_kernel_pca.py
--- a/sklearn/decomposition/tests/test_kernel_pca.py
+++ b/sklearn/decomposition/tests/test_kernel_pca.py
@@ -4,7 +4,7 @@
from sklearn.utils.testing import (assert_array_almost_equal, assert_less,
... | ["sklearn/decomposition/tests/test_kernel_pca.py::test_kernel_pca_deterministic_output"] | ["sklearn/decomposition/tests/test_kernel_pca.py::test_kernel_pca", "sklearn/decomposition/tests/test_kernel_pca.py::test_kernel_pca_invalid_parameters", "sklearn/decomposition/tests/test_kernel_pca.py::test_kernel_pca_consistent_transform", "sklearn/decomposition/tests/test_kernel_pca.py::test_kernel_pca_sparse", "skl... | null | true | 2019-02-25T11:27:41Z | 1 | 5 | 1 | 777 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.146167 | 80.3385 | |
9,232 | swe_bench::test::1555 | swe_bench | test | 1,555 | scikit-learn__scikit-learn-12625 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | ac327c5ad66fa3d4eb607d007e3684dec872d49a | TypeError: "iteration over a 0-d array" when trying to preprocessing.scale a pandas.Series
#### Description
When trying to call `preprocessing.scale` on a `pandas.Series` instance, an error is thrown with scikit-learn version 0.20.0. Version 0.19.1. works just fine. The [documentation](https://scikit-learn.org/stable... | Minimal script to reproduce:
```
import pandas as pd
from sklearn.utils.validation import check_array
check_array(pd.Series([1, 2, 3]), ensure_2d=False, warn_on_dtype=True)
```
Related PR #10949
Thanks for reporting. Yeah would be good to get this into 0.20.1, hrm...
Heading to bed, seems that an easy solution w... | diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py
--- a/sklearn/utils/validation.py
+++ b/sklearn/utils/validation.py
@@ -477,7 +477,7 @@ def check_array(array, accept_sparse=False, accept_large_sparse=True,
# check if the object contains several dtypes (typically a pandas
# DataFrame), a... | diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py
--- a/sklearn/utils/tests/test_validation.py
+++ b/sklearn/utils/tests/test_validation.py
@@ -694,6 +694,14 @@ def test_suppress_validation():
assert_raises(ValueError, assert_all_finite, X)
+def test_check_array_serie... | ["sklearn/utils/tests/test_validation.py::test_check_array_series"] | ["sklearn/utils/tests/test_validation.py::test_as_float_array", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X0]", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X1]", "sklearn/utils/tests/test_validation.py::test_np_matrix", "sklearn/utils/tests/test_validation.py::test_memmap", "... | null | true | 2018-11-20T16:10:31Z | 1 | 2 | 1 | 2,735 | 0 | 0.8 | 1 | 1 | 0.4 | 0.4625 | 80.3375 | |
9,233 | swe_bench::test::57 | swe_bench | test | 57 | astropy__astropy-14484 | astropy/astropy | astropy/astropy | python | 09e54670e4a46ed510e32d8206e4853920684952 | New Quantity warning starting with yesterday's numpy-dev
### Description
Starting today, `photutils` CI tests with `astropy-dev` and `numpy-dev` started failing due a new warning. I've extracted a MWE showing the warning:
```python
import astropy.units as u
import pytest
from numpy.testing import assert_equal
a = [... | We saw this downstream in Jdaviz too. cc @bmorris3 | diff --git a/astropy/units/quantity_helper/function_helpers.py b/astropy/units/quantity_helper/function_helpers.py
--- a/astropy/units/quantity_helper/function_helpers.py
+++ b/astropy/units/quantity_helper/function_helpers.py
@@ -75,9 +75,10 @@
np.put, np.fill_diagonal, np.tile, np.repeat,
np.split, np.array... | diff --git a/astropy/units/tests/test_quantity_non_ufuncs.py b/astropy/units/tests/test_quantity_non_ufuncs.py
--- a/astropy/units/tests/test_quantity_non_ufuncs.py
+++ b/astropy/units/tests/test_quantity_non_ufuncs.py
@@ -17,7 +17,7 @@
TBD_FUNCTIONS,
UNSUPPORTED_FUNCTIONS,
)
-from astropy.utils.compat impor... | ["astropy/units/tests/test_quantity_non_ufuncs.py::TestUfuncReductions::test_max", "astropy/units/tests/test_quantity_non_ufuncs.py::TestUfuncReductions::test_min", "astropy/units/tests/test_quantity_non_ufuncs.py::TestFunctionHelpersCompleteness::test_all_included"] | ["astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeInformation::test_shape", "astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeInformation::test_size", "astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeInformation::test_ndim", "astropy/units/tests/test_quantity_non_ufuncs.py::TestShapeManipul... | null | true | 2023-03-02T18:48:46Z | 1 | 3 | 3 | 776 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.139333 | 80.318 | |
9,234 | swe_bench::dev::76 | swe_bench | dev | 76 | pydicom__pydicom-1048 | pydicom/pydicom | pydicom/pydicom | python | 00c248441ffb8b7d46c6d855b723e696a8f5aada | dcmread cannot handle pathlib.Path objects
**Describe the bug**
The `dcmread()` currently fails when passed an instance of `pathlib.Path`. The problem is the following line:
https://github.com/pydicom/pydicom/blob/8b0bbaf92d7a8218ceb94dedbee3a0463c5123e3/pydicom/filereader.py#L832
**Expected behavior**
`dcmread()` sho... | Good point. We could use `os.fspath`, but that is only available from Python 3.6 onwards, so we probably have to add a respective check...
The `save_as()` method of `Dataset` has the same issue.
Yes, I noticed. I'm on it.
Yep. I actually started writing code for it at one point, but got side-tracked with other issues.... | diff --git a/pydicom/data/data_manager.py b/pydicom/data/data_manager.py
--- a/pydicom/data/data_manager.py
+++ b/pydicom/data/data_manager.py
@@ -5,6 +5,8 @@
import os
from os.path import abspath, dirname, join
+from pydicom.fileutil import path_from_pathlike
+
DATA_ROOT = abspath(dirname(__file__))
@@ -13,7 ... | diff --git a/pydicom/tests/test_filereader.py b/pydicom/tests/test_filereader.py
--- a/pydicom/tests/test_filereader.py
+++ b/pydicom/tests/test_filereader.py
@@ -7,6 +7,7 @@
from io import BytesIO
import os
import shutil
+from pathlib import Path
from struct import unpack
import sys
import tempfile
@@ -114,6 +11... | ["pydicom/tests/test_filereader.py::TestReader::test_empty_numbers_tag", "pydicom/tests/test_filereader.py::TestReader::test_UTF8_filename", "pydicom/tests/test_filereader.py::TestReader::test_pathlib_path_filename", "pydicom/tests/test_filereader.py::TestReader::test_RTPlan", "pydicom/tests/test_filereader.py::TestRea... | [] | null | true | 2020-02-09T18:36:33Z | 6 | 57 | 258 | 633 | 0 | 0.8 | 0.75 | 0.85 | 0.85 | 0.2955 | 80.3115 | |
9,235 | r2e_gym::train::4032 | r2e_gym | train | 4,032 | coveragepy__610a56fb7ef43614be8752c4561c6c0f118db021 | coveragepy | nedbat/coveragepy | python | 610a56fb7ef43614be8752c4561c6c0f118db021 | **Title:** IndexError Occurs When Generating lcov Report for Certain Jinja2 Files
**Description:**
When generating an lcov report for Jinja2 template files, an `IndexError` is raised, causing the report generation to fail unexpectedly.
**Example Code:**
```python
import coverage
cov = coverage.Coverage()
cov.load()
... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,9 +20,15 @@
Unreleased
----------
+- Fix: the ``lcov`` command could raise an IndexError exception if a file is
+ translated to Python but then executed under its own name. Jinja2 does this
+ when rendering templates. Fixes `issue... | diff --git a/tests/test_report_common.py b/tests/test_report_common.py
--- a/tests/test_report_common.py
+++ b/tests/test_report_common.py
@@ -8,6 +8,7 @@
import textwrap
import coverage
+from coverage import env
from coverage.files import abs_file
from tests.coveragetest import CoverageTest
@@ -156,3 +157,127 ... | null | null | namanjain12/coveragepy_final:610a56fb7ef43614be8752c4561c6c0f118db021 | true | null | 2 | 8 | null | 605 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1275 | 80.30125 | ||
9,236 | r2e_gym::train::5046 | r2e_gym | train | 5,046 | datalad__965607ef83f9c3c7f731ce12b990d4dc94cdce2e | datalad | datalad/datalad | python | 965607ef83f9c3c7f731ce12b990d4dc94cdce2e | **Title:** `_path_` function fails when called with multiple arguments
**Description:**
When attempting to handle multiple path segments, the `_path_` function raises a `TypeError`. This prevents the function from correctly joining multiple path parts as intended.
**Example Code:**
```python
path = _path_('a/b/c', 'd... | diff --git a/datalad/utils.py b/datalad/utils.py
--- a/datalad/utils.py
+++ b/datalad/utils.py
@@ -875,12 +875,12 @@
pass
-def _path_(p):
+def _path_(*p):
"""Given a path in POSIX" notation, regenerate one in native to the env one"""
if on_windows:
- return opj(p.split('/'))
+ ... | diff --git a/datalad/tests/test_utils.py b/datalad/tests/test_utils.py
--- a/datalad/tests/test_utils.py
+++ b/datalad/tests/test_utils.py
@@ -420,3 +420,4 @@
else:
p = 'a/b/c'
assert(_path_(p) is p) # nothing is done to it whatsoever
+ eq_(_path_(p, 'd'), 'a/b/c/d')
| null | null | namanjain12/datalad_final:965607ef83f9c3c7f731ce12b990d4dc94cdce2e | true | null | 1 | 6 | null | 609 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1215 | 80.28325 | ||
9,237 | r2e_gym::train::4971 | r2e_gym | train | 4,971 | datalad__b0cfdbb1b24a0a36fa48be6f7a2c68ed88d029a9 | datalad | datalad/datalad | python | b0cfdbb1b24a0a36fa48be6f7a2c68ed88d029a9 | **Title:** `_get_size_from_perc_complete` crashes when percentage is missing
**Description:**
When the percentage value is not provided, the `_get_size_from_perc_complete` function fails instead of handling the missing input gracefully.
**Example Code:**
```python
result = _get_size_from_perc_complete(1, '')
```
**E... | diff --git a/datalad/support/annexrepo.py b/datalad/support/annexrepo.py
--- a/datalad/support/annexrepo.py
+++ b/datalad/support/annexrepo.py
@@ -2112,8 +2112,8 @@
% str(out_json))
# Make the output's structure match bcmd's.
out_json = out_json[0]
- # Don't cap... | diff --git a/datalad/support/tests/test_annexrepo.py b/datalad/support/tests/test_annexrepo.py
--- a/datalad/support/tests/test_annexrepo.py
+++ b/datalad/support/tests/test_annexrepo.py
@@ -2358,6 +2358,8 @@
eq_(f(0, '0'), 0)
eq_(f(100, '0'), 0) # we do not know better
eq_(f(1, '1'), 100)
+ # with n... | null | null | namanjain12/datalad_final:b0cfdbb1b24a0a36fa48be6f7a2c68ed88d029a9 | true | null | 1 | 10 | null | 513 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.118833 | 80.27525 | ||
9,238 | swe_bench::test::1597 | swe_bench | test | 1,597 | scikit-learn__scikit-learn-13436 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 77b73d63d05bc198ba89193582aee93cae1f69a4 | Confusing pretty print repr for nested Pipeline
Taking the examples from the docs (https://scikit-learn.org/dev/auto_examples/compose/plot_column_transformer_mixed_types.html#sphx-glr-auto-examples-compose-plot-column-transformer-mixed-types-py) that involves some nested pipelines in columntransformer in pipeline
```p... | diff --git a/sklearn/base.py b/sklearn/base.py
--- a/sklearn/base.py
+++ b/sklearn/base.py
@@ -8,6 +8,7 @@
from collections import defaultdict
import platform
import inspect
+import re
import numpy as np
@@ -233,10 +234,13 @@ def set_params(self, **params):
return self
- def __repr__(self):
+ ... | diff --git a/sklearn/utils/tests/test_pprint.py b/sklearn/utils/tests/test_pprint.py
--- a/sklearn/utils/tests/test_pprint.py
+++ b/sklearn/utils/tests/test_pprint.py
@@ -459,16 +459,78 @@ def test_n_max_elements_to_show():
assert pp.pformat(gs) == expected
-def test_length_constraint():
- # When repr is s... | ["sklearn/utils/tests/test_pprint.py::test_bruteforce_ellipsis"] | ["sklearn/utils/tests/test_pprint.py::test_basic", "sklearn/utils/tests/test_pprint.py::test_changed_only", "sklearn/utils/tests/test_pprint.py::test_pipeline", "sklearn/utils/tests/test_pprint.py::test_deeply_nested", "sklearn/utils/tests/test_pprint.py::test_gridsearch", "sklearn/utils/tests/test_pprint.py::test_grid... | null | true | 2019-03-12T14:40:46Z | 1 | 43 | 1 | 2,807 | 0 | 0.8 | 1 | 0.55 | 1 | 0.611167 | 80.2085 | ||
9,239 | swe_bench::test::1674 | swe_bench | test | 1,674 | scikit-learn__scikit-learn-15535 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 70b0ddea992c01df1a41588fa9e2d130fb6b13f8 | regression in input validation of clustering metrics
```python
from sklearn.metrics.cluster import mutual_info_score
import numpy as np
x = np.random.choice(['a', 'b'], size=20).astype(object)
mutual_info_score(x, x)
```
ValueError: could not convert string to float: 'b'
while
```python
x = np.random.choice(['a', 'b'... | broke in #10830 ping @glemaitre | diff --git a/sklearn/metrics/cluster/_supervised.py b/sklearn/metrics/cluster/_supervised.py
--- a/sklearn/metrics/cluster/_supervised.py
+++ b/sklearn/metrics/cluster/_supervised.py
@@ -43,10 +43,10 @@ def check_clusterings(labels_true, labels_pred):
The predicted labels.
"""
labels_true = check_arr... | diff --git a/sklearn/metrics/cluster/tests/test_common.py b/sklearn/metrics/cluster/tests/test_common.py
--- a/sklearn/metrics/cluster/tests/test_common.py
+++ b/sklearn/metrics/cluster/tests/test_common.py
@@ -161,7 +161,9 @@ def generate_formats(y):
y = np.array(y)
yield y, 'array of ints'
... | ["sklearn/metrics/cluster/tests/test_common.py::test_format_invariance[adjusted_mutual_info_score]", "sklearn/metrics/cluster/tests/test_common.py::test_format_invariance[adjusted_rand_score]", "sklearn/metrics/cluster/tests/test_common.py::test_format_invariance[completeness_score]", "sklearn/metrics/cluster/tests/tes... | ["sklearn/metrics/cluster/tests/test_common.py::test_symmetric_non_symmetric_union", "sklearn/metrics/cluster/tests/test_common.py::test_symmetry[adjusted_rand_score-y10-y20]", "sklearn/metrics/cluster/tests/test_common.py::test_symmetry[v_measure_score-y11-y21]", "sklearn/metrics/cluster/tests/test_common.py::test_sym... | null | true | 2019-11-05T02:09:55Z | 1 | 4 | 8 | 524 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.100667 | 80.202 | |
9,240 | swe_bench::test::1189 | swe_bench | test | 1,189 | psf__requests-2674 | psf/requests | psf/requests | python | 0be38a0c37c59c4b66ce908731da15b401655113 | urllib3 exceptions passing through requests API
I don't know if it's a design goal of requests to hide urllib3's exceptions and wrap them around requests.exceptions types.
(If it's not IMHO it should be, but that's another discussion)
If it is, I have at least two of them passing through that I have to catch in addit... | I definitely agree with you and would agree that these should be wrapped.
Could you give us stack-traces so we can find where they're bleeding through?
Sorry I don't have stack traces readily available :/
No worries. I have ideas as to where the DecodeError might be coming from but I'm not certain where the TimeoutE... | diff --git a/requests/adapters.py b/requests/adapters.py
--- a/requests/adapters.py
+++ b/requests/adapters.py
@@ -19,6 +19,7 @@
from .utils import (DEFAULT_CA_BUNDLE_PATH, get_encoding_from_headers,
prepend_scheme_if_needed, get_auth_from_url, urldefragauth)
from .structures import CaseInsensiti... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -1655,6 +1655,16 @@ def test_urllib3_retries():
with pytest.raises(RetryError):
s.get(httpbin('status/500'))
+
+def test_urllib3_pool_connection_closed():
+ s = requests.Session()
+ s.mount('http://',... | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_GET_ALTERNATIVE", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_GET_WITH_PARAMS", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_HEAD", "test_requests.py::RequestsTestCase::t... | ["test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "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::Reques... | null | true | 2015-07-17T08:33:52Z | 1 | 4 | 12 | 508 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.098 | 80.194 | |
9,241 | r2e_gym::train::4469 | r2e_gym | train | 4,469 | numpy__f7f87596aee84daba42d90736af2eeb740eb14f7 | numpy | numpy/numpy | python | f7f87596aee84daba42d90736af2eeb740eb14f7 | **Analysis:**
- **Key Parts from Commit Details and Test Results:**
- **Commit Message:** "MAINT: Fix behavior of structured_to_unstructured on non-trivial dtypes."
- **Test Failure in Old Commit:** `TestRecFunctions.test_structured_to_unstructured` failed with an assertion error where the actual element count was... | diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -874,16 +874,35 @@
scalar fields in the dtype "dt", including nested fields, in left
to right order.
"""
+
+ # counts up elements in subarrays, including nested subarra... | diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py
--- a/numpy/lib/tests/test_recfunctions.py
+++ b/numpy/lib/tests/test_recfunctions.py
@@ -269,7 +269,8 @@
# including uniform fields with subarrays unpacked
d = np.array([(1, [2, 3], [[ 4, 5], [ 6, 7]]),
... | null | null | namanjain12/numpy_final:f7f87596aee84daba42d90736af2eeb740eb14f7 | true | null | 1 | 46 | null | 3,656 | 0 | 0.75 | 1 | 0.5775 | 1 | 0.653333 | 80.16875 | ||
9,242 | swe_bench::test::1183 | swe_bench | test | 1,183 | psf__requests-2193 | psf/requests | psf/requests | python | 95161ed313db11296c3bd473336340dbb19bb347 | [regression] urllib3.exceptions.ProtocolError not wrapped
``` py
>>> requests.__version__
'2.4.0'
>>> requests.get('http://localhost:1')
# ... stacktrace
requests.packages.urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionRefusedError(111, 'Connection refused'))
``` | Yup I'm hitting this too. Is this going to be fixed quick or should I fix my code? :)
Same issue here.
I'll take a look at this this weekend. =) Thanks for reporting folks!
Looking at it right now @Lukasa
Ok, suits me. =) If you get there before me I'll happily accept not doing the work. =D
Thanks for the quick t... | diff --git a/requests/adapters.py b/requests/adapters.py
--- a/requests/adapters.py
+++ b/requests/adapters.py
@@ -23,6 +23,7 @@
from .packages.urllib3.exceptions import HTTPError as _HTTPError
from .packages.urllib3.exceptions import MaxRetryError
from .packages.urllib3.exceptions import ProxyError as _ProxyError
+... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -286,6 +286,14 @@ def test_BASICAUTH_TUPLE_HTTP_200_OK_GET(self):
r = s.get(url)
assert r.status_code == 200
+ def test_connection_error(self):
+ """Connecting to an unknown domain should rais... | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_GET_WITH_PARAMS", "test_requests.py::RequestsTestCase::test_connection_error", "test_requests.py::RequestsTestCase::te... | ["test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_DIGEST_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGEST_STREAM", "test_requests.py::RequestsTestCase::test_HTT... | null | true | 2014-08-29T20:16:54Z | 1 | 5 | 8 | 284 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.064 | 80.092 | |
9,243 | swe_bench::test::1087 | swe_bench | test | 1,087 | matplotlib__matplotlib-25565 | matplotlib/matplotlib | matplotlib/matplotlib | python | 7ab47b41b6046c9b237fe96a4c6cfd454e2380c7 | [Bug]: legend for Poly3dCollection fails
### Bug summary
When plotting an iso surface using Poly3dCollection,
### Code for reproduction
```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
from skimage import measure
from skimage.draw import ellipsoid
... | This is a confirmed bug on the main. I tried a smaller example to reproduce the same
```python
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
rng = np.random.default_rng(0)
verts = rng.random(size=(10, 3))
mesh = Poly3DCollection([verts], label="sur... | diff --git a/lib/mpl_toolkits/mplot3d/art3d.py b/lib/mpl_toolkits/mplot3d/art3d.py
--- a/lib/mpl_toolkits/mplot3d/art3d.py
+++ b/lib/mpl_toolkits/mplot3d/art3d.py
@@ -1063,7 +1063,7 @@ def get_facecolor(self):
if not hasattr(self, '_facecolors2d'):
self.axes.M = self.axes.get_proj()
s... | diff --git a/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py b/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py
--- a/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py
+++ b/lib/mpl_toolkits/mplot3d/tests/test_legend3d.py
@@ -106,3 +106,16 @@ def test_contourf_legend_elements():
assert all(isinstance(a, Rectangle) fo... | ["lib/mpl_toolkits/mplot3d/tests/test_legend3d.py::test_legend_Poly3dCollection"] | ["lib/mpl_toolkits/mplot3d/tests/test_legend3d.py::test_legend_plot[png]", "lib/mpl_toolkits/mplot3d/tests/test_legend3d.py::test_legend_bar[png]", "lib/mpl_toolkits/mplot3d/tests/test_legend3d.py::test_fancy[png]", "lib/mpl_toolkits/mplot3d/tests/test_legend3d.py::test_linecollection_scaled_dashes", "lib/mpl_toolkits/... | null | true | 2023-03-28T04:16:07Z | 1 | 4 | 1 | 7,305 | 0 | 0.8 | 1 | 0.65 | 0.8 | 0.513333 | 80.015 | |
9,244 | swe_bench::test::1762 | swe_bench | test | 1,762 | sphinx-doc__sphinx-7234 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 0e89979355c6c88adb960a7272c633d5afd34e67 | Support for `@singledispatch` functions
It would be nice if there was some mechanism to automagically pick up the overloads to a `@functools.singledispatch` function and list them together... e.g.
```
<Doc for the "master" function>
<links to the available overloads>
``` | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -14,7 +14,8 @@
import re
import warnings
from types import ModuleType
-from typing import Any, Callable, Dict, Iterator, List, Sequence, Set, Tuple, Union
+from ty... | diff --git a/tests/roots/test-ext-autodoc/target/singledispatch.py b/tests/roots/test-ext-autodoc/target/singledispatch.py
new file mode 100644
--- /dev/null
+++ b/tests/roots/test-ext-autodoc/target/singledispatch.py
@@ -0,0 +1,19 @@
+from functools import singledispatch
+
+
+@singledispatch
+def func(arg, kwarg=None)... | ["tests/test_autodoc.py::test_singledispatch", "tests/test_autodoc.py::test_singledispatchmethod"] | ["tests/test_autodoc.py::test_parse_name", "tests/test_autodoc.py::test_format_signature", "tests/test_autodoc.py::test_get_doc", "tests/test_autodoc.py::test_new_documenter", "tests/test_autodoc.py::test_attrgetter_using", "tests/test_autodoc.py::test_py_module", "tests/test_autodoc.py::test_autodoc_decorator", "tests... | null | true | 2020-03-01T13:26:01Z | 3 | 143 | 2 | 272 | 0 | 0.8 | 1 | 0.55 | 1 | 0.522 | 79.941 | ||
9,245 | swe_bench::test::1344 | swe_bench | test | 1,344 | pylint-dev__pylint-6196 | pylint-dev/pylint | pylint-dev/pylint | python | 98bb5bf8ebf15fbce960533e5983a71351a1fe3f | Use, misuse and confusion of ``@check_messages`` decorator
### Current problem
The work on #5953 showed that specifically enabling just a single message is sometimes not working as expected.
This is due to either missing message declaration in a checkers ``msgs`` attribute or the incorrect usage of the ``@check_messag... | Let me give an example on this point, as I think it is the most problematic:
> Applying the decorator to a callback that not only emits messages but also does other things can have nasty side effects (false positives, false negatives, crashes)
The checker I wanted to prepare has a good example for that. The relev... | diff --git a/pylint/checkers/utils.py b/pylint/checkers/utils.py
--- a/pylint/checkers/utils.py
+++ b/pylint/checkers/utils.py
@@ -12,16 +12,17 @@
import re
import string
import warnings
-from collections.abc import Callable, Iterable
+from collections.abc import Iterable
from functools import lru_cache, partial
f... | diff --git a/tests/checkers/unittest_utils.py b/tests/checkers/unittest_utils.py
--- a/tests/checkers/unittest_utils.py
+++ b/tests/checkers/unittest_utils.py
@@ -473,3 +473,18 @@ def test_deprecation_is_inside_lambda() -> None:
with pytest.warns(DeprecationWarning) as records:
utils.is_inside_lambda(node... | ["tests/checkers/unittest_utils.py::testIsBuiltin[min-True]", "tests/checkers/unittest_utils.py::testIsBuiltin[__builtins__-True]", "tests/checkers/unittest_utils.py::testIsBuiltin[__path__-False]", "tests/checkers/unittest_utils.py::testIsBuiltin[__file__-False]", "tests/checkers/unittest_utils.py::testIsBuiltin[whate... | [] | null | true | 2022-04-05T17:52:58Z | 1 | 33 | 41 | 4,139 | 0 | 0.8 | 1 | 0.47 | 1 | 0.61 | 79.925 | |
9,246 | swe_bench::test::1787 | swe_bench | test | 1,787 | sphinx-doc__sphinx-7762 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | c063c9c0fe383a20da613448d1f606b9635773b9 | Add support for custom HTTP headers @ linkcheck
**Is your feature request related to a problem? Please describe.**
Currently, `Accept` HTTP header is hardcoded: https://github.com/sphinx-doc/sphinx/blob/dbefc9865d8c2c4006ed52475d1bff865358cd00/sphinx/builders/linkcheck.py#L111. And when I hit servers that require cust... | Confirmed. It seems better not to send `Accept:` header to GitHub. On the other hand, some server requires the header (see #5140). So it would be better to allow to customize it via code or configuration.
Just an idea, `linkcheck_request_header` might be helpful for such case:
```
linkcheck_request_header = {
... | diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -16,7 +16,7 @@
from html.parser import HTMLParser
from os import path
from typing import Any, Dict, List, Set, Tuple
-from urllib.parse import unquote
+from urllib.parse i... | diff --git a/tests/test_build_linkcheck.py b/tests/test_build_linkcheck.py
--- a/tests/test_build_linkcheck.py
+++ b/tests/test_build_linkcheck.py
@@ -124,3 +124,36 @@ def test_auth(app, status, warning):
assert c_kwargs['auth'] == 'authinfo2'
else:
assert not c_kwargs['au... | ["tests/test_build_linkcheck.py::test_linkcheck_request_headers"] | ["tests/test_build_linkcheck.py::test_defaults", "tests/test_build_linkcheck.py::test_defaults_json", "tests/test_build_linkcheck.py::test_anchors_ignored", "tests/test_build_linkcheck.py::test_auth"] | null | true | 2020-05-31T16:39:12Z | 1 | 31 | 1 | 5,783 | 0 | 0.8 | 1 | 0.47 | 1 | 0.603333 | 79.905 | |
9,247 | swe_bench::test::1812 | swe_bench | test | 1,812 | sphinx-doc__sphinx-8125 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | a163bbe870dc5bc7f3863ead37cd391be81fb0cc | All identifiers should be passed to autodoc-skip-member, even if not in __all__
**Is your feature request related to a problem? Please describe.**
I have a Python project for which I've generated docs. It did well. Almost everything was doc'ed. I knew about the default of excluding anything starting with '_' so I creat... | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -258,6 +258,32 @@ def __getattr__(self, name: str) -> Any:
return None
+class ObjectMember(tuple):
+ """A member of object.
+
+ This is used fo... | diff --git a/tests/test_ext_autodoc_events.py b/tests/test_ext_autodoc_events.py
--- a/tests/test_ext_autodoc_events.py
+++ b/tests/test_ext_autodoc_events.py
@@ -80,3 +80,28 @@ def test_between_exclude(app):
' third line',
'',
]
+
+
+@pytest.mark.sphinx('html', testroot='ext-autodoc')
+def tes... | ["tests/test_ext_autodoc_events.py::test_skip_module_member"] | ["tests/test_ext_autodoc_events.py::test_process_docstring", "tests/test_ext_autodoc_events.py::test_cut_lines", "tests/test_ext_autodoc_events.py::test_between", "tests/test_ext_autodoc_events.py::test_between_exclude"] | null | true | 2020-08-14T15:50:26Z | 1 | 82 | 1 | 1,369 | 0 | 0.8 | 1 | 0.55 | 1 | 0.5015 | 79.8795 | ||
9,248 | r2e_gym::train::419 | r2e_gym | train | 419 | orange3__efefe6bebcf1fd7e539eeefe3bab7889d5821ab7 | orange3 | biolab/orange3 | python | efefe6bebcf1fd7e539eeefe3bab7889d5821ab7 | **Analysis:**
- **Key Parts:**
- **Commit Message:** "Data info displayed in the status bar."
- **Commit Changes:** Added calls to `self.info.set_input_summary` and `self.info.set_output_summary` to update the status bar with data summaries.
- **Test Results:** Previously, the `test_summary` test failed because ... | diff --git a/Orange/widgets/data/owselectcolumns.py b/Orange/widgets/data/owselectcolumns.py
--- a/Orange/widgets/data/owselectcolumns.py
+++ b/Orange/widgets/data/owselectcolumns.py
@@ -14,6 +14,7 @@
from Orange.widgets.settings import ContextSetting, Setting
from Orange.widgets.utils.listfilter import VariablesList... | diff --git a/Orange/widgets/data/tests/test_owselectcolumns.py b/Orange/widgets/data/tests/test_owselectcolumns.py
--- a/Orange/widgets/data/tests/test_owselectcolumns.py
+++ b/Orange/widgets/data/tests/test_owselectcolumns.py
@@ -1,3 +1,4 @@
+# pylint: disable=unsubscriptable-object
from unittest import TestCase
fro... | null | null | namanjain12/orange3_final:efefe6bebcf1fd7e539eeefe3bab7889d5821ab7 | true | null | 1 | 9 | null | 3,219 | 0 | 0.75 | 1 | 0.5775 | 1 | 0.53 | 79.79875 | ||
9,249 | swe_bench::dev::37 | swe_bench | dev | 37 | pvlib__pvlib-python-1349 | pvlib/pvlib-python | pvlib/pvlib-python | python | aba071f707f9025882e57f3e55cc9e3e90e869b2 | `spectrum.spectrl2` calculates negative irradiance for angle of incidence outside +/- 90°
When using pvlib (but also the spectrl2 implementation provided by NREL), I obtain negative Irradiance for a north-facing panel.
From @kevinsa5 's [reply on StackOverflow](https://stackoverflow.com/questions/70172766/pvlib-bird198... | Thanks @cweickhmann! I want to take a closer look at the technical report to be sure, but on a first glance I think the problem here is the same one solved by the line marked with `# GH 526` in `irradiance.haydavies`:
https://github.com/pvlib/pvlib-python/blob/aba071f707f9025882e57f3e55cc9e3e90e869b2/pvlib/irradian... | diff --git a/pvlib/spectrum/spectrl2.py b/pvlib/spectrum/spectrl2.py
--- a/pvlib/spectrum/spectrl2.py
+++ b/pvlib/spectrum/spectrl2.py
@@ -260,6 +260,11 @@ def spectrl2(apparent_zenith, aoi, surface_tilt, ground_albedo,
2-5 kasten1966 kasten1966 kastenyoung1989
=================== ========== =... | diff --git a/pvlib/tests/test_spectrum.py b/pvlib/tests/test_spectrum.py
--- a/pvlib/tests/test_spectrum.py
+++ b/pvlib/tests/test_spectrum.py
@@ -92,3 +92,17 @@ def test_dayofyear_missing(spectrl2_data):
kwargs.pop('dayofyear')
with pytest.raises(ValueError, match='dayofyear must be specified'):
_ =... | ["pvlib/tests/test_spectrum.py::test_aoi_gt_90"] | ["pvlib/tests/test_spectrum.py::test_spectrl2", "pvlib/tests/test_spectrum.py::test_spectrl2_array", "pvlib/tests/test_spectrum.py::test_spectrl2_series", "pvlib/tests/test_spectrum.py::test_dayofyear_missing"] | null | true | 2021-12-04T20:54:05Z | 1 | 19 | 1 | 3,592 | 0 | 0.8 | 1 | 0.47 | 1 | 0.563333 | 79.785 | |
9,250 | swe_bench::test::1778 | swe_bench | test | 1,778 | sphinx-doc__sphinx-7593 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 56772395bb945099a6d5331501c179dd2831fa1c | Convert :kbd: to nested <kbd> HTML elements
**Is your feature request related to a problem? Please describe.**
[:kbd:](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-kbd) describes "a sequence of keystrokes". Sphinx converts it to a single [`<kbd>`](https://developer.mozilla.org/en-US/docs... | +1: Reasonable. | diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py
--- a/sphinx/builders/html/__init__.py
+++ b/sphinx/builders/html/__init__.py
@@ -1243,6 +1243,9 @@ def setup(app: Sphinx) -> Dict[str, Any]:
# load default math renderer
app.setup_extension('sphinx.ext.mathjax')
+ # load tr... | diff --git a/tests/test_markup.py b/tests/test_markup.py
--- a/tests/test_markup.py
+++ b/tests/test_markup.py
@@ -16,6 +16,7 @@
from docutils.transforms.universal import SmartQuotes
from sphinx import addnodes
+from sphinx.builders.html.transforms import KeyboardTransform
from sphinx.builders.latex import LaTeXBu... | ["tests/test_markup.py::test_inline[verify-:rfc:`2324`-<p><span", "tests/test_markup.py::test_inline[verify-:rfc:`2324#id1`-<p><span", "tests/test_markup.py::test_inline[verify_re-``code", "tests/test_markup.py::test_inline[verify-:menuselection:`a", "tests/test_markup.py::test_inline[verify-:menuselection:`&Foo", "tes... | [] | null | true | 2020-05-02T06:10:58Z | 3 | 76 | 30 | 1,246 | 0 | 0.8 | 1 | 0.55 | 1 | 0.461 | 79.758 | |
9,251 | swe_bench::test::1562 | swe_bench | test | 1,562 | scikit-learn__scikit-learn-12760 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | e73acef80de4159722b11e3cd6c20920382b9728 | Davies Bouldin measure: division by zero
I'm facing a problem with the davies bouldin measure.
This is the warning that I get:
.local/lib/python3.7/site-packages/sklearn/metrics/cluster/unsupervised.py:342: RuntimeWarning: divide by zero encountered in true_divide
score = (intra_dists[:, None] + intra_dis... | It would help if you provide some data (whether or not it gives that warning) for which the implementations give different results
(the stack overflow implementation won't work if your labels are not (0, 1, ..., n clusters - 1)
Mmmh the labels are generated from MiniBatchKMeans so I _think_ they should be correct.
I... | diff --git a/sklearn/metrics/cluster/unsupervised.py b/sklearn/metrics/cluster/unsupervised.py
--- a/sklearn/metrics/cluster/unsupervised.py
+++ b/sklearn/metrics/cluster/unsupervised.py
@@ -299,8 +299,12 @@ def calinski_harabaz_score(X, labels):
def davies_bouldin_score(X, labels):
"""Computes the Davies-Bouldin... | diff --git a/sklearn/metrics/cluster/tests/test_unsupervised.py b/sklearn/metrics/cluster/tests/test_unsupervised.py
--- a/sklearn/metrics/cluster/tests/test_unsupervised.py
+++ b/sklearn/metrics/cluster/tests/test_unsupervised.py
@@ -234,6 +234,15 @@ def test_davies_bouldin_score():
labels = [0] * 10 + [1] * 10 +... | ["sklearn/metrics/cluster/tests/test_unsupervised.py::test_davies_bouldin_score"] | ["sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_cluster_size_1", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_paper_example", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_correct_labelsize", "sklearn/m... | null | true | 2018-12-12T15:03:09Z | 1 | 15 | 1 | 4,737 | 0 | 0.8 | 1 | 0.47 | 1 | 0.55 | 79.745 | |
9,252 | swe_bench::dev::207 | swe_bench | dev | 207 | sqlfluff__sqlfluff-4041 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 66fd602d0824138f212082c8fdf381266a9edad3 | Deduplicate violations in the same position
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### Description
When linting jinja files with loops we get multiple output violations for each time around the loop. e.g.
```sql
select
a,
... | diff --git a/src/sqlfluff/core/errors.py b/src/sqlfluff/core/errors.py
--- a/src/sqlfluff/core/errors.py
+++ b/src/sqlfluff/core/errors.py
@@ -1,5 +1,5 @@
"""Errors - these are closely linked to what used to be called violations."""
-from typing import Optional, Tuple, List
+from typing import Optional, Tuple, Any, Li... | diff --git a/test/core/linter_test.py b/test/core/linter_test.py
--- a/test/core/linter_test.py
+++ b/test/core/linter_test.py
@@ -407,8 +407,9 @@ def test__linter__empty_file():
(
False,
[
- ("L006", 3, 16),
- ("L006", 3, 16),
+ # there ar... | ["test/core/linter_test.py::test__linter__mask_templated_violations[False-check_tuples1]"] | ["test/core/linter_test.py::test__linter__path_from_paths__dir", "test/core/linter_test.py::test__linter__path_from_paths__default", "test/core/linter_test.py::test__linter__path_from_paths__exts", "test/core/linter_test.py::test__linter__path_from_paths__file", "test/core/linter_test.py::test__linter__skip_large_bytes... | null | true | 2022-11-08T09:57:07Z | 3 | 68 | 1 | 1,354 | 0 | 0.8 | 1 | 0.55 | 1 | 0.452333 | 79.732 | ||
9,253 | swe_bench::dev::91 | swe_bench | dev | 91 | pydicom__pydicom-1375 | pydicom/pydicom | pydicom/pydicom | python | c14bf96040e4cc930db890638b9f190d4ede0a21 | Pickling/unpickling timezone in DT does not work
**Describe the bug**
The following tests fail because the timezone is not set in the unpickled `DT`:
```py
def test_pickling_with_timezone():
dt = pydicom.valuerep.DT("19111213212123-0630")
loaded_dt = pickle.loads(pickle.dumps(dt))
assert dt... | diff --git a/pydicom/valuerep.py b/pydicom/valuerep.py
--- a/pydicom/valuerep.py
+++ b/pydicom/valuerep.py
@@ -2,23 +2,19 @@
"""Special classes for DICOM value representations (VR)"""
import datetime
-from decimal import Decimal
-from math import floor, isfinite, log10
-import platform
import re
import sys
+impor... | diff --git a/pydicom/tests/test_valuerep.py b/pydicom/tests/test_valuerep.py
--- a/pydicom/tests/test_valuerep.py
+++ b/pydicom/tests/test_valuerep.py
@@ -5,10 +5,7 @@
import copy
from datetime import datetime, date, time, timedelta, timezone
from decimal import Decimal
-try:
- import cPickle as pickle
-except Im... | ["pydicom/tests/test_valuerep.py::TestDT::test_pickling_with_timezone", "pydicom/tests/test_valuerep.py::TestDT::test_pickling_dt_from_datetime_with_timezone", "pydicom/tests/test_valuerep.py::TestDT::test_datetime_behavior", "pydicom/tests/test_valuerep.py::TestDA::test_date_behavior"] | ["pydicom/tests/test_valuerep.py::TestTM::test_pickling", "pydicom/tests/test_valuerep.py::TestTM::test_pickling_tm_from_time", "pydicom/tests/test_valuerep.py::TestTM::test_str_and_repr", "pydicom/tests/test_valuerep.py::TestTM::test_new_empty_str", "pydicom/tests/test_valuerep.py::TestTM::test_new_str_conversion", "p... | null | true | 2021-05-03T18:27:35Z | 1 | 95 | 4 | 780 | 0 | 0.8 | 1 | 0.55 | 1 | 0.446667 | 79.715 | ||
9,254 | r2e_gym::train::5237 | r2e_gym | train | 5,237 | pyramid__c7bff5045ad928166695fb6bb8154443387e4184 | pyramid | pylons/pyramid | python | c7bff5045ad928166695fb6bb8154443387e4184 | **Title:** Router Fails to Utilize Alternative Views When `PredicateMismatch` is Raised
**Description:**
When a view callable raises a `PredicateMismatch` exception, the router does not attempt to find other views that might satisfy the request predicates. This leads to the request failing with a `PredicateMismatch` e... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,49 @@
``AttributeError`` that could be raised from any user-defined code within
a dynamic property. It is recommended to define a dynamic ACL as a callable
to avoid this ambiguity. See https://github.com/Pylons/pyramid/issu... | diff --git a/pyramid/tests/test_router.py b/pyramid/tests/test_router.py
--- a/pyramid/tests/test_router.py
+++ b/pyramid/tests/test_router.py
@@ -1164,6 +1164,78 @@
start_response = DummyStartResponse()
self.assertRaises(RuntimeError, router, environ, start_response)
+ def test_call_view_raises_... | null | null | namanjain12/pyramid_final:c7bff5045ad928166695fb6bb8154443387e4184 | true | null | 2 | 64 | null | 1,722 | 0.03125 | 0.75 | 1 | 0.6375 | 1 | 0.500333 | 79.671527 | ||
9,255 | swe_bench::test::16 | swe_bench | test | 16 | astropy__astropy-13158 | astropy/astropy | astropy/astropy | python | b185ca184f8dd574531dcc21e797f00537fefa6a | Model evaluation fails if any model parameter is a `MagUnit` type value
### Description
As discovered by @larrybradley in PR #13116, models will fail to evaluate when one of the parameters has a `MagUnit`.
A simplified reproducer is the following code:
```python
from astropy.modeling.models import Const1D
import ast... | Note that the simple change of https://github.com/astropy/astropy/blob/675dc03e138d5c6a1cb6936a6b2c3211f39049d3/astropy/modeling/core.py#L2704
to `value = value * unit` with the above example still passes all the modeling unit tests. However, it produces a different error
```python
----------------------------------... | diff --git a/astropy/modeling/bounding_box.py b/astropy/modeling/bounding_box.py
--- a/astropy/modeling/bounding_box.py
+++ b/astropy/modeling/bounding_box.py
@@ -520,7 +520,7 @@ def _set_outputs_unit(outputs, valid_outputs_unit):
"""
if valid_outputs_unit is not None:
- return Quantity(o... | diff --git a/astropy/modeling/tests/test_models_quantities.py b/astropy/modeling/tests/test_models_quantities.py
--- a/astropy/modeling/tests/test_models_quantities.py
+++ b/astropy/modeling/tests/test_models_quantities.py
@@ -18,7 +18,7 @@
from astropy.modeling.physical_models import Drude1D, Plummer1D
from astropy.... | ["astropy/modeling/tests/test_models_quantities.py::test_models_evaluate_with_units[model38]", "astropy/modeling/tests/test_models_quantities.py::test_models_evaluate_with_units_x_array[model38]", "astropy/modeling/tests/test_models_quantities.py::test_models_evaluate_with_units_param_array[model38]", "astropy/modeling... | ["astropy/modeling/tests/test_models_quantities.py::test_models_evaluate_without_units[model0]", "astropy/modeling/tests/test_models_quantities.py::test_models_evaluate_without_units[model2]", "astropy/modeling/tests/test_models_quantities.py::test_models_evaluate_without_units[model3]", "astropy/modeling/tests/test_mo... | null | true | 2022-04-22T17:32:23Z | 7 | 100 | 17 | 4,921 | 0 | 0.8 | 1 | 0.77 | 0.6 | 0.833333 | 79.645 | |
9,256 | r2e_gym::train::253 | r2e_gym | train | 253 | orange3__32f5693e9d037ff1b0d76f25adf3db26912f6763 | orange3 | biolab/orange3 | python | 32f5693e9d037ff1b0d76f25adf3db26912f6763 | **Analysis:**
- **Key Parts:**
- **Commit Message:** "Edit Domain: Map bool to bool."
- **Commit Patch:** Introduces a mapping from string values `"True"` and `"False"` to boolean `True` and `False` respectively in `io_base.py`.
- **Failing Test Before Commit:** `test_annotation_bool` failed with `AssertionError... | diff --git a/Orange/data/io_base.py b/Orange/data/io_base.py
--- a/Orange/data/io_base.py
+++ b/Orange/data/io_base.py
@@ -61,6 +61,9 @@
except SyntaxError:
# If parsing failed, treat value as string
pass
+ # map True ... | diff --git a/Orange/widgets/data/tests/test_oweditdomain.py b/Orange/widgets/data/tests/test_oweditdomain.py
--- a/Orange/widgets/data/tests/test_oweditdomain.py
+++ b/Orange/widgets/data/tests/test_oweditdomain.py
@@ -217,6 +217,30 @@
t2 = self.get_output(self.widget.Outputs.data)
self.assertEqual(t2... | null | null | namanjain12/orange3_final:32f5693e9d037ff1b0d76f25adf3db26912f6763 | true | null | 1 | 3 | null | 2,478 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.423 | 79.644 | ||
9,257 | r2e_gym::train::5937 | r2e_gym | train | 5,937 | tornado__1c3d22fcf5305ebe506c4ac1e5ab760b7ddf4c04 | tornado | tornadoweb/tornado | python | 1c3d22fcf5305ebe506c4ac1e5ab760b7ddf4c04 | **Analysis:**
- **Key Parts of Commit Details and Test Results:**
- **Commit Message:** Fix multiple calls to `Event.clear`.
- **Commit Patch:** Modifies the `clear` method in `tornado/locks.py` to reset the future only if it's done.
- **Failing Test in Old Commit:** The `test_event_wait_clear` failed with an `A... | diff --git a/tornado/locks.py b/tornado/locks.py
--- a/tornado/locks.py
+++ b/tornado/locks.py
@@ -110,7 +110,8 @@
Calls to `.wait` will block until `.set` is called.
"""
- self._future = Future()
+ if self._future.done():
+ self._future = Future()
def wait(se... | diff --git a/tornado/test/locks_test.py b/tornado/test/locks_test.py
--- a/tornado/test/locks_test.py
+++ b/tornado/test/locks_test.py
@@ -206,6 +206,15 @@
e.set()
self.assertTrue(e.is_set())
+ def test_event_wait_clear(self):
+ e = locks.Event()
+ f0 = e.wait()
+ e.clear()
+... | null | null | namanjain12/tornado_final:1c3d22fcf5305ebe506c4ac1e5ab760b7ddf4c04 | true | null | 1 | 3 | null | 2,460 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.42 | 79.635 | ||
9,258 | swe_bench::test::1051 | swe_bench | test | 1,051 | matplotlib__matplotlib-24691 | matplotlib/matplotlib | matplotlib/matplotlib | python | 78bf53caacbb5ce0dc7aa73f07a74c99f1ed919b | [ENH]: set facecolor and edgecolor alpha separately
### Problem
I like making diagrams where my patch edge is solid but the fill is semi-transparent - in my case usually to fade out the color, but it's also useful to emphasize boundaries
:
assert_array_equal(c[:, 3], alpha)
+def test_to_rgba_array_accepts_color_alpha_... | ["lib/matplotlib/tests/test_colors.py::test_to_rgba_array_accepts_color_alpha_tuple", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_explicit_alpha_overrides_tuple_alpha", "lib/matplotlib/tests/test_colors.py::test_to_rgba_array_accepts_color_alpha_tuple_with_multiple_colors", "lib/matplotlib/tests/test_color... | ["lib/matplotlib/tests/test_colors.py::test_create_lookup_table[5-result0]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[2-result1]", "lib/matplotlib/tests/test_colors.py::test_create_lookup_table[1-result2]", "lib/matplotlib/tests/test_colors.py::test_index_dtype[uint8]", "lib/matplotlib/tests/test_... | null | true | 2022-12-10T18:13:37Z | 3 | 75 | 10 | 817 | 0 | 0.8 | 1 | 0.55 | 1 | 0.386167 | 79.5335 | ||
9,259 | swe_bench::test::1256 | swe_bench | test | 1,256 | pydata__xarray-4827 | pydata/xarray | pydata/xarray | python | f98d6f065db2ad1f8911cb22aa04b4e0210ecee4 | Option for combine_attrs with conflicting values silently dropped
`merge()` currently supports four options for merging `attrs`:
```
combine_attrs : {"drop", "identical", "no_conflicts", "override"}, \
default: "drop"
String indicating how to combine attrs of the objects being merged:
... | diff --git a/xarray/core/combine.py b/xarray/core/combine.py
--- a/xarray/core/combine.py
+++ b/xarray/core/combine.py
@@ -412,14 +412,16 @@ def combine_nested(
- "override": if indexes are of same size, rewrite indexes to be
those of the first object with that dimension. Indexes for the same
... | diff --git a/xarray/tests/test_combine.py b/xarray/tests/test_combine.py
--- a/xarray/tests/test_combine.py
+++ b/xarray/tests/test_combine.py
@@ -732,6 +732,17 @@ def test_combine_coords_combine_attrs_identical(self):
objs, concat_dim="x", join="outer", combine_attrs="identical"
)
+ ... | ["xarray/tests/test_combine.py::TestCombineAuto::test_combine_nested_combine_attrs_drop_conflicts", "xarray/tests/test_concat.py::TestConcatDataset::test_concat_combine_attrs_kwarg[drop_conflicts-var1_attrs8-var2_attrs8-expected_attrs8-False]", "xarray/tests/test_merge.py::TestMergeFunction::test_merge_arrays_attrs[dro... | ["xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_1d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_2d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_3d", "xarray/tests/test_combine.py::TestTileIDsFromNestedList::test_single_dataset", "xarray/tests/test_combine.py::Test... | null | true | 2021-01-19T22:54:10Z | 3 | 47 | 5 | 1,207 | 0 | 0.8 | 1 | 0.55 | 1 | 0.357833 | 79.4485 | ||
9,260 | r2e_gym::train::5648 | r2e_gym | train | 5,648 | scrapy__094dde6fdb1b03351888e437828af5da03f46352 | scrapy | scrapy/scrapy | python | 094dde6fdb1b03351888e437828af5da03f46352 | **Title:** SitemapSpider Fails to Properly Filter Sitemap Entries Based on Attributes
**Description:**
When utilizing the `SitemapSpider` with custom filtering criteria, certain sitemap entries are not being filtered as intended. This results in either unwanted URLs being processed or valid URLs being excluded from cr... | diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst
--- a/docs/topics/spiders.rst
+++ b/docs/topics/spiders.rst
@@ -680,6 +680,50 @@
Default is ``sitemap_alternate_links`` disabled.
+ .. method:: sitemap_filter(entries)
+
+ This is a filter funtion that could be overridden to select si... | diff --git a/tests/test_spider.py b/tests/test_spider.py
--- a/tests/test_spider.py
+++ b/tests/test_spider.py
@@ -375,6 +375,104 @@
'http://www.example.com/schweiz-deutsch/',
'http://www.example.com/italiano/'])
+ def test_sitemap_filter(self):
+ sitema... | null | null | namanjain12/scrapy_final:094dde6fdb1b03351888e437828af5da03f46352 | true | null | 2 | 58 | null | 1,347 | 0.03125 | 0.75 | 1 | 0.6375 | 1 | 0.417833 | 79.424027 | ||
9,261 | swe_bench::test::1727 | swe_bench | test | 1,727 | sphinx-doc__sphinx-10207 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 8b23f6db12d9fcdb6e1ca2015ea32e3e2e1fbdb6 | Allow keyboard shortcut `/` to focus on search
Various web services, notably GMail and GitHub, allow the keyboard shortcut `/` for focusing on the search box. It would be nice if Sphinx templates would do the same.
---
- Bitbucket: https://bitbucket.org/birkenfeld/sphinx/issue/691
- Originally reported by: Ram Rachum
... | _From Georg Brandl on 2011-05-15 09:42:40+00:00_
Good idea.
I do support the idea! It would be very handy.
I think this is good for the first contribution. Does anybody try to fix this?
Yes, I've just created a pull request for it.
| diff --git a/sphinx/builders/latex/transforms.py b/sphinx/builders/latex/transforms.py
--- a/sphinx/builders/latex/transforms.py
+++ b/sphinx/builders/latex/transforms.py
@@ -237,7 +237,8 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
blah blah blah ...
* Replace second and subsequent footnote ... | diff --git a/tests/roots/test-footnotes/index.rst b/tests/roots/test-footnotes/index.rst
--- a/tests/roots/test-footnotes/index.rst
+++ b/tests/roots/test-footnotes/index.rst
@@ -33,6 +33,7 @@ The section with a reference to [AuthorYear]_
* Second footnote: [1]_
* `Sphinx <http://sphinx-doc.org/>`_
* Third footnote:... | ["tests/test_build_latex.py::test_footnote", "tests/test_build_latex.py::test_footnote_referred_multiple_times", "tests/test_build_latex.py::test_latex_show_urls_is_inline", "tests/test_build_latex.py::test_latex_show_urls_is_footnote", "tests/test_build_latex.py::test_latex_show_urls_is_no", "tests/test_build_latex.py... | ["tests/test_build_html.py::test_html_warnings", "tests/test_build_html.py::test_html4_output", "tests/test_build_html.py::test_html5_output[images.html-expect0]", "tests/test_build_html.py::test_html5_output[images.html-expect1]", "tests/test_build_html.py::test_html5_output[images.html-expect2]", "tests/test_build_ht... | null | true | 2022-02-19T07:09:00Z | 7 | 74 | 7 | 4,360 | 0 | 0.8 | 1 | 0.77 | 0.6 | 0.746667 | 79.385 | |
9,262 | swe_bench::test::1150 | swe_bench | test | 1,150 | mwaskom__seaborn-3407 | mwaskom/seaborn | mwaskom/seaborn | python | 515286e02be3e4c0ff2ef4addb34a53c4a676ee4 | pairplot raises KeyError with MultiIndex DataFrame
When trying to pairplot a MultiIndex DataFrame, `pairplot` raises a `KeyError`:
MRE:
```python
import numpy as np
import pandas as pd
import seaborn as sns
data = {
("A", "1"): np.random.rand(100),
("A", "2"): np.random.rand(100),
("B", "1"): np.random.r... | diff --git a/seaborn/axisgrid.py b/seaborn/axisgrid.py
--- a/seaborn/axisgrid.py
+++ b/seaborn/axisgrid.py
@@ -1472,8 +1472,8 @@ def map_diag(self, func, **kwargs):
for ax in diag_axes[1:]:
share_axis(diag_axes[0], ax, "y")
- self.diag_vars = np.array(diag_vars, np.obj... | diff --git a/tests/test_axisgrid.py b/tests/test_axisgrid.py
--- a/tests/test_axisgrid.py
+++ b/tests/test_axisgrid.py
@@ -1422,6 +1422,13 @@ def test_pairplot_markers(self):
with pytest.warns(UserWarning):
g = ag.pairplot(self.df, hue="a", vars=vars, markers=markers[:-2])
+ def test_pairplot... | ["tests/test_axisgrid.py::TestPairGrid::test_pairplot_column_multiindex"] | ["tests/test_axisgrid.py::TestFacetGrid::test_self_data", "tests/test_axisgrid.py::TestFacetGrid::test_self_figure", "tests/test_axisgrid.py::TestFacetGrid::test_self_axes", "tests/test_axisgrid.py::TestFacetGrid::test_axes_array_size", "tests/test_axisgrid.py::TestFacetGrid::test_single_axes", "tests/test_axisgrid.py:... | null | true | 2023-06-27T23:17:29Z | 1 | 4 | 1 | 2,751 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.471833 | 79.3155 | ||
9,263 | swe_bench::test::1134 | swe_bench | test | 1,134 | mwaskom__seaborn-2846 | mwaskom/seaborn | mwaskom/seaborn | python | 8bae24f665f3732b66f8edf8d9bfd4a6d0db1906 | relplot does not handle numpy-types for dimensional variables
Test case:
```python
sns.relplot(
data=tips,
x="total_bill",
y=tips["tip"].to_numpy(),
col=tips["time"].to_numpy(),
)
```

Note how... | diff --git a/seaborn/distributions.py b/seaborn/distributions.py
--- a/seaborn/distributions.py
+++ b/seaborn/distributions.py
@@ -2137,8 +2137,8 @@ def displot(
grid_data = p.plot_data.rename(columns=p.variables)
grid_data = grid_data.loc[:, ~grid_data.columns.duplicated()]
- col_name = p.variables.get(... | diff --git a/tests/test_relational.py b/tests/test_relational.py
--- a/tests/test_relational.py
+++ b/tests/test_relational.py
@@ -497,16 +497,18 @@ def test_relplot_complex(self, long_df):
assert_array_equal(x, grp_df["x"])
assert_array_equal(y, grp_df["y"])
- @pytest.mark.parame... | ["tests/test_relational.py::TestRelationalPlotter::test_relplot_vectors[numpy]", "tests/test_relational.py::TestRelationalPlotter::test_relplot_vectors[list]", "tests/test_relational.py::TestRelationalPlotter::test_relplot_wide"] | ["tests/test_relational.py::TestRelationalPlotter::test_wide_df_variables", "tests/test_relational.py::TestRelationalPlotter::test_wide_df_with_nonnumeric_variables", "tests/test_relational.py::TestRelationalPlotter::test_wide_array_variables", "tests/test_relational.py::TestRelationalPlotter::test_flat_array_variables... | null | true | 2022-06-11T16:24:34Z | 2 | 16 | 3 | 1,400 | 0 | 0.8 | 1 | 0.55 | 1 | 0.286667 | 79.235 | ||
9,264 | swe_bench::dev::165 | swe_bench | dev | 165 | pyvista__pyvista-4311 | pyvista/pyvista | pyvista/pyvista | python | db6ee8dd4a747b8864caae36c5d05883976a3ae5 | Allow passing through cell data in `to_tetrahedra` method in RectilinearGrid
### Describe the feature you would like to be added.
No cell data is passed through when converting to a tetrahedra. The user can currently request to pass through the original cell id, but it requires one more step to regenerate the cell da... | diff --git a/pyvista/core/datasetattributes.py b/pyvista/core/datasetattributes.py
--- a/pyvista/core/datasetattributes.py
+++ b/pyvista/core/datasetattributes.py
@@ -1072,7 +1072,12 @@ def active_scalars_name(self) -> Optional[str]:
"""
if self.GetScalars() is not None:
- return str(self... | diff --git a/tests/filters/test_rectilinear_grid.py b/tests/filters/test_rectilinear_grid.py
--- a/tests/filters/test_rectilinear_grid.py
+++ b/tests/filters/test_rectilinear_grid.py
@@ -45,3 +45,25 @@ def test_to_tetrahedral_mixed(tiny_rectilinear):
def test_to_tetrahedral_edge_case():
with pytest.raises(Runtime... | ["tests/filters/test_rectilinear_grid.py::test_to_tetrahedral_pass_cell_ids", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral_pass_cell_data"] | ["tests/filters/test_rectilinear_grid.py::test_to_tetrahedral[5]", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral[6]", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral[12]", "tests/filters/test_rectilinear_grid.py::test_to_tetrahedral_raise", "tests/filters/test_rectilinear_grid.py::test_to_te... | null | true | 2023-04-20T18:23:33Z | 2 | 38 | 2 | 926 | 0 | 0.8 | 1 | 0.55 | 1 | 0.281 | 79.218 | ||
9,265 | swe_bench::test::1568 | swe_bench | test | 1,568 | scikit-learn__scikit-learn-12938 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | acb810647233e40839203ac553429e8663169702 | AttributeError: 'PrettyPrinter' object has no attribute '_indent_at_name'
There's a failing example in #12654, and here's a piece of code causing it:
```
import numpy as np
from sklearn.datasets import load_digits
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.svm i... | So for some reason, the class is `PrettyPrinter` instead of `_EstimatorPrettyPrinter` (which inherits from `PrettyPrinter`). But then
```
File "/path/to//sklearn/utils/_pprint.py", line 175, in _pprint_estimator
if self._indent_at_name:
```
is a `_EstimatorPrettyPrinter` method, so I don't understand what... | diff --git a/sklearn/utils/_pprint.py b/sklearn/utils/_pprint.py
--- a/sklearn/utils/_pprint.py
+++ b/sklearn/utils/_pprint.py
@@ -321,7 +321,10 @@ def _pprint_key_val_tuple(self, object, stream, indent, allowance, context,
self._format(v, stream, indent + len(rep) + len(middle), allowance,
... | diff --git a/sklearn/utils/tests/test_pprint.py b/sklearn/utils/tests/test_pprint.py
--- a/sklearn/utils/tests/test_pprint.py
+++ b/sklearn/utils/tests/test_pprint.py
@@ -1,4 +1,5 @@
import re
+from pprint import PrettyPrinter
from sklearn.utils._pprint import _EstimatorPrettyPrinter
from sklearn.pipeline import m... | ["sklearn/utils/tests/test_pprint.py::test_builtin_prettyprinter"] | ["sklearn/utils/tests/test_pprint.py::test_basic", "sklearn/utils/tests/test_pprint.py::test_changed_only", "sklearn/utils/tests/test_pprint.py::test_pipeline", "sklearn/utils/tests/test_pprint.py::test_deeply_nested", "sklearn/utils/tests/test_pprint.py::test_gridsearch", "sklearn/utils/tests/test_pprint.py::test_grid... | null | true | 2019-01-07T22:45:53Z | 1 | 5 | 1 | 4,730 | 0 | 0.8 | 1 | 0.62 | 0.8 | 0.516667 | 79.17 | |
9,266 | swe_bench::test::1421 | swe_bench | test | 1,421 | pytest-dev__pytest-6214 | pytest-dev/pytest | pytest-dev/pytest | python | f24f20a46e0efd8b375ab3457e9f6864e59979e5 | --setup-plan and --setup-only seem to claim different things
I have the following example:
```python
from pytest import fixture
@fixture(scope='module')
def fixture1():
print('Setup of fixture1')
yield 'fixture1'
print('Teardown of fixture1')
@fixture(scope='module')
def fixture2():
print('Setup of fi... | Hi @oscarh,
could you state your expectations a little bit clearer? Are you surprised, that in your first output, the setup and teardown is announced more often than they would actually occur? I try to have a look into it over the weekend, but as far I remember, it was not straightforward to arrange the fixtures at th... | diff --git a/src/_pytest/setupplan.py b/src/_pytest/setupplan.py
--- a/src/_pytest/setupplan.py
+++ b/src/_pytest/setupplan.py
@@ -16,7 +16,8 @@ def pytest_addoption(parser):
def pytest_fixture_setup(fixturedef, request):
# Will return a dummy fixture if the setuponly option is provided.
if request.config.op... | diff --git a/testing/python/setup_plan.py b/testing/python/setup_plan.py
--- a/testing/python/setup_plan.py
+++ b/testing/python/setup_plan.py
@@ -17,3 +17,94 @@ def test_arg(arg):
result.stdout.fnmatch_lines(
["*SETUP F arg*", "*test_arg (fixtures used: arg)", "*TEARDOWN F arg*"]
)
+
+
+def test_... | ["testing/python/setup_plan.py::test_show_multi_test_fixture_setup_and_teardown_correctly_simple", "testing/python/setup_plan.py::test_show_multi_test_fixture_setup_and_teardown_same_as_setup_show"] | ["testing/python/setup_plan.py::test_show_fixtures_and_test"] | null | true | 2019-11-17T22:54:57Z | 1 | 3 | 2 | 3,593 | 0 | 0.8 | 1 | 0.62 | 0.8 | 0.51 | 79.15 | |
9,267 | swe_bench::test::1147 | swe_bench | test | 1,147 | mwaskom__seaborn-3217 | mwaskom/seaborn | mwaskom/seaborn | python | 623b0b723c671e99f04e8ababf19adc563f30168 | Width computation after histogram slightly wrong with log scale
Note the slight overlap here:
```python
(
so.Plot(tips, "total_bill")
.add(so.Bars(alpha=.3, edgewidth=0), so.Hist(bins=4))
.scale(x="log")
)
```
 -> DataFrame:
# TODO do we still have numbers in the variable name at this point?
coord_cols = [c for c in df if re.match(r"^[xy]\D*$", ... | diff --git a/tests/_marks/test_bar.py b/tests/_marks/test_bar.py
--- a/tests/_marks/test_bar.py
+++ b/tests/_marks/test_bar.py
@@ -200,3 +200,13 @@ def test_unfilled(self, x, y):
colors = p._theme["axes.prop_cycle"].by_key()["color"]
assert_array_equal(fcs, to_rgba_array([colors[0]] * len(x), 0))
... | ["tests/_marks/test_bar.py::TestBars::test_log_scale"] | ["tests/_marks/test_bar.py::TestBar::test_categorical_positions_vertical", "tests/_marks/test_bar.py::TestBar::test_categorical_positions_horizontal", "tests/_marks/test_bar.py::TestBar::test_numeric_positions_vertical", "tests/_marks/test_bar.py::TestBar::test_numeric_positions_horizontal", "tests/_marks/test_bar.py::... | null | true | 2023-01-10T12:37:28Z | 2 | 31 | 1 | 906 | 0 | 0.8 | 1 | 0.55 | 1 | 0.254333 | 79.138 | ||
9,268 | r2e_gym::train::389 | r2e_gym | train | 389 | orange3__ba814bd7c2ff10e3daf74b6f32cc596ce2255029 | orange3 | biolab/orange3 | python | ba814bd7c2ff10e3daf74b6f32cc596ce2255029 | **Title:** Scatterplot Crashes with ValueError When Using a Single Time Tick
**Description:**
When creating a scatterplot with only one time tick, the application crashes due to a `ValueError`. This occurs because the code attempts to calculate the minimum spacing between ticks, but with only one tick, the sequence is... | diff --git a/Orange/widgets/visualize/owscatterplotgraph.py b/Orange/widgets/visualize/owscatterplotgraph.py
--- a/Orange/widgets/visualize/owscatterplotgraph.py
+++ b/Orange/widgets/visualize/owscatterplotgraph.py
@@ -302,7 +302,10 @@
step = int(np.ceil(float(len(ticks)) / max_steps))
ticks =... | diff --git a/Orange/widgets/visualize/tests/test_owscatterplot.py b/Orange/widgets/visualize/tests/test_owscatterplot.py
--- a/Orange/widgets/visualize/tests/test_owscatterplot.py
+++ b/Orange/widgets/visualize/tests/test_owscatterplot.py
@@ -1130,6 +1130,10 @@
with self.assertRaises(ValueError):
... | null | null | namanjain12/orange3_final:ba814bd7c2ff10e3daf74b6f32cc596ce2255029 | true | null | 1 | 5 | null | 1,348 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.241333 | 79.099 | ||
9,269 | swe_bench::test::1858 | swe_bench | test | 1,858 | sphinx-doc__sphinx-8951 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | b923165d5ef289ba39bb964201d4a036eb5a5ff6 | Support C++20's spaceship operator
C++20 has the new spaceship operator `<=>` for three way comparisons which can also be [defaulted](https://en.cppreference.com/w/cpp/language/default_comparisons) (not sure if the latter matters to Sphinx).
I hope this is a problem with Sphinx at all and not with the Breathe extensio... | diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -306,6 +306,7 @@
| \+\+ | --
| ->\*? | \,
| (<<|>>)=? | && | \|\|
+ | <=>
| [!<>=/*%+|&^~-]=?
| (\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|xor|xor_eq)\... | diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py
--- a/tests/test_domain_cpp.py
+++ b/tests/test_domain_cpp.py
@@ -289,13 +289,16 @@ class Config:
exprCheck('5 == 42', 'eqL5EL42E')
exprCheck('5 != 42', 'neL5EL42E')
exprCheck('5 not_eq 42', 'neL5EL42E')
- # ['<=', '>=', '<', '>']
+ #... | ["tests/test_domain_cpp.py::test_expressions", "tests/test_domain_cpp.py::test_operators"] | ["tests/test_domain_cpp.py::test_fundamental_types", "tests/test_domain_cpp.py::test_type_definitions", "tests/test_domain_cpp.py::test_concept_definitions", "tests/test_domain_cpp.py::test_member_definitions", "tests/test_domain_cpp.py::test_function_definitions", "tests/test_domain_cpp.py::test_nested_name", "tests/t... | null | true | 2021-03-02T19:28:19Z | 1 | 6 | 2 | 1,290 | 0 | 0.8 | 1 | 0.55 | 1 | 0.235 | 79.08 | ||
9,270 | r2e_gym::train::5161 | r2e_gym | train | 5,161 | pyramid__a43abd25858d3e60f525c12da5a271e30a99c4fb | pyramid | pylons/pyramid | python | a43abd25858d3e60f525c12da5a271e30a99c4fb | **Title:** Passing Non-Integer `reissue_time` Causes Type Errors and Validation Failures
**Description:**
When initializing a cookie session with a string value for the `reissue_time` parameter, unexpected behavior occurs. Specifically, providing a non-integer string leads to type-related errors and prevents proper se... | diff --git a/pyramid/session.py b/pyramid/session.py
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -245,7 +245,7 @@
_cookie_httponly = httponly
_cookie_on_exception = set_on_exception
_timeout = timeout if timeout is None else int(timeout)
- _reissue_time = reissue_time
+ ... | diff --git a/pyramid/tests/test_session.py b/pyramid/tests/test_session.py
--- a/pyramid/tests/test_session.py
+++ b/pyramid/tests/test_session.py
@@ -76,7 +76,6 @@
cookieval = self._serialize((time.time() - 5, 0, {'state': 1}))
request.cookies['session'] = cookieval
self.assertRaises(ValueEr... | null | null | namanjain12/pyramid_final:a43abd25858d3e60f525c12da5a271e30a99c4fb | true | null | 1 | 3 | null | 1,341 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.2335 | 79.0755 | ||
9,271 | r2e_gym::train::468 | r2e_gym | train | 468 | orange3__5b67ff8bcc42fd67c7299c88b0be3a181d8596cf | orange3 | biolab/orange3 | python | 5b67ff8bcc42fd67c7299c88b0be3a181d8596cf | **Title:** Crash in Error Delegate When Actual Value is `None`
**Description:**
When the error delegate attempts to draw a bar with an unknown actual value (`None`), it crashes due to an unhandled case. The method incorrectly tries to evaluate `numpy.isnan(None)`, which is not supported and results in a `TypeError`.
... | diff --git a/Orange/widgets/evaluate/owpredictions.py b/Orange/widgets/evaluate/owpredictions.py
--- a/Orange/widgets/evaluate/owpredictions.py
+++ b/Orange/widgets/evaluate/owpredictions.py
@@ -1124,7 +1124,7 @@
def drawBar(self, painter, option, index, rect):
value = self.cachedData(index, Qt.DisplayR... | diff --git a/Orange/widgets/evaluate/tests/test_owpredictions.py b/Orange/widgets/evaluate/tests/test_owpredictions.py
--- a/Orange/widgets/evaluate/tests/test_owpredictions.py
+++ b/Orange/widgets/evaluate/tests/test_owpredictions.py
@@ -1839,6 +1839,10 @@
delegate.drawBar(painter, Mock(), index, rect)
... | null | null | namanjain12/orange3_final:5b67ff8bcc42fd67c7299c88b0be3a181d8596cf | true | null | 1 | 4 | null | 1,312 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.232 | 79.071 | ||
9,272 | r2e_gym::train::4461 | r2e_gym | train | 4,461 | numpy__0fefb94edf3d30e4336a43df4f36bbf46a018da9 | numpy | numpy/numpy | python | 0fefb94edf3d30e4336a43df4f36bbf46a018da9 | **Title:** Unclear TypeError when operands do not implement `__array_ufunc__`
**Description:**
When using NumPy universal functions (ufuncs) with custom classes that do not implement the `__array_ufunc__` method, the resulting TypeError message is not sufficiently descriptive. This makes it difficult to understand tha... | diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -695,9 +695,10 @@
for k, v in kwargs.items()])
args = inputs + kwargs.get('out', ())
types_string = ', '.join(repr(type(arg).__name__) for arg in args)
- ... | diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -1931,14 +1931,14 @@
def __array_ufunc__(self, *args, **kwargs):
return NotImplemented
- msg = ("operand type(s) do not impleme... | null | null | namanjain12/numpy_final:0fefb94edf3d30e4336a43df4f36bbf46a018da9 | true | null | 1 | 5 | null | 1,288 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.231333 | 79.069 | ||
9,273 | swe_bench::test::1311 | swe_bench | test | 1,311 | pydata__xarray-7347 | pydata/xarray | pydata/xarray | python | 92e7cb5b21a6dee7f7333c66e41233205c543bc1 | assign_coords reset all dimension coords to default (pandas) index
### What happened?
See https://github.com/martinfleis/xvec/issues/13#issue-1472023524
### What did you expect to happen?
`assign_coords()` should preserve the index of coordinates that are not updated or not part of a dropped multi-coordinate index.
... | diff --git a/xarray/core/merge.py b/xarray/core/merge.py
--- a/xarray/core/merge.py
+++ b/xarray/core/merge.py
@@ -355,12 +355,12 @@ def append_all(variables, indexes):
for name, variable in mapping.items():
if isinstance(variable, DataArray):
- coords = variable._coords.copy() #... | diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py
--- a/xarray/tests/test_dataset.py
+++ b/xarray/tests/test_dataset.py
@@ -4170,6 +4170,20 @@ def test_assign_all_multiindex_coords(self) -> None:
is not actual.xindexes["level_2"]
)
+ def test_assign_coords_custom_index_... | ["xarray/tests/test_dataset.py::TestDataset::test_assign_coords_custom_index_side_effect"] | ["xarray/tests/test_dataset.py::TestDataset::test_repr", "xarray/tests/test_dataset.py::TestDataset::test_repr_multiindex", "xarray/tests/test_dataset.py::TestDataset::test_repr_period_index", "xarray/tests/test_dataset.py::TestDataset::test_unicode_data", "xarray/tests/test_dataset.py::TestDataset::test_repr_nep18", "... | null | true | 2022-12-02T08:19:01Z | 1 | 12 | 1 | 1,130 | 0 | 0.8 | 1 | 0.55 | 1 | 0.228333 | 79.06 | ||
9,274 | swe_bench::test::1176 | swe_bench | test | 1,176 | psf__requests-1888 | psf/requests | psf/requests | python | 19756d57f73c2062240dd477dd8f8d8a7c0c512a | 301 redirect broken with latest pyopenssl/SNI
With the latest pyopenssl on Windows 64bit:
```
cryptography==0.2.dev1
ndg-httpsclient==0.3.2
pyOpenSSL==0.13
pyasn1==0.1.7
```
I get an exception raised when `GET`ing a `301` response to a HTTPS request. I see that after the redirect is received the returned URL is [deco... | diff --git a/requests/sessions.py b/requests/sessions.py
--- a/requests/sessions.py
+++ b/requests/sessions.py
@@ -17,7 +17,7 @@
cookiejar_from_dict, extract_cookies_to_jar, RequestsCookieJar, merge_cookies)
from .models import Request, PreparedRequest
from .hooks import default_hooks, dispatch_hook
-from .utils... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -412,6 +412,9 @@ def test_unicode_get(self):
def test_unicode_header_name(self):
requests.put(httpbin('put'), headers={str('Content-Type'): 'application/octet-stream'}, data='\xff') # compat.str is unicode.
... | ["test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_HTTP_200_OK_GET_WITH_MIXED_PARAMS", "test_requests.py::RequestsTestCase::test_cookie_persists_via_api", "test_requests.py::RequestsTestCase::test_params_are_merged_case_sensitive", "test_requests.py::... | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_DIGEST_HTTP_200_OK_GET", "test_requests.py::RequestsTes... | null | true | 2014-01-28T17:18:12Z | 1 | 4 | 7 | 2,235 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.385833 | 79.0575 | ||
9,275 | r2e_gym::train::4746 | r2e_gym | train | 4,746 | numpy__8bac6eed123c68560ffdb5d7f7093ad4015a9d85 | numpy | numpy/numpy | python | 8bac6eed123c68560ffdb5d7f7093ad4015a9d85 | **Analysis:**
1. **Key Parts from Commit Details and Test Results:**
- **Commit Message Highlights:**
- Added commas within `data` and `mask`.
- Displayed `dtypes` (e.g., `float32`, `int8`) where previously omitted.
- Corrected indentation for wrapped fields.
- Removed spaces around `=` to compl... | diff --git a/doc/release/1.14.0-notes.rst b/doc/release/1.14.0-notes.rst
--- a/doc/release/1.14.0-notes.rst
+++ b/doc/release/1.14.0-notes.rst
@@ -503,3 +503,10 @@
``RandomState`` previously would accept empty arrays or arrays with 2 or more
dimensions, which resulted in either a failure to seed (empty arrays) or for... | diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -14,6 +14,7 @@
import operator
import itertools
import sys
+import textwrap
from functools import reduce
@@ -487,18 +488,95 @@
def test_str_repr(self):
a = ... | null | null | namanjain12/numpy_final:8bac6eed123c68560ffdb5d7f7093ad4015a9d85 | true | null | 2 | 91 | null | 2,818 | 0 | 0.75 | 1 | 0.525 | 1 | 0.773 | 79.0315 | ||
9,276 | r2e_gym::train::5373 | r2e_gym | train | 5,373 | aiohttp__3c31b3837404fa2fed3cdd42e89f9d6f25c6931e | aiohttp | aio-libs/aiohttp | python | 3c31b3837404fa2fed3cdd42e89f9d6f25c6931e | **Title:** Incorrect Error Message When Initializing MultiDict with Excessive Positional Arguments
**Description:**
When attempting to create a `MultiDict` with more than the allowed number of positional arguments, the raised `TypeError` message inaccurately reports the number of arguments provided. This discrepancy c... | diff --git a/aiohttp/multidict.py b/aiohttp/multidict.py
--- a/aiohttp/multidict.py
+++ b/aiohttp/multidict.py
@@ -15,9 +15,10 @@
def __init__(self, *args, **kwargs):
if len(args) > 1:
- raise TypeError("MultiDict takes at most 2 positional "
- "arguments ({} given)... | diff --git a/tests/test_multidict.py b/tests/test_multidict.py
--- a/tests/test_multidict.py
+++ b/tests/test_multidict.py
@@ -21,7 +21,7 @@
self.assertEqual(list(d.items(getall=True)), [])
self.assertNotEqual(self.make_dict(), list())
- with self.assertRaisesRegex(TypeError, "\(3 given\)"):
... | null | null | namanjain12/aiohttp_final:3c31b3837404fa2fed3cdd42e89f9d6f25c6931e | true | null | 1 | 5 | null | 1,209 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.218167 | 79.0295 | ||
9,277 | r2e_gym::train::363 | r2e_gym | train | 363 | orange3__c4c47757fb51bc8b774fd9232d5ec4e3ab067cdc | orange3 | biolab/orange3 | python | c4c47757fb51bc8b774fd9232d5ec4e3ab067cdc | **Title:** OWTable Widget: AttributeError When Toggling Row Selection or Variable Labels
**Description**
When using the OWTable widget, attempting to toggle the "Select Whole Rows" or "Show Variable Labels" options results in an `AttributeError`. This error occurs because the widget incorrectly tries to call the `.val... | diff --git a/Orange/widgets/data/owtable.py b/Orange/widgets/data/owtable.py
--- a/Orange/widgets/data/owtable.py
+++ b/Orange/widgets/data/owtable.py
@@ -593,7 +593,7 @@
def _on_show_variable_labels_changed(self):
"""The variable labels (var.attribues) visibility was changed."""
- for slot in se... | diff --git a/Orange/widgets/data/tests/test_owtable.py b/Orange/widgets/data/tests/test_owtable.py
--- a/Orange/widgets/data/tests/test_owtable.py
+++ b/Orange/widgets/data/tests/test_owtable.py
@@ -60,7 +60,7 @@
def _select_data(self):
self.widget.selected_cols = list(range(len(self.data.domain.variabl... | null | null | namanjain12/orange3_final:c4c47757fb51bc8b774fd9232d5ec4e3ab067cdc | true | null | 1 | 4 | null | 1,213 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.2155 | 79.0215 | ||
9,278 | swe_bench::test::1871 | swe_bench | test | 1,871 | sphinx-doc__sphinx-9233 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 8d87dde43ba0400c46d791e42d9b50bc879cdddb | New hook to customize base list
I would like to change the formatting of the base list for classes. Specifially I would like to provide information about parameterized types (e.g. `Dict[str, int`]). See agronholm/sphinx-autodoc-typehints#8 for how I want to use it.
For that I need a new hook/event similar to the exist... | diff --git a/sphinx/ext/autodoc/__init__.py b/sphinx/ext/autodoc/__init__.py
--- a/sphinx/ext/autodoc/__init__.py
+++ b/sphinx/ext/autodoc/__init__.py
@@ -1641,18 +1641,23 @@ def add_directive_header(self, sig: str) -> None:
# add inheritance info, if wanted
if not self.doc_as_attr and self.options.... | diff --git a/tests/test_ext_autodoc_autoclass.py b/tests/test_ext_autodoc_autoclass.py
--- a/tests/test_ext_autodoc_autoclass.py
+++ b/tests/test_ext_autodoc_autoclass.py
@@ -10,6 +10,7 @@
"""
import sys
+from typing import List, Union
import pytest
@@ -264,6 +265,47 @@ def test_show_inheritance_for_subclass_o... | ["tests/test_ext_autodoc_autoclass.py::test_autodoc_process_bases"] | ["tests/test_ext_autodoc_autoclass.py::test_classes", "tests/test_ext_autodoc_autoclass.py::test_instance_variable", "tests/test_ext_autodoc_autoclass.py::test_inherited_instance_variable", "tests/test_ext_autodoc_autoclass.py::test_uninitialized_attributes", "tests/test_ext_autodoc_autoclass.py::test_undocumented_unin... | null | true | 2021-05-15T15:38:25Z | 1 | 20 | 1 | 877 | 0 | 0.8 | 1 | 0.55 | 1 | 0.212833 | 79.0135 | ||
9,279 | r2e_gym::train::5233 | r2e_gym | train | 5,233 | pyramid__469f410c38b49b895f4f31de0423be0a4f2de47a | pyramid | pylons/pyramid | python | 469f410c38b49b895f4f31de0423be0a4f2de47a | **Title:** RendererHelper Fails to Handle Iterable Responses Due to Missing `app_iter` Attribute
**Description:**
After updating the renderer to support returning iterables by setting `response.app_iter`, certain response objects do not have the `app_iter` attribute. This leads to an `AttributeError` when the renderer... | diff --git a/pyramid/renderers.py b/pyramid/renderers.py
--- a/pyramid/renderers.py
+++ b/pyramid/renderers.py
@@ -453,6 +453,10 @@
if result is not None:
if isinstance(result, text_type):
response.text = result
+ elif isinstance(result, bytes):
+ respons... | diff --git a/pyramid/tests/test_renderers.py b/pyramid/tests/test_renderers.py
--- a/pyramid/tests/test_renderers.py
+++ b/pyramid/tests/test_renderers.py
@@ -194,8 +194,8 @@
helper = self._makeOne('loo.foo')
response = helper.render_to_response('values', {},
... | null | null | namanjain12/pyramid_final:469f410c38b49b895f4f31de0423be0a4f2de47a | true | null | 1 | 4 | null | 1,144 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.204 | 78.987 | ||
9,280 | r2e_gym::train::6107 | r2e_gym | train | 6,107 | pillow__af317a696d181bfdbfc28aed44496915a26bc90f | pillow | python-pillow/pillow | python | af317a696d181bfdbfc28aed44496915a26bc90f | **Title:** Missing MP Format Version in MPO Files Causes KeyError When Accessing Metadata
**Description:**
When saving MPO (Multi-Picture Object) images using the `PIL` library, the MP Format Version metadata is not included in the saved file. This omission leads to a `KeyError` when attempting to access the MP Format... | diff --git a/src/PIL/MpoImagePlugin.py b/src/PIL/MpoImagePlugin.py
--- a/src/PIL/MpoImagePlugin.py
+++ b/src/PIL/MpoImagePlugin.py
@@ -51,7 +51,7 @@
if not offsets:
# APP2 marker
im.encoderinfo["extra"] = (
- b"\xFF\xE2" + struct.pack(">H", 6 + 70) + b"M... | diff --git a/Tests/test_file_mpo.py b/Tests/test_file_mpo.py
--- a/Tests/test_file_mpo.py
+++ b/Tests/test_file_mpo.py
@@ -268,6 +268,7 @@
im_reloaded = roundtrip(im, save_all=True, append_images=[im2])
assert_image_equal(im, im_reloaded)
+ assert im_reloaded.mpinfo[45056] == b"0100"
im_reloaded.s... | null | null | namanjain12/pillow_final:af317a696d181bfdbfc28aed44496915a26bc90f | true | null | 1 | 3 | null | 1,153 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.202167 | 78.9815 | ||
9,281 | r2e_gym::train::5520 | r2e_gym | train | 5,520 | aiohttp__e058cbd14dd754c2b0138fdef28df58c5e3a2c5f | aiohttp | aio-libs/aiohttp | python | e058cbd14dd754c2b0138fdef28df58c5e3a2c5f | **Title:** Server Disconnects Instead of Returning 500 Error After "100-Continue" Failure
**Description:**
When a client sends a request with the `Expect: 100-continue` header and the server handler raises an exception, the server unexpectedly disconnects instead of responding with an appropriate error status. This le... | diff --git a/CHANGES/8876.bugfix.rst b/CHANGES/8876.bugfix.rst
--- a/CHANGES/8876.bugfix.rst
+++ b/CHANGES/8876.bugfix.rst
@@ -0,0 +1 @@
+Fixed error handling after 100-continue so server sends 500 response instead of disconnecting -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_url... | diff --git a/tests/test_web_functional.py b/tests/test_web_functional.py
--- a/tests/test_web_functional.py
+++ b/tests/test_web_functional.py
@@ -5,7 +5,7 @@
import pathlib
import socket
import zlib
-from typing import Any, Optional
+from typing import Any, NoReturn, Optional
from unittest import mock
import py... | null | null | namanjain12/aiohttp_final:e058cbd14dd754c2b0138fdef28df58c5e3a2c5f | true | null | 2 | 3 | null | 1,129 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.198167 | 78.9695 | ||
9,282 | r2e_gym::train::6628 | r2e_gym | train | 6,628 | pillow__e62449f94cc150584c3192061feb3cca7cd5d4c9 | pillow | python-pillow/pillow | python | e62449f94cc150584c3192061feb3cca7cd5d4c9 | ### Operations on Closed Images Raise AttributeError Instead of ValueError
**Description**
After closing an image, attempting to perform operations like `seek` or accessing attributes such as `is_animated` results in an `AttributeError`. This occurs because the internal file pointer `_fp` is set to `None`, causing sub... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -547,7 +547,7 @@
if getattr(self, "_fp", False):
if self._fp != self.fp:
self._fp.close()
- self._fp = None
+ self._fp = DeferredError(ValueE... | diff --git a/Tests/test_file_apng.py b/Tests/test_file_apng.py
--- a/Tests/test_file_apng.py
+++ b/Tests/test_file_apng.py
@@ -637,6 +637,15 @@
assert im.getpixel((0, 0)) == (0, 255, 0, 255)
+def test_seek_after_close():
+ im = Image.open("Tests/images/apng/delay.png")
+ im.seek(1)
+ im.close()
+
... | null | null | namanjain12/pillow_final:e62449f94cc150584c3192061feb3cca7cd5d4c9 | true | null | 1 | 4 | null | 1,103 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.197167 | 78.9665 | ||
9,283 | swe_bench::test::85 | swe_bench | test | 85 | astropy__astropy-8005 | astropy/astropy | astropy/astropy | python | 28efbb42ab8ef21b06473be4a2560f1871195efb | Cosmologies used in equivalencies
The thermodynamic temperature equivalency appears to default to the Planck 2015 cosmology value:
```python
if T_cmb is None:
from ..cosmology import Planck15
T_cmb = Planck15.Tcmb0
```
whereas in the ``with_H0`` equivalency added in https://github.com/astropy/astr... | cc @aconley | diff --git a/astropy/units/equivalencies.py b/astropy/units/equivalencies.py
--- a/astropy/units/equivalencies.py
+++ b/astropy/units/equivalencies.py
@@ -591,8 +591,9 @@ def thermodynamic_temperature(frequency, T_cmb=None):
frequency : `~astropy.units.Quantity` with spectral units
The observed `spectral`... | diff --git a/astropy/units/tests/test_equivalencies.py b/astropy/units/tests/test_equivalencies.py
--- a/astropy/units/tests/test_equivalencies.py
+++ b/astropy/units/tests/test_equivalencies.py
@@ -582,7 +582,7 @@ def test_beam():
def test_thermodynamic_temperature():
nu = 143 * u.GHz
- tb = 0.0026320518775... | ["astropy/units/tests/test_equivalencies.py::test_thermodynamic_temperature"] | ["astropy/units/tests/test_equivalencies.py::test_dimensionless_angles", "astropy/units/tests/test_equivalencies.py::test_logarithmic[log_unit0]", "astropy/units/tests/test_equivalencies.py::test_logarithmic[log_unit1]", "astropy/units/tests/test_equivalencies.py::test_logarithmic[log_unit2]", "astropy/units/tests/test... | null | true | 2018-10-27T15:57:31Z | 1 | 12 | 1 | 943 | 0 | 0.8 | 1 | 0.55 | 1 | 0.197167 | 78.9665 | |
9,284 | r2e_gym::train::308 | r2e_gym | train | 308 | orange3__6970fb7dcfeebd2dd1e17ab35673d0b482ddbf03 | orange3 | biolab/orange3 | python | 6970fb7dcfeebd2dd1e17ab35673d0b482ddbf03 | **Title:** DiscreteVariable.colors Does Not Update Palette Attribute
**Description:**
When setting the `.colors` attribute of a `DiscreteVariable`, the associated palette does not update accordingly. This leads to inconsistencies where the `palette` attribute does not reflect the current palette name, causing related ... | diff --git a/Orange/widgets/utils/colorpalettes.py b/Orange/widgets/utils/colorpalettes.py
--- a/Orange/widgets/utils/colorpalettes.py
+++ b/Orange/widgets/utils/colorpalettes.py
@@ -651,7 +651,8 @@
nvalues = len(var.values)
if var._colors is None or len(var._colors) != nvalues:
- set_col... | diff --git a/Orange/widgets/utils/tests/test_colorpalettes.py b/Orange/widgets/utils/tests/test_colorpalettes.py
--- a/Orange/widgets/utils/tests/test_colorpalettes.py
+++ b/Orange/widgets/utils/tests/test_colorpalettes.py
@@ -583,6 +583,8 @@
self.assertEqual(len(colors), 2)
for color, palcol in zip(c... | null | null | namanjain12/orange3_final:6970fb7dcfeebd2dd1e17ab35673d0b482ddbf03 | true | null | 1 | 3 | null | 1,103 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.193833 | 78.9565 | ||
9,285 | swe_bench::test::1427 | swe_bench | test | 1,427 | pytest-dev__pytest-7046 | pytest-dev/pytest | pytest-dev/pytest | python | d4dfe863c974654fe333eb8368922c96175ede6c | Expressions match against folder structure above pytest root
Say I have a test file `/opt/dev/Asdf/pytest_collect/test_issue.py`
```python
def test_fdsa():
pass
def test_asdf():
pass
```
If I want to match only `test_fdsa`, this works as expected
```bash
/opt/dev/Asdf/pytest_collect $ pytest --collectonly -... | diff --git a/src/_pytest/mark/__init__.py b/src/_pytest/mark/__init__.py
--- a/src/_pytest/mark/__init__.py
+++ b/src/_pytest/mark/__init__.py
@@ -136,7 +136,7 @@ def from_item(cls, item: "Item") -> "KeywordMatcher":
import pytest
for item in item.listchain():
- if not isinstance(item, py... | diff --git a/testing/test_collection.py b/testing/test_collection.py
--- a/testing/test_collection.py
+++ b/testing/test_collection.py
@@ -1004,7 +1004,7 @@ def test_collect_init_tests(testdir):
result.stdout.fnmatch_lines(
[
"collected 2 items",
- "<Package *",
+ "<Pack... | ["testing/test_collection.py::test_collect_init_tests", "testing/test_mark.py::TestKeywordSelection::test_no_match_directories_outside_the_suite"] | ["testing/test_collection.py::TestCollector::test_collect_versus_item", "testing/test_collection.py::test_fscollector_from_parent", "testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[py.test-mark]", "testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[py.test-param]", "testing/test_mar... | null | true | 2020-04-08T16:54:35Z | 2 | 5 | 2 | 1,986 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.347667 | 78.943 | ||
9,286 | swe_bench::test::953 | swe_bench | test | 953 | matplotlib__matplotlib-14043 | matplotlib/matplotlib | matplotlib/matplotlib | python | 6e49e89c4a1a3b2e238833bc8935d34b8056304e | bar plot yerr lines/caps should respect zorder
### Bug report
**Bug summary**
Bar plot error bars break when zorder is greater than 1.
```python
fig, ax = plt.subplots(1,1)
xm1 = [-2, -1, 0]
x = [1, 2, 3]
x2 = [4, 5, 6]
x3 = [7, 8, 9]
y = [1,2,3]
yerr = [0.5, 0.5, 0.5]
ax.bar(x=xm1, height=y, yerr=yerr, capsize=5, ... | diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -2291,6 +2291,14 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
xerr = kwargs.pop('xerr', None)
yerr = kwargs.pop('yerr', None)
... | diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -6314,3 +6314,18 @@ def test_hist_range_and_density():
range=(0, 1), density=True)
assert bins[0] == 0
assert bins[-1... | ["lib/matplotlib/tests/test_axes.py::test_bar_errbar_zorder"] | ["lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_spy_invalid_kwargs", "lib/matplotlib/tests/test_axes.py::test_twinx_cla", "lib/matplotlib/tests/test_axes.py::test_twinx_axis_scales[png]", "lib/matplotlib/tests/test_axes.py::test_twin_inherit_autoscale_setting", "lib/matpl... | null | true | 2019-04-25T20:29:56Z | 1 | 8 | 1 | 976 | 0 | 0.8 | 1 | 0.55 | 1 | 0.189333 | 78.943 | ||
9,287 | r2e_gym::train::4684 | r2e_gym | train | 4,684 | numpy__be11c06de7cf128c364c33dafbdecd2372f322e6 | numpy | numpy/numpy | python | be11c06de7cf128c364c33dafbdecd2372f322e6 | **Title:** `np.insert` Raises `TypeError` Instead of `IndexError` for Out-of-Bounds Index
**Description**
When using `numpy.insert` with a single out-of-bounds index, a `TypeError` is raised instead of the expected `IndexError`. This issue arises due to incorrect formatting of the error message when handling out-of-b... | diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -4753,9 +4753,8 @@
if indices.size == 1:
index = indices.item()
if index < -N or index > N:
- raise IndexError(
- "index %i is out of... | 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
@@ -552,6 +552,11 @@
np.insert([0, 1, 2], np.array([1.0, 2.0]), [10, 20])
with pytest.raises(IndexError):
... | null | null | namanjain12/numpy_final:be11c06de7cf128c364c33dafbdecd2372f322e6 | true | null | 1 | 5 | null | 1,018 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.186333 | 78.934 | ||
9,288 | swe_bench::test::1779 | swe_bench | test | 1,779 | sphinx-doc__sphinx-7597 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | c13ecd243709d1e210a030be5aa09b7714e35730 | py domain: Change a type annotation for variables to a hyperlink
**Is your feature request related to a problem? Please describe.**
py domain: Change a type annotation for variables to a hyperlink
**Describe the solution you'd like**
`type` option was added to python directives since 2.x. But it has been represented ... | diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -77,17 +77,19 @@
('deprecated', bool)])
-def _parse_annotation(annotation: str) -> List[Node]:
- """Parse type annotation."""
- def make_x... | diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py
--- a/tests/test_domain_py.py
+++ b/tests/test_domain_py.py
@@ -420,7 +420,8 @@ def test_pydata_signature(app):
doctree = restructuredtext.parse(app, text)
assert_node(doctree, (addnodes.index,
[desc, ([desc_signature, (... | ["tests/test_domain_py.py::test_pydata_signature", "tests/test_domain_py.py::test_pyattribute"] | ["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-05-02T13:44:52Z | 1 | 28 | 2 | 523 | 0 | 0.8 | 1 | 0.55 | 1 | 0.1805 | 78.9165 | ||
9,289 | r2e_gym::train::4309 | r2e_gym | train | 4,309 | numpy__d2d0dba130b9e4050cc3dac7aa07661d5ce5a033 | numpy | numpy/numpy | python | d2d0dba130b9e4050cc3dac7aa07661d5ce5a033 | **Title:** TypeError when omitting 'style' argument in `array2string` with `legacy='1.13'`
**Description:**
When using the `array2string` function in NumPy with the `legacy='1.13'` mode, omitting the `style` argument results in a `TypeError`. This behavior is unexpected because the function should handle the absence o... | diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -647,6 +647,9 @@
options.update(overrides)
if options['legacy'] == '1.13':
+ if style is np._NoValue:
+ style = repr
+
if a.shape == () and not a.dtype... | diff --git a/numpy/core/tests/test_arrayprint.py b/numpy/core/tests/test_arrayprint.py
--- a/numpy/core/tests/test_arrayprint.py
+++ b/numpy/core/tests/test_arrayprint.py
@@ -491,6 +491,8 @@
np.array(1.), style=repr)
# but not in legacy mode
np.array2string(np... | null | null | namanjain12/numpy_final:d2d0dba130b9e4050cc3dac7aa07661d5ce5a033 | true | null | 1 | 3 | null | 1,006 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.177667 | 78.908 | ||
9,290 | r2e_gym::train::5073 | r2e_gym | train | 5,073 | pyramid__fbbb20c7953370c86f999e865b1a9d682690eb70 | pyramid | pylons/pyramid | python | fbbb20c7953370c86f999e865b1a9d682690eb70 | **Title:** Unable to Import `testConfig` from `pyramid.testing` After Commit
**Description**
After introducing the `testConfig` context manager in `pyramid.testing`, attempts to import it in test modules result in an `ImportError`. This prevents tests from utilizing the new context manager for setting up and tearing d... | diff --git a/docs/api/testing.rst b/docs/api/testing.rst
--- a/docs/api/testing.rst
+++ b/docs/api/testing.rst
@@ -8,6 +8,8 @@
.. autofunction:: setUp
.. autofunction:: tearDown
+
+ .. autofunction:: testConfig(registry=None, request=None, hook_zca=True, autocommit=True, settings=None)
.. autofunction:: c... | diff --git a/pyramid/tests/test_testing.py b/pyramid/tests/test_testing.py
--- a/pyramid/tests/test_testing.py
+++ b/pyramid/tests/test_testing.py
@@ -932,3 +932,58 @@
def __init__(self, kw):
self.__dict__.update(kw)
+class Test_testConfig(unittest.TestCase):
+
+ def _setUp(self, **kw):
+ ... | null | null | namanjain12/pyramid_final:fbbb20c7953370c86f999e865b1a9d682690eb70 | true | null | 3 | 61 | null | 896 | 0.037037 | 0.75 | 1 | 0.6375 | 1 | 0.352667 | 78.904782 | ||
9,291 | r2e_gym::train::4329 | r2e_gym | train | 4,329 | numpy__2bfec2c0dd92958694e6d736530ae6333d7d62d7 | numpy | numpy/numpy | python | 2bfec2c0dd92958694e6d736530ae6333d7d62d7 | **Title:** Gradient Function Fails with 2D Distance Arrays Instead of Raising ValueError
**Description:**
When using the `gradient` function with 2D distance arrays, it does not raise a clear `ValueError`. Instead, it results in an unexpected broadcasting error, making it difficult to understand the issue.
**Buggy Co... | diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1697,8 +1697,10 @@
for i, distances in enumerate(dx):
if distances.ndim == 0:
continue
+ elif distances.ndim != 1:
+ ... | 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
@@ -755,6 +755,10 @@
# 2D but axis specified
gradient(f_2d, dx, axis=1)
+
+ # 2d coordinate arguments are not yet ... | null | null | namanjain12/numpy_final:2bfec2c0dd92958694e6d736530ae6333d7d62d7 | true | null | 1 | 4 | null | 960 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.173333 | 78.895 | ||
9,292 | swe_bench::test::1857 | swe_bench | test | 1,857 | sphinx-doc__sphinx-8863 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 66aa22f1ea9ef79034812c801432ba152ad96b41 | [LaTex] code-block printed out of margin
@jfbu
this is not handled correctly currently: long hex strings

code:
````
DryGASCON128k56:
.. code-block:: shell
$ python3 -m drys... | diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -844,11 +844,16 @@ def depart_rubric(self, node: Element) -> None:
def visit_footnote(self, node: Element) -> None:
self.in_footnote += 1
label = cast(nodes.label, node[0]... | diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py
--- a/tests/test_build_latex.py
+++ b/tests/test_build_latex.py
@@ -723,7 +723,8 @@ def test_footnote(app, status, warning):
print(result)
print(status.getvalue())
print(warning.getvalue())
- assert ('\\begin{footnote}[1]\\sphinxAtStar... | ["tests/test_build_latex.py::test_footnote"] | ["tests/test_build_latex.py::test_latex_basic", "tests/test_build_latex.py::test_latex_basic_manual", "tests/test_build_latex.py::test_latex_basic_howto", "tests/test_build_latex.py::test_latex_basic_manual_ja", "tests/test_build_latex.py::test_latex_basic_howto_ja", "tests/test_build_latex.py::test_latex_theme", "test... | null | true | 2021-02-09T18:29:09Z | 1 | 9 | 1 | 847 | 0 | 0.8 | 1 | 0.55 | 1 | 0.171167 | 78.8885 | ||
9,293 | r2e_gym::train::4838 | r2e_gym | train | 4,838 | numpy__86bf869ef831e0f2165a97c057c5661fc8b5dbf7 | numpy | numpy/numpy | python | 86bf869ef831e0f2165a97c057c5661fc8b5dbf7 | **Title:** `apply_along_axis` Raises `StopIteration` Instead of `ValueError` for Empty Arrays
**Description:**
When using `numpy.apply_along_axis` with an empty array, an internal `StopIteration` exception is raised instead of the expected `ValueError`. This unexpected behavior can lead to unhandled exceptions and mak... | diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -109,7 +109,10 @@
inds = ndindex(inarr_view.shape[:-1])
# invoke the function on the first item
- ind0 = next(inds)
+ try:
+ ind0 = next(inds)
+ except StopIteration:... | diff --git a/numpy/lib/tests/test_shape_base.py b/numpy/lib/tests/test_shape_base.py
--- a/numpy/lib/tests/test_shape_base.py
+++ b/numpy/lib/tests/test_shape_base.py
@@ -140,6 +140,25 @@
res = np.apply_along_axis(sample_1d, 1, np.array([[1, 2], [3, 4]]))
assert_array_equal(res, np.array([[2, 1], [4, ... | null | null | namanjain12/numpy_final:86bf869ef831e0f2165a97c057c5661fc8b5dbf7 | true | null | 1 | 5 | null | 922 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.170333 | 78.886 | ||
9,294 | r2e_gym::train::6428 | r2e_gym | train | 6,428 | pillow__c42e6bab1c60c667e997ecde3e90eae074c3b7c3 | pillow | python-pillow/pillow | python | c42e6bab1c60c667e997ecde3e90eae074c3b7c3 | ### SGI Image Saving Fails to Identify Saved Files
When saving SGI images to a file pointer, the file pointer is not flushed after writing. This results in incomplete image files that cannot be properly identified or opened.
**Steps to Reproduce:**
```python
from PIL import Image
def save_sgi_image(fp, image):
... | diff --git a/src/PIL/SgiImagePlugin.py b/src/PIL/SgiImagePlugin.py
--- a/src/PIL/SgiImagePlugin.py
+++ b/src/PIL/SgiImagePlugin.py
@@ -193,6 +193,9 @@
for channel in im.split():
fp.write(channel.tobytes("raw", rawmode, 0, orientation))
+ if hasattr(fp, "flush"):
+ fp.flush()
+
class SGI16De... | diff --git a/Tests/test_file_sgi.py b/Tests/test_file_sgi.py
--- a/Tests/test_file_sgi.py
+++ b/Tests/test_file_sgi.py
@@ -73,6 +73,13 @@
img.save(out, format="sgi")
assert_image_equal_tofile(img, out)
+ out = str(tmp_path / "fp.sgi")
+ with open(out, "wb") as fp:
+ img.save... | null | null | namanjain12/pillow_final:c42e6bab1c60c667e997ecde3e90eae074c3b7c3 | true | null | 1 | 3 | null | 927 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.1645 | 78.8685 | ||
9,295 | r2e_gym::train::5837 | r2e_gym | train | 5,837 | tornado__94a5a4027210d082115f96308fd5527cb82b6e33 | tornado | tornadoweb/tornado | python | 94a5a4027210d082115f96308fd5527cb82b6e33 | **Title:** Calling callback without arguments causes TypeError in `@return_future` decorated functions
**Description:**
When using the `@return_future` decorator, invoking the callback without any arguments results in a `TypeError`. This occurs because the callback expects a `result` argument, and calling it without o... | diff --git a/tornado/concurrent.py b/tornado/concurrent.py
--- a/tornado/concurrent.py
+++ b/tornado/concurrent.py
@@ -153,8 +153,9 @@
@functools.wraps(f)
def wrapper(*args, **kwargs):
future = Future()
- callback, args, kwargs = replacer.replace(future.set_result,
- ... | diff --git a/tornado/test/concurrent_test.py b/tornado/test/concurrent_test.py
--- a/tornado/test/concurrent_test.py
+++ b/tornado/test/concurrent_test.py
@@ -52,6 +52,10 @@
# implementations the last event prior to callback resolution wins.
return 42
+ @return_future
+ def no_result_future(se... | null | null | namanjain12/tornado_final:94a5a4027210d082115f96308fd5527cb82b6e33 | true | null | 1 | 5 | null | 872 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.162 | 78.861 | ||
9,296 | r2e_gym::train::4531 | r2e_gym | train | 4,531 | numpy__b50d5d01d4790a4383996e885066b1dcb6412526 | numpy | numpy/numpy | python | b50d5d01d4790a4383996e885066b1dcb6412526 | **Title:** gfortran version detection fails when compiler emits warnings
**Description:**
When using the GNU Fortran compiler, if it emits warnings before the version string, the version detection process fails to parse the correct version. This results in an error indicating that a valid Fortran version could not be ... | diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -35,6 +35,10 @@
def gnu_version_match(self, version_string):
"""Handle the different versions of GNU fortran compilers"""
+ # Strip war... | diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py
--- a/numpy/distutils/tests/test_fcompiler_gnu.py
+++ b/numpy/distutils/tests/test_fcompiler_gnu.py
@@ -16,6 +16,11 @@
gfortran_version_strings = [
('4.8.0', '4.8.0'),
('4.0.3-7', '4.0.3'),
+ ("gfortran:... | null | null | namanjain12/numpy_final:b50d5d01d4790a4383996e885066b1dcb6412526 | true | null | 1 | 4 | null | 865 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.1575 | 78.8475 | ||
9,297 | swe_bench::test::1138 | swe_bench | test | 1,138 | mwaskom__seaborn-2979 | mwaskom/seaborn | mwaskom/seaborn | python | ebc4bfe9f8bf5c4ff10b14da8a49c8baa1ba76d0 | Visibility of internal axis labels is wrong with wrapped pair plot
```python
(
so.Plot(mpg, y="mpg")
.pair(["displacement", "weight", "horsepower", "cylinders"], wrap=2)
)
```

The top two subplots shou... | diff --git a/seaborn/_core/plot.py b/seaborn/_core/plot.py
--- a/seaborn/_core/plot.py
+++ b/seaborn/_core/plot.py
@@ -943,8 +943,11 @@ def _setup_figure(self, p: Plot, common: PlotData, layers: list[Layer]) -> None:
visible_side = {"x": "bottom", "y": "left"}.get(axis)
show_axis_label... | diff --git a/tests/_core/test_plot.py b/tests/_core/test_plot.py
--- a/tests/_core/test_plot.py
+++ b/tests/_core/test_plot.py
@@ -1538,8 +1538,10 @@ def test_x_wrapping(self, long_df):
assert_gridspec_shape(p._figure.axes[0], len(x_vars) // wrap + 1, wrap)
assert len(p._figure.axes) == len(x_vars)
... | ["tests/_core/test_plot.py::TestPairInterface::test_x_wrapping", "tests/_core/test_plot.py::TestPairInterface::test_y_wrapping", "tests/_core/test_subplots.py::TestSubplotSpec::test_y_paired_and_wrapped_single_row"] | ["tests/_core/test_plot.py::TestInit::test_empty", "tests/_core/test_plot.py::TestInit::test_data_only", "tests/_core/test_plot.py::TestInit::test_df_and_named_variables", "tests/_core/test_plot.py::TestInit::test_df_and_mixed_variables", "tests/_core/test_plot.py::TestInit::test_vector_variables_only", "tests/_core/te... | null | true | 2022-08-26T11:07:57Z | 2 | 12 | 3 | 693 | 0 | 0.8 | 1 | 0.55 | 1 | 0.1555 | 78.8415 | ||
9,298 | swe_bench::test::1175 | swe_bench | test | 1,175 | psf__requests-1776 | psf/requests | psf/requests | python | 4bceb312f1b99d36a25f2985b5606e98b6f0d8cd | Request cookies should not be persisted to session
After the fix for #1630, cookies sent with a request are now incorrectly persisted to the session.
Specifically, problem lies here: https://github.com/kennethreitz/requests/blob/1511dfa637643bae5b6111a20ecb80ec9ae26032/requests/sessions.py#L330
Removing that breaks t... | diff --git a/requests/auth.py b/requests/auth.py
--- a/requests/auth.py
+++ b/requests/auth.py
@@ -16,6 +16,7 @@
from base64 import b64encode
from .compat import urlparse, str
+from .cookies import extract_cookies_to_jar
from .utils import parse_dict_header
log = logging.getLogger(__name__)
@@ -169,7 +170,8 @@ ... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -165,7 +165,7 @@ def test_cookie_quote_wrapped(self):
def test_cookie_persists_via_api(self):
s = requests.session()
- r = s.get(httpbin('redirect/1'), cookies={'foo':'bar'})
+ r = s.get(httpb... | ["test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::RequestsTestCase::test_request_cookies_not_persisted", "test_requests.py::RequestsTestCase::test_set_cookie_on_301"] | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::Request... | null | true | 2013-12-04T12:46:50Z | 3 | 26 | 3 | 382 | 0 | 0.8 | 1 | 0.55 | 1 | 0.150333 | 78.826 | ||
9,299 | r2e_gym::train::5753 | r2e_gym | train | 5,753 | scrapy__6fbd6f941f00037ae4718805352e0fa86a781e41 | scrapy | scrapy/scrapy | python | 6fbd6f941f00037ae4718805352e0fa86a781e41 | **Title:** Initializing ItemLoader with Response Lacking Text Raises AttributeError
**Description:**
When creating an instance of `ItemLoader` with a `Response` object that does not contain text content, an `AttributeError` is raised instead of handling the scenario gracefully.
**Buggy Code Example:**
```python
from ... | diff --git a/scrapy/loader/__init__.py b/scrapy/loader/__init__.py
--- a/scrapy/loader/__init__.py
+++ b/scrapy/loader/__init__.py
@@ -83,6 +83,9 @@
def __init__(self, item=None, selector=None, response=None, parent=None, **context):
if selector is None and response is not None:
- selector = ... | diff --git a/tests/test_loader.py b/tests/test_loader.py
--- a/tests/test_loader.py
+++ b/tests/test_loader.py
@@ -4,7 +4,7 @@
from itemadapter import ItemAdapter
from itemloaders.processors import Compose, Identity, MapCompose, TakeFirst
-from scrapy.http import HtmlResponse
+from scrapy.http import HtmlResponse, ... | null | null | namanjain12/scrapy_final:6fbd6f941f00037ae4718805352e0fa86a781e41 | true | null | 1 | 5 | null | 771 | 0 | 0.75 | 1 | 0.75 | 0.8 | 0.145167 | 78.8105 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.