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,100 | r2e_gym::train::25 | r2e_gym | train | 25 | orange3__2067f4e3a905600cbdc4b5d13d5a3ef2063be2fa | orange3 | biolab/orange3 | python | 2067f4e3a905600cbdc4b5d13d5a3ef2063be2fa | **Title:** Data summary not displayed in status bar when loading a dataset
**Description:**
When a dataset is loaded and selected in the Data Sets widget, the status bar fails to display the summary information about the data. This omission prevents users from quickly viewing essential details such as the number of in... | diff --git a/Orange/widgets/data/owdatasets.py b/Orange/widgets/data/owdatasets.py
--- a/Orange/widgets/data/owdatasets.py
+++ b/Orange/widgets/data/owdatasets.py
@@ -28,6 +28,7 @@
from Orange.widgets import settings, gui
from Orange.widgets.utils.signals import Output
from Orange.widgets.utils.widgetpreview import ... | diff --git a/Orange/widgets/data/tests/test_owdatasets.py b/Orange/widgets/data/tests/test_owdatasets.py
--- a/Orange/widgets/data/tests/test_owdatasets.py
+++ b/Orange/widgets/data/tests/test_owdatasets.py
@@ -7,6 +7,7 @@
from Orange.widgets.data.owdatasets import OWDataSets
from Orange.widgets.tests.base import W... | null | null | namanjain12/orange3_final:2067f4e3a905600cbdc4b5d13d5a3ef2063be2fa | true | null | 1 | 6 | null | 996 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186 | 80.47675 | ||
9,101 | r2e_gym::train::6320 | r2e_gym | train | 6,320 | pillow__9707d33ed979433211af1934f0a07568d9809548 | pillow | python-pillow/pillow | python | 9707d33ed979433211af1934f0a07568d9809548 | **Title:** Passing `None` to Warning Handler Causes TypeError
**Description:**
When saving a TIFF image with EXIF data provided as a bytestring, the process attempts to handle warnings but fails because `None` is used where a warning type is expected. This results in a `TypeError`, preventing the image from being save... | diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py
--- a/src/PIL/TiffImagePlugin.py
+++ b/src/PIL/TiffImagePlugin.py
@@ -1515,7 +1515,16 @@
ifd[IMAGELENGTH] = im.size[1]
# write any arbitrary tags passed in as an ImageFileDirectory
- info = im.encoderinfo.get("tiffinfo", im.encoderinfo.... | 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
@@ -444,7 +444,14 @@
im.save(outfile, exif=exif)
+ outfile2 = str(tmp_path / "temp2.tif")
with Image.open(outfile) as im:
+ exif = im.getexif()
+ ... | null | null | namanjain12/pillow_final:9707d33ed979433211af1934f0a07568d9809548 | true | null | 1 | 11 | null | 895 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.185833 | 80.47625 | ||
9,102 | r2e_gym::train::5862 | r2e_gym | train | 5,862 | tornado__d1676810ef5972c4defb0a710a1d8f8a0018983b | tornado | tornadoweb/tornado | python | d1676810ef5972c4defb0a710a1d8f8a0018983b | **Title:** WaitIterator is Garbage Collected When No Strong Reference is Held, Leading to TimeoutError
**Description:**
When using `WaitIterator` without maintaining a strong reference to it, the iterator may be prematurely garbage collected. This causes the associated operation to never complete, resulting in a `Time... | diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -336,6 +336,8 @@
self.current_index = self.current_future = None
self._running_future = None
+ # Use a weak reference to self to avoid cycles that may delay
+ # garbage collection.
self_r... | diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py
--- a/tornado/test/gen_test.py
+++ b/tornado/test/gen_test.py
@@ -1249,5 +1249,15 @@
self.assertEqual(g.current_index, 3, 'wrong index')
i += 1
+ @gen_test
+ def test_no_ref(self):
+ # In this usage, there ... | null | null | namanjain12/tornado_final:d1676810ef5972c4defb0a710a1d8f8a0018983b | true | null | 1 | 8 | null | 955 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.185833 | 80.47625 | ||
9,103 | r2e_gym::train::5840 | r2e_gym | train | 5,840 | tornado__e9e003eba84652802a349dc5a2eeec5c8102a995 | tornado | tornadoweb/tornado | python | e9e003eba84652802a349dc5a2eeec5c8102a995 | **Title:** Callback Receives Unexpected Argument When No Result is Provided
**Problem Description:**
When using a function decorated with `@return_future`, invoking the callback without any arguments results in the client callback being called with an unexpected argument. This causes a `TypeError` when the client call... | diff --git a/tornado/concurrent.py b/tornado/concurrent.py
--- a/tornado/concurrent.py
+++ b/tornado/concurrent.py
@@ -116,6 +116,8 @@
return wrapper
+_NO_RESULT = object()
+
def return_future(f):
"""Decorator to make a function that returns via callback return a `Future`.
@@ -154,7 +156,7 @@
def ... | 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
@@ -131,9 +131,17 @@
self.assertRaises(ZeroDivisionError, self.wait)
def test_no_result_future(self):
- self.no_result_future(self.stop)
+ ... | null | null | namanjain12/tornado_final:e9e003eba84652802a349dc5a2eeec5c8102a995 | true | null | 1 | 10 | null | 914 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.185667 | 80.47575 | ||
9,104 | swe_bench::test::992 | swe_bench | test | 992 | matplotlib__matplotlib-22835 | matplotlib/matplotlib | matplotlib/matplotlib | python | c33557d120eefe3148ebfcf2e758ff2357966000 | [Bug]: scalar mappable format_cursor_data crashes on BoundarNorm
### Bug summary
In 3.5.0 if you do:
```python
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
fig, ax = plt.subplots()
norm = mpl.colors.BoundaryNorm(np.linspace(-4, 4, 5), 256)
X = np.random.randn(10, 10)
pc = ax.imshow(X, ... | I think the correct fix is to specifically check for BoundaryNorm there and implement special logic to determine the positions of the neighboring intervals (on the BoundaryNorm) for that case.
I tried returning the passed in `value` instead of the exception at https://github.com/matplotlib/matplotlib/blob/b2bb7be4ba343... | diff --git a/lib/matplotlib/artist.py b/lib/matplotlib/artist.py
--- a/lib/matplotlib/artist.py
+++ b/lib/matplotlib/artist.py
@@ -12,6 +12,7 @@
import matplotlib as mpl
from . import _api, cbook
+from .colors import BoundaryNorm
from .cm import ScalarMappable
from .path import Path
from .transforms import (Bbox... | diff --git a/lib/matplotlib/tests/test_artist.py b/lib/matplotlib/tests/test_artist.py
--- a/lib/matplotlib/tests/test_artist.py
+++ b/lib/matplotlib/tests/test_artist.py
@@ -5,6 +5,8 @@
import pytest
+from matplotlib import cm
+import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
import matplotli... | ["lib/matplotlib/tests/test_artist.py::test_format_cursor_data_BoundaryNorm"] | ["lib/matplotlib/tests/test_artist.py::test_patch_transform_of_none", "lib/matplotlib/tests/test_artist.py::test_collection_transform_of_none", "lib/matplotlib/tests/test_artist.py::test_clipping[png]", "lib/matplotlib/tests/test_artist.py::test_clipping[pdf]", "lib/matplotlib/tests/test_artist.py::test_clipping_zoom[p... | null | true | 2022-04-12T23:13:58Z | 1 | 19 | 1 | 1,790 | 0.090909 | 0.8 | 1 | 0.7 | 1 | 0.361667 | 80.475455 | |
9,105 | r2e_gym::train::5802 | r2e_gym | train | 5,802 | tornado__14ae309f08f5e8d8de13aa5c71dd6bc43d8ace66 | tornado | tornadoweb/tornado | python | 14ae309f08f5e8d8de13aa5c71dd6bc43d8ace66 | **Title:** Semaphore.acquire with timeout raises TypeError when released before timeout
**Description:**
When attempting to acquire a semaphore with a timeout, releasing the semaphore before the timeout period expires results in a `TypeError`. This occurs because the timeout callback is not properly canceled, leading ... | diff --git a/tornado/locks.py b/tornado/locks.py
--- a/tornado/locks.py
+++ b/tornado/locks.py
@@ -73,7 +73,10 @@
def on_timeout():
waiter.set_result(False)
self._garbage_collect()
- self.io_loop.add_timeout(timeout, on_timeout)
+ io_loop = ioloop.IOL... | 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
@@ -87,7 +87,10 @@
@gen_test
def test_wait_timeout(self):
c = locks.Condition()
- self.assertFalse((yield c.wait(timedelta(seconds=0.01))))
+ wait = c.w... | null | null | namanjain12/tornado_final:14ae309f08f5e8d8de13aa5c71dd6bc43d8ace66 | true | null | 1 | 10 | null | 913 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1855 | 80.47525 | ||
9,106 | r2e_gym::train::6525 | r2e_gym | train | 6,525 | pillow__926af72db3389912c8b0c79372ddde34391bed25 | pillow | python-pillow/pillow | python | 926af72db3389912c8b0c79372ddde34391bed25 | **Title:** Incorrect JPEG magic number validation causes entire buffer to be read
**Description:**
When attempting to open a JPEG image with an incorrect magic number, the validation process fails to correctly identify the file format. This results in the entire buffer being read, which is unnecessary and leads to an ... | diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py
--- a/src/PIL/JpegImagePlugin.py
+++ b/src/PIL/JpegImagePlugin.py
@@ -323,7 +323,8 @@
def _accept(prefix):
- return prefix[0:1] == b"\377"
+ # Magic number was taken from https://en.wikipedia.org/wiki/JPEG
+ return prefix[0:3] == b"\xFF\... | diff --git a/Tests/test_file_jpeg.py b/Tests/test_file_jpeg.py
--- a/Tests/test_file_jpeg.py
+++ b/Tests/test_file_jpeg.py
@@ -3,7 +3,14 @@
from io import BytesIO
import pytest
-from PIL import ExifTags, Image, ImageFile, JpegImagePlugin, features
+from PIL import (
+ ExifTags,
+ Image,
+ ImageFile,
+ J... | null | null | namanjain12/pillow_final:926af72db3389912c8b0c79372ddde34391bed25 | true | null | 1 | 10 | null | 911 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.185167 | 80.47425 | ||
9,107 | r2e_gym::train::5574 | r2e_gym | train | 5,574 | scrapy__f1d971a5c0cdfe0f4fe5619146cd6818324fc98e | scrapy | scrapy/scrapy | python | f1d971a5c0cdfe0f4fe5619146cd6818324fc98e | **Title:** Exception Raised When Exporting Items with Non-String Types
**Description:**
When attempting to export items that include non-string types such as boolean, number, datetime, or float, an exception is thrown.
**Example Code:**
```python
from scrapy.exporters import PythonItemExporter
from datetime import da... | diff --git a/scrapy/exporters.py b/scrapy/exporters.py
--- a/scrapy/exporters.py
+++ b/scrapy/exporters.py
@@ -273,10 +273,10 @@
return dict(self._serialize_dict(value))
if is_listlike(value):
return [self._serialize_value(v) for v in value]
- if self.binary:
- retur... | diff --git a/tests/test_exporters.py b/tests/test_exporters.py
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -133,6 +133,19 @@
value = TestItem(name=u'John\xa3', age=u'22')
expected = {b'name': b'John\xc2\xa3', b'age': b'22'}
self.assertEqual(expected, exporter.export_item(va... | null | null | namanjain12/scrapy_final:f1d971a5c0cdfe0f4fe5619146cd6818324fc98e | true | null | 1 | 8 | null | 950 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.185 | 80.47375 | ||
9,108 | r2e_gym::train::4951 | r2e_gym | train | 4,951 | datalad__1a8d685baa45754b748c6175be338ddb1841e925 | datalad | datalad/datalad | python | 1a8d685baa45754b748c6175be338ddb1841e925 | **Title:** Missing log message when JSON parsing fails in `json_py.loads`
**Description:**
When using the `loads` function from `json_py.py` to parse JSON strings, if the content fails to parse due to invalid JSON, no log message is recorded indicating the problematic content. This absence of logging makes it challen... | diff --git a/datalad/support/json_py.py b/datalad/support/json_py.py
--- a/datalad/support/json_py.py
+++ b/datalad/support/json_py.py
@@ -17,7 +17,7 @@
from simplejson import load as jsonload
from simplejson import dump as jsondump
# simply mirrored for now
-from simplejson import loads
+from simplejson import load... | diff --git a/datalad/support/tests/test_json_py.py b/datalad/support/tests/test_json_py.py
--- a/datalad/support/tests/test_json_py.py
+++ b/datalad/support/tests/test_json_py.py
@@ -10,6 +10,7 @@
import logging
from datalad.support.json_py import load
+from datalad.support.json_py import loads
from datalad.suppor... | null | null | namanjain12/datalad_final:1a8d685baa45754b748c6175be338ddb1841e925 | true | null | 1 | 14 | null | 829 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.184833 | 80.47325 | ||
9,109 | r2e_gym::train::5579 | r2e_gym | train | 5,579 | scrapy__e58b8078f0d51148c1866d1da3f6e36609b5e2a5 | scrapy | scrapy/scrapy | python | e58b8078f0d51148c1866d1da3f6e36609b5e2a5 | **Title:** AttributeError When `clspath` Is a Class Due to Improper Handling
**Description:**
When `clspath` is provided as a class instead of a string, the system incorrectly attempts to split it, resulting in an `AttributeError`. This issue occurs during the handling of the `NotConfigured` exception, causing certain... | diff --git a/scrapy/addons.py b/scrapy/addons.py
--- a/scrapy/addons.py
+++ b/scrapy/addons.py
@@ -40,12 +40,9 @@
self.addons.append(addon)
except NotConfigured as e:
if e.args:
- clsname = (
- clspath.split(".")[-1] if isinstance(... | diff --git a/tests/test_middleware.py b/tests/test_middleware.py
--- a/tests/test_middleware.py
+++ b/tests/test_middleware.py
@@ -39,7 +39,7 @@
pass
def __init__(self):
- raise NotConfigured
+ raise NotConfigured("foo")
class TestMiddlewareManager(MiddlewareManager):
| null | null | namanjain12/scrapy_final:e58b8078f0d51148c1866d1da3f6e36609b5e2a5 | true | null | 2 | 12 | null | 868 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.184667 | 80.47275 | ||
9,110 | r2e_gym::train::4186 | r2e_gym | train | 4,186 | numpy__a9465db4c70f9cd9c3fb9010229aadc7ec5fdc9c | numpy | numpy/numpy | python | a9465db4c70f9cd9c3fb9010229aadc7ec5fdc9c | **Example Issue:**
[ISSUE]
**Title:** np.gradient Accepts Non-Scalar Distance Arguments Without Error
**Description:**
When using the `np.gradient` function, providing a non-scalar value for the `distance` arguments does not raise an error. According to the documentation, the `distance` parameters should be scalar ... | 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
@@ -1410,9 +1410,10 @@
Returns
-------
- gradient : list of ndarray
- Each element of `list` has the same shape as `f` giving the derivative
- of `f` with r... | 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
@@ -665,6 +665,9 @@
x = np.array([[1, 1], [3, 4]])
assert_raises(SyntaxError, gradient, x, np.array([1., 1.]),
... | null | null | namanjain12/numpy_final:a9465db4c70f9cd9c3fb9010229aadc7ec5fdc9c | true | null | 1 | 12 | null | 868 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.184667 | 80.47275 | ||
9,111 | r2e_gym::train::4454 | r2e_gym | train | 4,454 | numpy__b35892ad072ca00ba60fef225ec38a22c711bdfa | numpy | numpy/numpy | python | b35892ad072ca00ba60fef225ec38a22c711bdfa | **Title:** `np.set_printoptions` Allows Non-Numeric or NaN Threshold Values Without Raising Error
**Description:**
When configuring NumPy's print options, setting the `threshold` parameter to a non-numeric value or NaN does not raise an error. This can lead to unexpected behavior when printing large arrays, as the thr... | diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -26,6 +26,7 @@
import sys
import functools
+import numbers
if sys.version_info[0] >= 3:
try:
from _thread import get_ident
@@ -86,7 +87,11 @@
if legacy not in [None, ... | 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
@@ -842,6 +842,10 @@
[[ 0.]]]])""")
)
+ def test_bad_args(self):
+ assert_raises(ValueError, np.set_printop... | null | null | namanjain12/numpy_final:b35892ad072ca00ba60fef225ec38a22c711bdfa | true | null | 1 | 7 | null | 968 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.184667 | 80.47275 | ||
9,112 | r2e_gym::train::5160 | r2e_gym | train | 5,160 | pyramid__b1d2a373d74a433b247ea2f1186f1e314244490c | pyramid | pylons/pyramid | python | b1d2a373d74a433b247ea2f1186f1e314244490c | **Title:** HeaderPredicate's `text` and `phash` Methods Include Compiled Regex Objects
**Description**
When creating a `HeaderPredicate` with a regex value, the `text` and `phash` methods return strings that include the compiled regex object instead of just the regex pattern. This leads to inconsistencies and unexpec... | diff --git a/pyramid/config/predicates.py b/pyramid/config/predicates.py
--- a/pyramid/config/predicates.py
+++ b/pyramid/config/predicates.py
@@ -97,15 +97,15 @@
name = val
v = None
if ':' in name:
- name, v = name.split(':', 1)
+ name, val_str = name.split(':', 1)
... | diff --git a/pyramid/tests/test_config/test_predicates.py b/pyramid/tests/test_config/test_predicates.py
--- a/pyramid/tests/test_config/test_predicates.py
+++ b/pyramid/tests/test_config/test_predicates.py
@@ -317,6 +317,70 @@
result = inst(None, request)
self.assertEqual(result, True)
+class TestH... | null | null | namanjain12/pyramid_final:b1d2a373d74a433b247ea2f1186f1e314244490c | true | null | 1 | 6 | null | 986 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.184333 | 80.47175 | ||
9,113 | r2e_gym::train::6102 | r2e_gym | train | 6,102 | pillow__6449cdc1a3d3c8ddc436aca766198d149add486a | pillow | python-pillow/pillow | python | 6449cdc1a3d3c8ddc436aca766198d149add486a | **Title:** Unable to Save RGBA Images as DDS Format
**Description:**
When attempting to save an image with RGBA mode to the DDS format, an `OSError` is raised, indicating that the mode is unsupported. This issue prevents users from saving images with transparency in the DDS format.
**Example Code:**
```python
from PI... | diff --git a/src/PIL/DdsImagePlugin.py b/src/PIL/DdsImagePlugin.py
--- a/src/PIL/DdsImagePlugin.py
+++ b/src/PIL/DdsImagePlugin.py
@@ -203,7 +203,7 @@
def _save(im, fp, filename):
- if im.mode != "RGB":
+ if im.mode not in ("RGB", "RGBA"):
raise OSError(f"cannot write mode {im.mode} as DDS")
... | diff --git a/Tests/test_file_dds.py b/Tests/test_file_dds.py
--- a/Tests/test_file_dds.py
+++ b/Tests/test_file_dds.py
@@ -251,10 +251,18 @@
im.save(out)
-def test_save(tmp_path):
+@pytest.mark.parametrize(
+ ("mode", "test_file"),
+ [
+ ("RGB", "Tests/images/hopper.png"),
+ ("RGBA", "T... | null | null | namanjain12/pillow_final:6449cdc1a3d3c8ddc436aca766198d149add486a | true | null | 1 | 13 | null | 846 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.184333 | 80.47175 | ||
9,114 | r2e_gym::train::5381 | r2e_gym | train | 5,381 | aiohttp__90f058984a559c215f1721776326c145f9c77af9 | aiohttp | aio-libs/aiohttp | python | 90f058984a559c215f1721776326c145f9c77af9 | **Title:** Non-ASCII Header Names and Values Are Accepted Despite ASCII Requirement
**Description:**
When adding headers with non-ASCII characters in their names or values, the system currently allows them without raising any errors. This behavior violates the requirement that header names and values must strictly con... | diff --git a/aiohttp/protocol.py b/aiohttp/protocol.py
--- a/aiohttp/protocol.py
+++ b/aiohttp/protocol.py
@@ -11,6 +11,7 @@
import http.server
import itertools
import re
+import string
import sys
import zlib
from wsgiref.handlers import format_date_time
@@ -20,6 +21,7 @@
from aiohttp import multidict
from aioh... | diff --git a/tests/test_http_protocol.py b/tests/test_http_protocol.py
--- a/tests/test_http_protocol.py
+++ b/tests/test_http_protocol.py
@@ -76,12 +76,22 @@
self.assertEqual(
[('CONTENT-TYPE', 'plain/html')], list(msg.headers.items()))
+ def test_add_header_non_ascii(self):
+ msg = p... | null | null | namanjain12/aiohttp_final:90f058984a559c215f1721776326c145f9c77af9 | true | null | 1 | 10 | null | 903 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.183833 | 80.47025 | ||
9,115 | r2e_gym::train::99 | r2e_gym | train | 99 | orange3__1c914f6f2f8af2f597a04fc3ed549cb8e963d4a9 | orange3 | biolab/orange3 | python | 1c914f6f2f8af2f597a04fc3ed549cb8e963d4a9 | **Title:** `bincount` Raises ValueError for Object Arrays Containing NaNs
**Description:**
When using the `bincount` function with object arrays that include `NaN` values, a `ValueError` is thrown. This error occurs because the function attempts to convert `NaN` values to integers, which is not possible. As a result, ... | diff --git a/Orange/statistics/util.py b/Orange/statistics/util.py
--- a/Orange/statistics/util.py
+++ b/Orange/statistics/util.py
@@ -82,7 +82,7 @@
def bincount(x, weights=None, max_val=None, minlength=0):
"""Return counts of values in array X.
- Works kind of like np.bincount(), except that it also support... | diff --git a/Orange/tests/test_statistics.py b/Orange/tests/test_statistics.py
--- a/Orange/tests/test_statistics.py
+++ b/Orange/tests/test_statistics.py
@@ -513,6 +513,13 @@
@dense_sparse
def test_count_nans(self, array):
x = array([0, 0, 1, 2, np.nan, 2])
+ expected = 1
+
+ np.testin... | null | null | namanjain12/orange3_final:1c914f6f2f8af2f597a04fc3ed549cb8e963d4a9 | true | null | 1 | 6 | null | 982 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.183667 | 80.46975 | ||
9,116 | r2e_gym::train::6317 | r2e_gym | train | 6,317 | pillow__6c126ca2821d0fba00fffc290aa3226692e15ff8 | pillow | python-pillow/pillow | python | 6c126ca2821d0fba00fffc290aa3226692e15ff8 | **Title:** Saving WebP Image with Integer Background Color Raises OSError
**Description:**
When attempting to save a GIF image as a WebP with the `save_all=True` parameter, specifying the background color as an integer results in an error. The background color index is expected to be an RGBA tuple, but providing an in... | diff --git a/src/PIL/WebPImagePlugin.py b/src/PIL/WebPImagePlugin.py
--- a/src/PIL/WebPImagePlugin.py
+++ b/src/PIL/WebPImagePlugin.py
@@ -196,6 +196,14 @@
background = encoderinfo["background"]
elif "background" in im.info:
background = im.info["background"]
+ if isinstance(background, in... | diff --git a/Tests/test_file_webp.py b/Tests/test_file_webp.py
--- a/Tests/test_file_webp.py
+++ b/Tests/test_file_webp.py
@@ -153,6 +153,26 @@
Image.open(blob).load()
Image.open(blob).load()
+ @unittest.skipUnless(HAVE_WEBP and _webp.HAVE_WEBPANIM,
+ "WebP save al... | null | null | namanjain12/pillow_final:6c126ca2821d0fba00fffc290aa3226692e15ff8 | true | null | 1 | 8 | null | 939 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.183167 | 80.46825 | ||
9,117 | r2e_gym::train::5461 | r2e_gym | train | 5,461 | aiohttp__c04a45d9c37d3e5fc740c3ab73595048af6476a9 | aiohttp | aio-libs/aiohttp | python | c04a45d9c37d3e5fc740c3ab73595048af6476a9 | **Title:** Default headers in ClientSession are not case-insensitive, causing inconsistencies
**Description:**
When initializing `ClientSession` with default headers, the headers maintain their original casing, leading to inconsistencies and unexpected behavior during header handling.
**Example:**
```python
session... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,3 +10,5 @@
* Optimize cythonized multidict a bit
* Change repr's of multidicts and multidict views
+
+* default headers in ClientSession are now case-insensitive
diff --git a/aiohttp/client.py b/aiohttp/client.py
--- a/aiohttp/client.... | diff --git a/tests/test_client_session.py b/tests/test_client_session.py
--- a/tests/test_client_session.py
+++ b/tests/test_client_session.py
@@ -43,9 +43,9 @@
"h2": "header2"
}, loop=self.loop)
self.assertEqual(
- set(session._default_headers),
- set([("h1"... | null | null | namanjain12/aiohttp_final:c04a45d9c37d3e5fc740c3ab73595048af6476a9 | true | null | 2 | 11 | null | 878 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.183 | 80.46775 | ||
9,118 | r2e_gym::train::297 | r2e_gym | train | 297 | orange3__ef71048347bc4b453e99b671639d66f9d08c4116 | orange3 | biolab/orange3 | python | ef71048347bc4b453e99b671639d66f9d08c4116 | **Title:** `table_to_frame` Raises TypeError When Including Metas
**Description:**
When converting an Orange `Table` to a pandas `DataFrame`, including metadata (metas) using the `include_metas` parameter results in a `TypeError`. The function does not recognize the `include_metas` keyword argument, preventing the inc... | diff --git a/Orange/data/pandas_compat.py b/Orange/data/pandas_compat.py
--- a/Orange/data/pandas_compat.py
+++ b/Orange/data/pandas_compat.py
@@ -78,13 +78,16 @@
np.column_stack(M) if M else None)
-def table_to_frame(tab):
+def table_to_frame(tab, include_metas=False):
"""
Co... | diff --git a/Orange/data/tests/test_pandas.py b/Orange/data/tests/test_pandas.py
--- a/Orange/data/tests/test_pandas.py
+++ b/Orange/data/tests/test_pandas.py
@@ -1,3 +1,4 @@
+# pylint: disable=import-outside-toplevel
import unittest
import numpy as np
from Orange.data import ContinuousVariable, DiscreteVariable, Ti... | null | null | namanjain12/orange3_final:ef71048347bc4b453e99b671639d66f9d08c4116 | true | null | 1 | 10 | null | 897 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.182833 | 80.46725 | ||
9,119 | r2e_gym::train::5367 | r2e_gym | train | 5,367 | aiohttp__74705a48f242bc2d807e3129c9b88fd22f6eb22b | aiohttp | aio-libs/aiohttp | python | 74705a48f242bc2d807e3129c9b88fd22f6eb22b | ### Accessing `closed` Property on `BaseConnector` Raises AttributeError
**Description**
When attempting to check if a `BaseConnector` instance is closed by accessing the `closed` property, an `AttributeError` is raised because the property does not exist.
**Example Code**
```python
import aiohttp
import asyncio
a... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,8 @@
encoding is not specified #349
- Implement `ClientSession.close()` method
+
+- Implement `connector.closed` readonly property
0.15.3 (04-22-2015)
diff --git a/aiohttp/connector.py b/aiohttp/connector.py
--- a/aiohttp/c... | diff --git a/tests/test_connector.py b/tests/test_connector.py
--- a/tests/test_connector.py
+++ b/tests/test_connector.py
@@ -104,11 +104,13 @@
tr = unittest.mock.Mock()
conn = aiohttp.BaseConnector(loop=self.loop)
+ self.assertFalse(conn.closed)
conn._conns[1] = [(tr, object(), obj... | null | null | namanjain12/aiohttp_final:74705a48f242bc2d807e3129c9b88fd22f6eb22b | true | null | 2 | 14 | null | 817 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.182833 | 80.46725 | ||
9,120 | r2e_gym::train::4668 | r2e_gym | train | 4,668 | numpy__a802f7366e46726a90e07f1329502e38f09544a4 | numpy | numpy/numpy | python | a802f7366e46726a90e07f1329502e38f09544a4 | **Title:** NameError when Determining Default Fill Value Due to Undefined 'unicode' in Python 3
**Description:**
When working with masked arrays, attempting to determine the default fill value raises a `NameError` because the `unicode` type is not defined in Python 3. This issue occurs during the type checking process... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -32,7 +32,7 @@
from numpy import ndarray, amax, amin, iscomplexobj, bool_, _NoValue
from numpy import array as narray
from numpy.lib.function_base import angle
-from numpy.compat import getargspec, formatargspec, long, ... | 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
@@ -1460,7 +1460,7 @@
fval = _check_fill_value(0, "|S3")
assert_equal(fval, asbytes("0"))
fval = _check_fill_value(None, "|S3")
- assert_equal(fval... | null | null | namanjain12/numpy_final:a802f7366e46726a90e07f1329502e38f09544a4 | true | null | 1 | 8 | null | 936 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.182667 | 80.46675 | ||
9,121 | r2e_gym::train::5368 | r2e_gym | train | 5,368 | aiohttp__8cf3ae42bd0b40c1766548ded25b90416a802acb | aiohttp | aio-libs/aiohttp | python | 8cf3ae42bd0b40c1766548ded25b90416a802acb | **Title:** Incorrect Request Path for HTTPS Proxied Connections
**Description:**
When making HTTPS requests through a proxy, the request path is incorrectly set to the full URL instead of the expected `'/'`. This causes issues in establishing the connection properly.
**Example:**
```python
connector = aiohttp.ProxyCo... | diff --git a/aiohttp/connector.py b/aiohttp/connector.py
--- a/aiohttp/connector.py
+++ b/aiohttp/connector.py
@@ -400,9 +400,10 @@
except OSError as exc:
raise ProxyConnectionError(*exc.args) from exc
- req.path = '{scheme}://{host}{path}'.format(scheme=req.scheme,
- ... | diff --git a/tests/test_connector.py b/tests/test_connector.py
--- a/tests/test_connector.py
+++ b/tests/test_connector.py
@@ -606,6 +606,7 @@
req = ClientRequest('GET', 'https://www.python.org')
self.loop.run_until_complete(connector._create_connection(req))
+ self.assertEqual(req.path, '/')... | null | null | namanjain12/aiohttp_final:8cf3ae42bd0b40c1766548ded25b90416a802acb | true | null | 1 | 7 | null | 956 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.182667 | 80.46675 | ||
9,122 | r2e_gym::train::5821 | r2e_gym | train | 5,821 | tornado__57d15bb28549a9ebc9baf6bddeea4c8ada0e84b1 | tornado | tornadoweb/tornado | python | 57d15bb28549a9ebc9baf6bddeea4c8ada0e84b1 | **Title:** 204 No Content Responses Incorrectly Include Content-Length Header
**Description:**
When the server sends a `204 No Content` response, it incorrectly includes a `Content-Length` header. According to the HTTP specification, `204` responses should not contain `Content-Length` or `Transfer-Encoding` headers si... | diff --git a/tornado/http1connection.py b/tornado/http1connection.py
--- a/tornado/http1connection.py
+++ b/tornado/http1connection.py
@@ -351,7 +351,7 @@
# 304 responses have no body (not even a zero-length body), and so
# should not have either Content-Length or Transfer-Encoding.
... | diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py
--- a/tornado/test/simple_httpclient_test.py
+++ b/tornado/test/simple_httpclient_test.py
@@ -73,10 +73,8 @@
class NoContentHandler(RequestHandler):
def get(self):
- if self.get_argument("error", None):
- ... | null | null | namanjain12/tornado_final:57d15bb28549a9ebc9baf6bddeea4c8ada0e84b1 | true | null | 2 | 6 | null | 975 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1825 | 80.46625 | ||
9,123 | r2e_gym::train::6103 | r2e_gym | train | 6,103 | pillow__95402143fe2f8b38280a727e8f0d5ec46813dedb | pillow | python-pillow/pillow | python | 95402143fe2f8b38280a727e8f0d5ec46813dedb | **Title:** Loading PNGs with Large Text Blocks Raises ValueError When LOAD_TRUNCATED_IMAGES is Enabled
**Description:**
When attempting to load a PNG image containing large text chunks with the `LOAD_TRUNCATED_IMAGES` flag enabled, a `ValueError` is raised indicating that the decompressed data is too large.
**Example... | diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py
--- a/PIL/PngImagePlugin.py
+++ b/PIL/PngImagePlugin.py
@@ -311,6 +311,11 @@
comp_method)
try:
icc_profile = _safe_zlib_decompress(s[i+2:])
+ except ValueError:
+ if ImageFile.LOAD_TRUNCATED... | diff --git a/Tests/check_png_dos.py b/Tests/check_png_dos.py
--- a/Tests/check_png_dos.py
+++ b/Tests/check_png_dos.py
@@ -1,5 +1,5 @@
from helper import unittest, PillowTestCase
-from PIL import Image, PngImagePlugin
+from PIL import Image, PngImagePlugin, ImageFile
from io import BytesIO
import zlib
@@ -7,6 +7,2... | null | null | namanjain12/pillow_final:95402143fe2f8b38280a727e8f0d5ec46813dedb | true | null | 1 | 15 | null | 794 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.182333 | 80.46575 | ||
9,124 | r2e_gym::train::215 | r2e_gym | train | 215 | orange3__d2366dc6fd20611fea0fc49733f82dc8d396062d | orange3 | biolab/orange3 | python | d2366dc6fd20611fea0fc49733f82dc8d396062d | **Title:** Initializing OWDataTable with 'output_all_on_no_selection' Raises TypeError
**Description:**
When attempting to initialize the `OWDataTable` widget with the `output_all_on_no_selection` parameter set to `True`, a `TypeError` is raised because the widget does not recognize this parameter.
**Example Code:**
... | 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
@@ -195,6 +195,8 @@
color_by_class = Setting(True)
selected_rows = Setting([], schema_only=True)
selected_cols = Setting([], schema_only=True)
+
+ sett... | 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
@@ -19,7 +19,8 @@
@classmethod
def setUpClass(cls):
super().setUpClass()
- WidgetOutputsTestMixin.i... | null | null | namanjain12/orange3_final:d2366dc6fd20611fea0fc49733f82dc8d396062d | true | null | 1 | 6 | null | 972 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.182 | 80.46475 | ||
9,125 | r2e_gym::train::6052 | r2e_gym | train | 6,052 | pillow__f958e2f8ed7b12582836a6b6c83468c51230182a | pillow | python-pillow/pillow | python | f958e2f8ed7b12582836a6b6c83468c51230182a | **Title:** ContainerIO Returns Bytes Instead of Strings in Text Mode
**Description:**
When using `ContainerIO` with a file opened in text mode (`'r'`), the methods `read()`, `readline()`, and `readlines()` incorrectly return bytes instead of strings. This leads to type errors and unexpected behavior when attempting to... | 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 b""
+ return b"" if "b" in self.fh.mode else ""
self.pos = sel... | 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
@@ -61,73 +61,87 @@
def test_read_n0():
# Arrange
- with open(TEST_FILE, "rb") as fh:
- container = ContainerIO.ContainerIO(fh, 22, 100)
+ for bytesmode in ... | null | null | namanjain12/pillow_final:f958e2f8ed7b12582836a6b6c83468c51230182a | true | null | 1 | 6 | null | 967 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.181167 | 80.46225 | ||
9,126 | r2e_gym::train::5587 | r2e_gym | train | 5,587 | scrapy__f01fd076420f0e58a1a165be31ec505eeb561ef4 | scrapy | scrapy/scrapy | python | f01fd076420f0e58a1a165be31ec505eeb561ef4 | **Title:** `NameError` Raised Due to Undefined `unicode` in Python 3 Iterators
**Description:**
After updating the iterator utilities for Python 3 compatibility, attempting to process XML responses results in a `NameError` because the `unicode` type is no longer defined in Python 3.
**Example Buggy Code:**
```python
... | diff --git a/scrapy/utils/iterators.py b/scrapy/utils/iterators.py
--- a/scrapy/utils/iterators.py
+++ b/scrapy/utils/iterators.py
@@ -1,12 +1,11 @@
import re
import csv
import logging
-
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
-
+from io import StringIO
... | diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txt
--- a/tests/py3-ignores.txt
+++ b/tests/py3-ignores.txt
@@ -16,7 +16,6 @@
tests/test_pipeline_images.py
tests/test_proxy_connect.py
tests/test_spidermiddleware_httperror.py
-tests/test_utils_iterators.py
tests/test_utils_template.py
tests/test_webclient.py... | null | null | namanjain12/scrapy_final:f01fd076420f0e58a1a165be31ec505eeb561ef4 | true | null | 1 | 15 | null | 787 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.181167 | 80.46225 | ||
9,127 | r2e_gym::train::5222 | r2e_gym | train | 5,222 | pyramid__48a04855ad4f1f1ae6af934090f35a4ad035ed67 | pyramid | pylons/pyramid | python | 48a04855ad4f1f1ae6af934090f35a4ad035ed67 | **Title:** `aslist` Method Raises AttributeError with Non-String Objects
**Description:**
When passing a non-string object, such as an integer, to the `aslist` method, it results in an `AttributeError`. This occurs because the method attempts to call the `split` function on objects that are not strings.
**Example Cod... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -3,6 +3,9 @@
Features
--------
+
+- The ``aslist`` method now handles non-string object when flattening.
+ See https://github.com/Pylons/pyramid/pull/3594
- It is now possible to pass multiple values to the ``header`` predicate
for... | diff --git a/tests/test_settings.py b/tests/test_settings.py
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -69,6 +69,14 @@
result = self._callFUT(['abc', 'def'])
self.assertEqual(list(result), ['abc', 'def'])
+ def test_with_integer(self):
+ result = self._callFUT([1])
+ ... | null | null | namanjain12/pyramid_final:48a04855ad4f1f1ae6af934090f35a4ad035ed67 | true | null | 3 | 19 | null | 706 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.181 | 80.46175 | ||
9,128 | r2e_gym::train::5489 | r2e_gym | train | 5,489 | aiohttp__62173bea1e4e3538d46e6e9b94d727d870d86879 | aiohttp | aio-libs/aiohttp | python | 62173bea1e4e3538d46e6e9b94d727d870d86879 | **Title:** WebSocket URLs (`ws://` and `wss://`) Are Incorrectly Rejected as Non-HTTP URLs
**Description:**
When attempting to establish a WebSocket connection using `ws://` or `wss://` URLs, the client incorrectly rejects these URLs, raising a `NonHttpUrlClientError`. This prevents successful WebSocket connections.
... | diff --git a/CHANGES/8481.bugfix.rst b/CHANGES/8481.bugfix.rst
--- a/CHANGES/8481.bugfix.rst
+++ b/CHANGES/8481.bugfix.rst
@@ -0,0 +1,2 @@
+Fixed the incorrect rejection of ``ws://`` and ``wss://`` urls
+-- by :user:` AraHaan`.
diff --git a/aiohttp/client.py b/aiohttp/client.py
--- a/aiohttp/client.py
+++ b/aiohttp/cli... | diff --git a/tests/conftest.py b/tests/conftest.py
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -1,10 +1,11 @@
# type: ignore
import asyncio
+import base64
import os
import socket
import ssl
import sys
-from hashlib import md5, sha256
+from hashlib import md5, sha1, sha256
from pathlib import Path
from te... | null | null | namanjain12/aiohttp_final:62173bea1e4e3538d46e6e9b94d727d870d86879 | true | null | 2 | 6 | null | 965 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.180833 | 80.46125 | ||
9,129 | r2e_gym::train::5314 | r2e_gym | train | 5,314 | aiohttp__7c38deb7c709be6c69962002c133e2781512724b | aiohttp | aio-libs/aiohttp | python | 7c38deb7c709be6c69962002c133e2781512724b | **Title:** Registering a Route with Invalid Regex Does Not Raise ValueError
**Description:**
When attempting to register a route that includes an invalid regular expression in its path, the system does not raise the expected `ValueError`. Instead, it fails unexpectedly, preventing the route from being registered corre... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -68,3 +68,4 @@
- Add `.routes()` view for urldispatcher #519
+- Route name should be a valid identifier name from now #567
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -43,6 +43,7 @@
... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -77,6 +77,12 @@
self.router.register_route(route)
self.assertRaises(ValueError, self.router.register_route, route)
+ route = PlainRoute('GET', handler, '1bad n... | null | null | namanjain12/aiohttp_final:7c38deb7c709be6c69962002c133e2781512724b | true | null | 3 | 9 | null | 901 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.180167 | 80.45925 | ||
9,130 | r2e_gym::train::6085 | r2e_gym | train | 6,085 | pillow__97ee3dd12ba790f87d3d4cb58febe8bdc1f3d886 | pillow | python-pillow/pillow | python | 97ee3dd12ba790f87d3d4cb58febe8bdc1f3d886 | **Title:**
`DecompressionBombError` Attribute Missing in `PIL.Image` Module
**Description:**
When setting `Image.MAX_IMAGE_PIXELS` to a value below the pixel count of a test image, the code is expected to raise a `DecompressionBombError`. However, attempting to use `DecompressionBombError` results in an `AttributeErro... | diff --git a/PIL/Image.py b/PIL/Image.py
--- a/PIL/Image.py
+++ b/PIL/Image.py
@@ -36,6 +36,8 @@
class DecompressionBombWarning(RuntimeWarning):
pass
+class DecompressionBombError(Exception):
+ pass
class _imaging_not_installed(object):
# module placeholder
@@ -2493,6 +2495,12 @@
pixels = size... | diff --git a/Tests/test_decompression_bomb.py b/Tests/test_decompression_bomb.py
--- a/Tests/test_decompression_bomb.py
+++ b/Tests/test_decompression_bomb.py
@@ -29,20 +29,26 @@
Image.open(TEST_FILE)
def test_warning(self):
- # Arrange
- # Set limit to a low, easily testable value
- ... | null | null | namanjain12/pillow_final:97ee3dd12ba790f87d3d4cb58febe8bdc1f3d886 | true | null | 1 | 8 | null | 920 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.18 | 80.45875 | ||
9,131 | r2e_gym::train::6222 | r2e_gym | train | 6,222 | pillow__e304a0d501315b95c71ea16c532216f391db240f | pillow | python-pillow/pillow | python | e304a0d501315b95c71ea16c532216f391db240f | **Title:** Unclear error message for invalid size parameter in Color3DLUT
**Description:**
When initializing the `Color3DLUT` class with an invalid `size` parameter, the raised `ValueError` message is unclear and does not accurately describe the expected input format. Providing a `size` that is neither an integer nor ... | diff --git a/src/PIL/ImageFilter.py b/src/PIL/ImageFilter.py
--- a/src/PIL/ImageFilter.py
+++ b/src/PIL/ImageFilter.py
@@ -343,8 +343,8 @@
if len(table) != channels * size[0] * size[1] * size[2]:
raise ValueError(
- "The table should have channels * size**3 float items "
- ... | diff --git a/Tests/test_color_lut.py b/Tests/test_color_lut.py
--- a/Tests/test_color_lut.py
+++ b/Tests/test_color_lut.py
@@ -1,4 +1,5 @@
from __future__ import division
+from tempfile import NamedTemporaryFile
from helper import unittest, PillowTestCase
from PIL import Image, ImageFilter
@@ -228,10 +229,10 @@
... | null | null | namanjain12/pillow_final:e304a0d501315b95c71ea16c532216f391db240f | true | null | 1 | 8 | null | 916 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.179333 | 80.45675 | ||
9,132 | r2e_gym::train::5942 | r2e_gym | train | 5,942 | tornado__b2f8f9970d142fdd2ed91c2f25f34605c6ba29bc | tornado | tornadoweb/tornado | python | b2f8f9970d142fdd2ed91c2f25f34605c6ba29bc | **Title:**
HTTPClient.fetch raises TypeError when using `raise_error=False`
**Description:**
When attempting to disable the automatic raising of `HTTPError` by passing `raise_error=False` to the `fetch` method, a `TypeError` is raised because the `HTTPRequest` does not accept the `raise_error` keyword argument.
**Exa... | diff --git a/tornado/httpclient.py b/tornado/httpclient.py
--- a/tornado/httpclient.py
+++ b/tornado/httpclient.py
@@ -95,7 +95,8 @@
If it is a string, we construct an `HTTPRequest` using any additional
kwargs: ``HTTPRequest(request, **kwargs)``
- If an error occurs during the fetch, we raise... | diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py
--- a/tornado/test/httpclient_test.py
+++ b/tornado/test/httpclient_test.py
@@ -405,6 +405,11 @@
self.assertEqual(context.exception.response.code, 404)
@gen_test
+ def test_future_http_error_no_raise(self):
+ respon... | null | null | namanjain12/tornado_final:b2f8f9970d142fdd2ed91c2f25f34605c6ba29bc | true | null | 1 | 13 | null | 814 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.179 | 80.45575 | ||
9,133 | r2e_gym::train::56 | r2e_gym | train | 56 | orange3__68aa64457e0c4b85d80ce1d948acdc424475fa07 | orange3 | biolab/orange3 | python | 68aa64457e0c4b85d80ce1d948acdc424475fa07 | **Title:** Selection Not Preserved After Resetting Graph in OWMosaicDisplay
**Description**
When a selection is made in the Mosaic widget and the data is subsequently cleared and reloaded, the selection does not persist as expected. This results in the selected area being lost, which can disrupt the user's workflow an... | diff --git a/Orange/widgets/visualize/owmosaic.py b/Orange/widgets/visualize/owmosaic.py
--- a/Orange/widgets/visualize/owmosaic.py
+++ b/Orange/widgets/visualize/owmosaic.py
@@ -317,6 +317,7 @@
self.discrete_data = None
self.subset_data = None
self.subset_indices = None
+ self.__pendi... | diff --git a/Orange/widgets/visualize/tests/test_owmosaic.py b/Orange/widgets/visualize/tests/test_owmosaic.py
--- a/Orange/widgets/visualize/tests/test_owmosaic.py
+++ b/Orange/widgets/visualize/tests/test_owmosaic.py
@@ -143,6 +143,24 @@
self.assertEqual(len(call_args), 2)
self.assertEqual(call_args... | null | null | namanjain12/orange3_final:68aa64457e0c4b85d80ce1d948acdc424475fa07 | true | null | 1 | 7 | null | 933 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.178833 | 80.45525 | ||
9,134 | r2e_gym::train::479 | r2e_gym | train | 479 | orange3__493d5b5577ae0b228e9528ab29ade4ef82fa5b96 | orange3 | biolab/orange3 | python | 493d5b5577ae0b228e9528ab29ade4ef82fa5b96 | **Title:** OWParameterFitter Widget Raises AttributeError When Sending Report
**Description:**
Attempting to generate a report using the `OWParameterFitter` widget results in an `AttributeError`. The widget does not recognize the `send_report` method, preventing the report from being generated.
**Example Buggy Code:*... | diff --git a/Orange/widgets/evaluate/owparameterfitter.py b/Orange/widgets/evaluate/owparameterfitter.py
--- a/Orange/widgets/evaluate/owparameterfitter.py
+++ b/Orange/widgets/evaluate/owparameterfitter.py
@@ -485,6 +485,17 @@
self.shutdown()
super().onDeleteWidget()
+ def send_report(self):
+ ... | diff --git a/Orange/widgets/evaluate/tests/test_owparameterfitter.py b/Orange/widgets/evaluate/tests/test_owparameterfitter.py
--- a/Orange/widgets/evaluate/tests/test_owparameterfitter.py
+++ b/Orange/widgets/evaluate/tests/test_owparameterfitter.py
@@ -286,7 +286,17 @@
self.assertEqual(font1.italic(), font2.... | null | null | namanjain12/orange3_final:493d5b5577ae0b228e9528ab29ade4ef82fa5b96 | true | null | 1 | 11 | null | 851 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1785 | 80.45425 | ||
9,135 | r2e_gym::train::4055 | r2e_gym | train | 4,055 | coveragepy__07c3c5dbf5bc3ebe22855fd77a388f12a0bec066 | coveragepy | nedbat/coveragepy | python | 07c3c5dbf5bc3ebe22855fd77a388f12a0bec066 | **Title:** `qualname_from_frame` raises KeyError with class named `test_something`
**Description:**
When a class is defined with a name that starts with `test_`, the `qualname_from_frame` function in `coverage/context.py` raises a `KeyError`. This happens because the function incorrectly assumes that such names corres... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,7 +20,10 @@
Unreleased
----------
-- Nothing yet.
+- A class named "test_something" no longer confuses the `test_function` dynamic
+ context setting. Fixes `issue 829`_.
+
+.. _issue 829: https://github.com/nedbat/coveragepy/issues/... | diff --git a/tests/test_context.py b/tests/test_context.py
--- a/tests/test_context.py
+++ b/tests/test_context.py
@@ -285,3 +285,8 @@
self.skipTest("Old-style classes are only in Python 2")
self.assertEqual(OldStyle().meth(), "tests.test_context.OldStyle.meth")
self.assertEqual(OldChild(... | null | null | namanjain12/coveragepy_final:07c3c5dbf5bc3ebe22855fd77a388f12a0bec066 | true | null | 2 | 9 | null | 889 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.178167 | 80.45325 | ||
9,136 | r2e_gym::train::4025 | r2e_gym | train | 4,025 | coveragepy__5dbbe1430c16fe15b553e6909be8be5f2b9b71b9 | coveragepy | nedbat/coveragepy | python | 5dbbe1430c16fe15b553e6909be8be5f2b9b71b9 | **Title:** TypeError when using `once` parameter with `_warn` method
**Description:**
When attempting to mark warnings to display only once by using the `once` parameter, a `TypeError` is raised. This issue occurs because the `_warn` method does not recognize the `once` keyword argument.
**Example Code:**
```python
c... | diff --git a/coverage/control.py b/coverage/control.py
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -203,6 +203,7 @@
self._warn_no_data = True
self._warn_unimported_source = True
self._warn_preimported_source = check_preimported
+ self._no_warn_slugs = None
# A rec... | diff --git a/tests/coveragetest.py b/tests/coveragetest.py
--- a/tests/coveragetest.py
+++ b/tests/coveragetest.py
@@ -264,8 +264,9 @@
"""
saved_warnings = []
- def capture_warning(msg, slug=None):
+ def capture_warning(msg, slug=None, once=False): # pylint: disable=unused-argum... | null | null | namanjain12/coveragepy_final:5dbbe1430c16fe15b553e6909be8be5f2b9b71b9 | true | null | 1 | 17 | null | 726 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.177667 | 80.45175 | ||
9,137 | r2e_gym::train::5148 | r2e_gym | train | 5,148 | pyramid__d292b97587c19b4aa7fa0150a8b5ecc8d758b783 | pyramid | pylons/pyramid | python | d292b97587c19b4aa7fa0150a8b5ecc8d758b783 | **Title:** `wsgiapp` does not raise `ValueError` when `wrapped` is `None`
**Description:**
When initializing a WSGI application using `wsgiapp` with `None` as the `wrapped` argument, the function does not raise an error. This oversight can lead to unexpected behavior later in the application lifecycle since `wsgiapp` ... | diff --git a/pyramid/wsgi.py b/pyramid/wsgi.py
--- a/pyramid/wsgi.py
+++ b/pyramid/wsgi.py
@@ -29,6 +29,10 @@
view.
"""
+
+ if wrapped is None:
+ raise ValueError('wrapped can not be None')
+
def decorator(context, request):
return request.get_response(wrapped)
@@ -69,6 +73,9 @@
... | diff --git a/pyramid/tests/test_wsgi.py b/pyramid/tests/test_wsgi.py
--- a/pyramid/tests/test_wsgi.py
+++ b/pyramid/tests/test_wsgi.py
@@ -4,6 +4,17 @@
def _callFUT(self, app):
from pyramid.wsgi import wsgiapp
return wsgiapp(app)
+
+ def test_wsgiapp_none(self):
+ self.assertRaises(Valu... | null | null | namanjain12/pyramid_final:d292b97587c19b4aa7fa0150a8b5ecc8d758b783 | true | null | 1 | 7 | null | 925 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1775 | 80.45125 | ||
9,138 | r2e_gym::train::6611 | r2e_gym | train | 6,611 | pillow__8fad541531689f3ca7228de250b51e609596eacf | pillow | python-pillow/pillow | python | 8fad541531689f3ca7228de250b51e609596eacf | **Title:** `autocontrast()` Raises TypeError When Using `mask` Argument
**Description:**
Using the `mask` parameter with `ImageOps.autocontrast` results in a `TypeError`, indicating that the function does not recognize the `mask` keyword argument.
**Example Code:**
```python
from PIL import Image, ImageOps
image = I... | diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py
--- a/src/PIL/ImageOps.py
+++ b/src/PIL/ImageOps.py
@@ -61,10 +61,10 @@
# actions
-def autocontrast(image, cutoff=0, ignore=None):
+def autocontrast(image, cutoff=0, ignore=None, mask=None):
"""
Maximize (normalize) image contrast. This function calc... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -1,5 +1,5 @@
import pytest
-from PIL import Image, ImageOps, features
+from PIL import Image, ImageOps, ImageDraw, features
from .helper import (
assert_image_equal,
@@ -24,7 +24,9 @@
... | null | null | namanjain12/pillow_final:8fad541531689f3ca7228de250b51e609596eacf | true | null | 1 | 16 | null | 744 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.177333 | 80.45075 | ||
9,139 | r2e_gym::train::5092 | r2e_gym | train | 5,092 | pyramid__d699c9ace8028bf74e1c6c3ea085fdf9beeb2586 | pyramid | pylons/pyramid | python | d699c9ace8028bf74e1c6c3ea085fdf9beeb2586 | **Title:** Passing keyword arguments to `LegacySecurityPolicy.forget` raises AttributeError instead of ValueError
**Description:**
When using the `forget` method of `LegacySecurityPolicy` with keyword arguments, an `AttributeError` is unexpectedly raised. This occurs because the method attempts to access `request.regi... | diff --git a/src/pyramid/security.py b/src/pyramid/security.py
--- a/src/pyramid/security.py
+++ b/src/pyramid/security.py
@@ -439,8 +439,12 @@
return authn.remember(request, userid, **kw)
def forget(self, request, **kw):
+ if kw:
+ raise ValueError(
+ 'Legacy authentica... | diff --git a/tests/test_security.py b/tests/test_security.py
--- a/tests/test_security.py
+++ b/tests/test_security.py
@@ -466,6 +466,12 @@
policy.forget(request), [('X-Pyramid-Test', 'logout')]
)
+ def test_forget_with_kwargs(self):
+ from pyramid.security import LegacySecurityPolicy
... | null | null | namanjain12/pyramid_final:d699c9ace8028bf74e1c6c3ea085fdf9beeb2586 | true | null | 1 | 6 | null | 944 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.177333 | 80.45075 | ||
9,140 | r2e_gym::train::4782 | r2e_gym | train | 4,782 | numpy__2a6daf39cc4fd895ab803edf018907cb8044f821 | numpy | numpy/numpy | python | 2a6daf39cc4fd895ab803edf018907cb8044f821 | **Title:** `np.average` Raises AttributeError for Arrays Containing Fraction Elements
**Description:**
When attempting to compute the average of an array containing `Fraction` elements using `np.average`, an `AttributeError` is raised. This occurs because the function tries to access the `dtype` attribute of a `Fracti... | 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
@@ -516,7 +516,8 @@
if weights is None:
avg = a.mean(axis, **keepdims_kw)
- scl = avg.dtype.type(a.size/avg.size)
+ avg_as_array = np.asanyarray(avg)
+ ... | 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
@@ -420,6 +420,11 @@
w = np.array([decimal.Decimal(1) for _ in range(10)])
w /= w.sum()
assert_almost_equal(a.mean... | null | null | namanjain12/numpy_final:2a6daf39cc4fd895ab803edf018907cb8044f821 | true | null | 1 | 9 | null | 883 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.177167 | 80.45025 | ||
9,141 | r2e_gym::train::6294 | r2e_gym | train | 6,294 | pillow__557ba59d13de919d04b3fd4cdef8634f7d4b3348 | pillow | python-pillow/pillow | python | 557ba59d13de919d04b3fd4cdef8634f7d4b3348 | **Title:**
ImageMath.eval Raises SystemExit Instead of ValueError When Using Disallowed Built-in Functions
**Description:**
When attempting to evaluate an expression that includes disallowed built-in functions using `ImageMath.eval`, the function unexpectedly raises a `SystemExit` instead of a `ValueError`. This behav... | diff --git a/docs/releasenotes/10.2.0.rst b/docs/releasenotes/10.2.0.rst
--- a/docs/releasenotes/10.2.0.rst
+++ b/docs/releasenotes/10.2.0.rst
@@ -62,10 +62,13 @@
Security
========
-TODO
-^^^^
+Restricted environment keys for ImageMath.eval
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-TODO
+:cve:`2023-50447`:... | diff --git a/Tests/test_imagemath.py b/Tests/test_imagemath.py
--- a/Tests/test_imagemath.py
+++ b/Tests/test_imagemath.py
@@ -69,6 +69,11 @@
ImageMath.eval("1", {"__": None})
+def test_prevent_builtins():
+ with pytest.raises(ValueError):
+ ImageMath.eval("(lambda: exec('exit()'))()", {"exec": N... | null | null | namanjain12/pillow_final:557ba59d13de919d04b3fd4cdef8634f7d4b3348 | true | null | 2 | 11 | null | 835 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.175833 | 80.44625 | ||
9,142 | r2e_gym::train::4157 | r2e_gym | train | 4,157 | numpy__92d08dbcc9f489e54aeab8525b4b30f7b5d01ecf | numpy | numpy/numpy | python | 92d08dbcc9f489e54aeab8525b4b30f7b5d01ecf | **Error When Using `np.gradient` with Scalar Spacing Wrapped in `np.array`**
**Description**
When calling `np.gradient` with a scalar spacing provided as a zero-dimensional NumPy array, a `TypeError` is raised unexpectedly.
**Example Code**
```python
import numpy as np
data = np.arange(5)
spacing = np.array(3.0)
gr... | 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
@@ -1676,23 +1676,28 @@
len_axes = len(axes)
n = len(varargs)
if n == 0:
+ # no spacing argument - use 1 in all axes
dx = [1.0] * len_axes
- elif n == ... | 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
@@ -804,8 +804,11 @@
# distances must be scalars or have size equal to gradient[axis]
gradient(np.arange(5), 3.)
+ ... | null | null | namanjain12/numpy_final:92d08dbcc9f489e54aeab8525b4b30f7b5d01ecf | true | null | 1 | 19 | null | 675 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.175833 | 80.44625 | ||
9,143 | r2e_gym::train::5112 | r2e_gym | train | 5,112 | pyramid__267dbd261862c3d1e06ec49aad36e4bbae384eca | pyramid | pylons/pyramid | python | 267dbd261862c3d1e06ec49aad36e4bbae384eca | **Title:** Predicate Raises AttributeError When `matchdict` is `None`
**Description:**
When using the `MatchParamPredicate`, if the `request.matchdict` is `None`, calling the predicate results in an `AttributeError` because it attempts to call `.get` on a `NoneType` object.
**Example Code:**
```python
inst = MatchPar... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -51,6 +51,10 @@
inadvertently raised a ``KeyError`` looking for ``request_iface`` as an
attribute of the request. It no longer fails in this case. See
https://github.com/Pylons/pyramid/issues/700
+
+- Be more tolerant of potential ... | diff --git a/pyramid/tests/test_config/test_predicates.py b/pyramid/tests/test_config/test_predicates.py
--- a/pyramid/tests/test_config/test_predicates.py
+++ b/pyramid/tests/test_config/test_predicates.py
@@ -184,6 +184,13 @@
inst = self._makeOne('abc=1')
request = Dummy()
request.matchdict... | null | null | namanjain12/pyramid_final:267dbd261862c3d1e06ec49aad36e4bbae384eca | true | null | 2 | 13 | null | 795 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.175833 | 80.44625 | ||
9,144 | r2e_gym::train::5054 | r2e_gym | train | 5,054 | datalad__435cfcb1ae717f707c4530e989e2d3b6c97a73e9 | datalad | datalad/datalad | python | 435cfcb1ae717f707c4530e989e2d3b6c97a73e9 | **Title:** `unique()` Function Does Not Support `reverse` Parameter, Causing TypeError
**Description:**
When attempting to use the `unique()` function with the `reverse` option, a `TypeError` is raised. This prevents users from specifying the order preference when retrieving unique elements from a sequence.
**Example... | diff --git a/datalad/utils.py b/datalad/utils.py
--- a/datalad/utils.py
+++ b/datalad/utils.py
@@ -740,7 +740,7 @@
% (val, cast_types))
-def unique(seq, key=None):
+def unique(seq, key=None, reverse=False):
"""Given a sequence return a list only with unique elements while maintaining order
... | 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
@@ -599,15 +599,25 @@
def test_unique():
eq_(unique(range(3)), [0, 1, 2])
+ eq_(unique(range(3), reverse=True), [0, 1, 2])
eq_(unique((1, 0, 1, 3, 2, 0, 1)), [1, 0, ... | null | null | namanjain12/datalad_final:435cfcb1ae717f707c4530e989e2d3b6c97a73e9 | true | null | 1 | 14 | null | 774 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.175667 | 80.44575 | ||
9,145 | r2e_gym::train::5940 | r2e_gym | train | 5,940 | tornado__2d8e56e5288e4d6409f0f44b9a2e92dd33cfd36a | tornado | tornadoweb/tornado | python | 2d8e56e5288e4d6409f0f44b9a2e92dd33cfd36a | **Title:** Google OAuth2 Login Returns Invalid Response, Causing JSONDecodeError
**Description:**
When attempting to authenticate a user via Google OAuth2, the authentication process fails because the response does not include the expected user information. Instead, the response body is empty or malformed, leading to ... | diff --git a/tornado/auth.py b/tornado/auth.py
--- a/tornado/auth.py
+++ b/tornado/auth.py
@@ -661,7 +661,7 @@
if all_args:
url += "?" + urllib_parse.urlencode(all_args)
- callback = functools.partial(self._on_facebook_request, callback)
+ callback = functools.partial(self._on_oaut... | diff --git a/tornado/test/auth_test.py b/tornado/test/auth_test.py
--- a/tornado/test/auth_test.py
+++ b/tornado/test/auth_test.py
@@ -421,14 +421,17 @@
self._OAUTH_REDIRECT_URI = test.get_url('/client/login')
self._OAUTH_AUTHORIZE_URL = test.get_url('/google/oauth2/authorize')
self._OAUTH_AC... | null | null | namanjain12/tornado_final:2d8e56e5288e4d6409f0f44b9a2e92dd33cfd36a | true | null | 1 | 8 | null | 893 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1755 | 80.44525 | ||
9,146 | r2e_gym::train::5933 | r2e_gym | train | 5,933 | tornado__e4e9dbb6314a358bb55ce5bda6e6e45cf91737d7 | tornado | tornadoweb/tornado | python | e4e9dbb6314a358bb55ce5bda6e6e45cf91737d7 | Title: Cannot await methods decorated with @run_on_executor - Raises TypeError
**Description**
When using the `@run_on_executor` decorator, attempting to `await` the decorated method results in a `TypeError` because the returned future is not compatible with `await` expressions.
**Example Code:**
```python
from con... | diff --git a/tornado/concurrent.py b/tornado/concurrent.py
--- a/tornado/concurrent.py
+++ b/tornado/concurrent.py
@@ -421,6 +421,10 @@
.. versionchanged:: 5.0
Always uses the current IOLoop instead of ``self.io_loop``.
+
+ .. versionchanged:: 5.1
+ Returns a `.Future` compatible with ``await`` ... | 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
@@ -31,7 +31,7 @@
from tornado import stack_context
from tornado.tcpserver import TCPServer
from tornado.testing import AsyncTestCase, ExpectLog, bind_unused_port... | null | null | namanjain12/tornado_final:e4e9dbb6314a358bb55ce5bda6e6e45cf91737d7 | true | null | 1 | 12 | null | 812 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.175333 | 80.44475 | ||
9,147 | r2e_gym::train::4766 | r2e_gym | train | 4,766 | numpy__518313ba108a86ac803a723e81ed858a53c368ae | numpy | numpy/numpy | python | 518313ba108a86ac803a723e81ed858a53c368ae | **Title:** `np.r_` Does Not Raise OverflowError When Concatenating int8 Array with Out-of-Range Integer
**Description:**
When using `np.r_` to concatenate an `int8` array with an integer value that exceeds the `int8` range, an `OverflowError` is expected after the NEP 50 transition when the promotion state is set to "... | diff --git a/doc/release/upcoming_changes/22539.change.rst b/doc/release/upcoming_changes/22539.change.rst
--- a/doc/release/upcoming_changes/22539.change.rst
+++ b/doc/release/upcoming_changes/22539.change.rst
@@ -16,4 +16,4 @@
array, while the second is due to ``255`` not fitting into ``int8`` and
NumPy currently i... | diff --git a/numpy/core/tests/test_nep50_promotions.py b/numpy/core/tests/test_nep50_promotions.py
--- a/numpy/core/tests/test_nep50_promotions.py
+++ b/numpy/core/tests/test_nep50_promotions.py
@@ -178,3 +178,11 @@
arr = np.array(1)
assert (arr + 2**63).dtype == np.float64
assert (arr[()] + 2**63).dtype... | null | null | namanjain12/numpy_final:518313ba108a86ac803a723e81ed858a53c368ae | true | null | 2 | 7 | null | 907 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1745 | 80.44225 | ||
9,148 | r2e_gym::train::6059 | r2e_gym | train | 6,059 | pillow__f9a3178bb34e6b28bc46d42ef88f5069ebabde32 | pillow | python-pillow/pillow | python | f9a3178bb34e6b28bc46d42ef88f5069ebabde32 | **Title:** RGB ImagePalette Does Not Reject Non-Opaque RGBA Colors
**Description:**
When using an `RGB` mode `ImagePalette`, passing a color with an alpha value less than 255 (translucent color) does not raise an error as expected. This can lead to unexpected behavior when handling image palettes that should strictly ... | diff --git a/src/PIL/ImagePalette.py b/src/PIL/ImagePalette.py
--- a/src/PIL/ImagePalette.py
+++ b/src/PIL/ImagePalette.py
@@ -114,9 +114,13 @@
if self.rawmode:
raise ValueError("palette contains raw palette data")
if isinstance(color, tuple):
- if self.mode == "RGB":
- ... | diff --git a/Tests/test_imagepalette.py b/Tests/test_imagepalette.py
--- a/Tests/test_imagepalette.py
+++ b/Tests/test_imagepalette.py
@@ -48,6 +48,15 @@
# Test unknown color specifier
with pytest.raises(ValueError):
palette.getcolor("unknown")
+
+
+def test_getcolor_raises_on_incompatible_color():
+... | null | null | namanjain12/pillow_final:f9a3178bb34e6b28bc46d42ef88f5069ebabde32 | true | null | 1 | 8 | null | 885 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.174167 | 80.44125 | ||
9,149 | r2e_gym::train::4981 | r2e_gym | train | 4,981 | datalad__521b2f1085b0cc22b75b8449028424f09b85507f | datalad | datalad/datalad | python | 521b2f1085b0cc22b75b8449028424f09b85507f | ### Title: Passing Empty stdin Data Causes AttributeError in Runner
#### Description
When executing a command with empty standard input (`stdin`), the runner raises an `AttributeError`. This occurs because the runner incorrectly tries to access the `fileno` attribute on a `bytes` object when `stdin` data is empty.
**... | diff --git a/datalad/nonasyncrunner.py b/datalad/nonasyncrunner.py
--- a/datalad/nonasyncrunner.py
+++ b/datalad/nonasyncrunner.py
@@ -188,11 +188,13 @@
# indicate that there is nothing to write to stdin
stdin_data = None
+ write_stdin = stdin_data is not None
+
kwargs = {
**kwargs,... | diff --git a/datalad/tests/test_witless_runner.py b/datalad/tests/test_witless_runner.py
--- a/datalad/tests/test_witless_runner.py
+++ b/datalad/tests/test_witless_runner.py
@@ -170,6 +170,17 @@
runner.run(
["echo", "a", "b", "c"],
stdin=None,
+ protocol=None
+ )
+
+
+@timed(3)
+def te... | null | null | namanjain12/datalad_final:521b2f1085b0cc22b75b8449028424f09b85507f | true | null | 1 | 12 | null | 802 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.173667 | 80.43975 | ||
9,150 | r2e_gym::train::4859 | r2e_gym | train | 4,859 | numpy__d86e3fee3c9906ce0fad36520de86d9ac306cee8 | numpy | numpy/numpy | python | d86e3fee3c9906ce0fad36520de86d9ac306cee8 | **Title:** TypeError When Using 0-Dimensional Arrays as Spacing in `numpy.gradient`
**Description:**
When providing 0-dimensional arrays (scalars wrapped in `numpy.array`) as spacing arguments to the `numpy.gradient` function, a `TypeError` is raised instead of being handled correctly.
**Example Buggy Code:**
```pyth... | 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
@@ -1674,6 +1674,7 @@
S0025-5718-1988-0935077-0/S0025-5718-1988-0935077-0.pdf>`_.
"""
f = np.asanyarray(f)
+ varargs = [asanyarray(d) for d in varargs]
N ... | 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
@@ -742,8 +742,11 @@
# distances must be scalars or have size equal to gradient[axis]
gradient(np.arange(5), 3.)
+ ... | null | null | namanjain12/numpy_final:d86e3fee3c9906ce0fad36520de86d9ac306cee8 | true | null | 1 | 18 | null | 681 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1735 | 80.43925 | ||
9,151 | r2e_gym::train::4497 | r2e_gym | train | 4,497 | numpy__a9089242268d234c9f213af14c62a0a733f84a04 | numpy | numpy/numpy | python | a9089242268d234c9f213af14c62a0a733f84a04 | **Title:** Passing 'nuc' as norm order raises ValueError: Invalid norm order for matrices
**Description:**
When attempting to compute the nuclear norm by passing `ord='nuc'` to `numpy.linalg.norm`, the function raises a `ValueError` stating "Invalid norm order for matrices."
**Example Code:**
```python
import numpy... | diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -1892,7 +1892,7 @@
def _multi_svd_norm(x, row_axis, col_axis, op):
- """Compute the extreme singular values of the 2-D matrices in `x`.
+ """Compute a function of the singular values of t... | diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -837,10 +837,11 @@
array(c, dtype=self.dt)):
_test(v)
- def test_matrix(self):
+ def test_matrix_2x2(self):
... | null | null | namanjain12/numpy_final:a9089242268d234c9f213af14c62a0a733f84a04 | true | null | 1 | 17 | null | 698 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.173 | 80.43775 | ||
9,152 | r2e_gym::train::4652 | r2e_gym | train | 4,652 | numpy__5e9c419a6d41eb9d544b6d87dd621ad5b346a0fa | numpy | numpy/numpy | python | 5e9c419a6d41eb9d544b6d87dd621ad5b346a0fa | **Title:** `np.pad` Raises TypeError When `mode` Parameter Is Omitted
**Description:**
When using `np.pad` without specifying the `mode` parameter, a `TypeError` is raised indicating that the `mode` argument is missing. This behavior is unexpected as it should default to padding with a constant value, typically zeros.... | diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py
--- a/numpy/lib/arraypad.py
+++ b/numpy/lib/arraypad.py
@@ -957,12 +957,12 @@
# Public functions
-def _pad_dispatcher(array, pad_width, mode, **kwargs):
+def _pad_dispatcher(array, pad_width, mode=None, **kwargs):
return (array,)
@array_function_... | 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
@@ -1249,10 +1249,9 @@
np.pad([1, 2, 3], 1, mode, **{key: value})
-def test_missing_mode():
- match = "missing 1 required positional argument... | null | null | namanjain12/numpy_final:5e9c419a6d41eb9d544b6d87dd621ad5b346a0fa | true | null | 1 | 8 | null | 876 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.172667 | 80.43675 | ||
9,153 | r2e_gym::train::4948 | r2e_gym | train | 4,948 | datalad__141a55f9c03cc25dfdc087a5993d39b79431e84f | datalad | datalad/datalad | python | 141a55f9c03cc25dfdc087a5993d39b79431e84f | **Title:** `result_filter` Does Not Receive Positional Arguments as Keyword Arguments
**Description:**
When using the `result_filter` without explicitly specifying keyword arguments, expected parameters are not passed correctly, leading to unexpected behavior.
**Example:**
```python
def greatfilter(res, **kwargs):
... | diff --git a/datalad/interface/utils.py b/datalad/interface/utils.py
--- a/datalad/interface/utils.py
+++ b/datalad/interface/utils.py
@@ -63,6 +63,7 @@
from .base import Interface
from .base import update_docstring_with_parameters
from .base import alter_interface_docs_for_api
+from .base import merge_allargs2kwarg... | diff --git a/datalad/interface/tests/test_utils.py b/datalad/interface/tests/test_utils.py
--- a/datalad/interface/tests/test_utils.py
+++ b/datalad/interface/tests/test_utils.py
@@ -424,11 +424,11 @@
# test more sophisticated filters that actually get to see the
# API call's kwargs
def greatfilter(res, ... | null | null | namanjain12/datalad_final:141a55f9c03cc25dfdc087a5993d39b79431e84f | true | null | 1 | 7 | null | 894 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.172333 | 80.43575 | ||
9,154 | r2e_gym::train::5139 | r2e_gym | train | 5,139 | pyramid__5488da0d165468199f0d07a2ca579b86617fad72 | pyramid | pylons/pyramid | python | 5488da0d165468199f0d07a2ca579b86617fad72 | **Title:** Unhandled Pickle Exceptions Cause Session Loading Crashes
**Description:**
When loading session data using `PickleSerializer`, unexpected pickle exceptions are not properly handled, resulting in crashes.
**Example Code:**
```python
from pyramid.session import PickleSerializer
serializer = PickleSerializer... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -67,6 +67,12 @@
code. The old ``MIMEAccept`` has been deprecated. The new methods follow the
RFC's more closely. See https://github.com/Pylons/pyramid/pull/3251
+- Catch extra errors like ``AttributeError`` when unpickling "trusted"
+... | 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
@@ -2,6 +2,7 @@
import json
import unittest
from pyramid import testing
+from pyramid.compat import pickle
class SharedCookieSessionTests(object):
@@ -462,6 +463,24 ... | null | null | namanjain12/pyramid_final:5488da0d165468199f0d07a2ca579b86617fad72 | true | null | 2 | 12 | null | 791 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.171833 | 80.43425 | ||
9,155 | r2e_gym::train::141 | r2e_gym | train | 141 | orange3__32eec7b570cabbaea58e535665f1176903300969 | orange3 | biolab/orange3 | python | 32eec7b570cabbaea58e535665f1176903300969 | **Title:** Single Column Selection with Negative Index Fails to Optimize Indices
**Description:**
When selecting a single column using a negative index, the index optimization function does not return the expected slice. This results in incorrect handling of column selections, especially when negative indexing is invo... | diff --git a/Orange/data/table.py b/Orange/data/table.py
--- a/Orange/data/table.py
+++ b/Orange/data/table.py
@@ -2025,6 +2025,13 @@
if indices is ...:
return slice(None, None, 1)
+ # a very common case for column selection
+ if len(indices) == 1 and not isinstance(indices[0], bool):
+ if ... | diff --git a/Orange/tests/test_table.py b/Orange/tests/test_table.py
--- a/Orange/tests/test_table.py
+++ b/Orange/tests/test_table.py
@@ -1962,7 +1962,7 @@
# single element
self.assertEqual(_optimize_indices([1], 2), slice(1, 2, 1))
- np.testing.assert_equal(_optimize_indices([1], 1), [1])
+... | null | null | namanjain12/orange3_final:32eec7b570cabbaea58e535665f1176903300969 | true | null | 1 | 7 | null | 891 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.171833 | 80.43425 | ||
9,156 | r2e_gym::train::4790 | r2e_gym | train | 4,790 | numpy__e6227a0326b503172fa9f95e0544a099ec85e05d | numpy | numpy/numpy | python | e6227a0326b503172fa9f95e0544a099ec85e05d | **Title:** `descr_to_dtype` Raises ValueError When Handling Subarrays in Descriptors
**Description:**
When using `descr_to_dtype` with a dtype descriptor that includes subarrays, a `ValueError` is raised due to an invalid shape in the fixed-type tuple.
**Example Code:**
```python
import numpy as np
from numpy.lib imp... | diff --git a/numpy/lib/format.py b/numpy/lib/format.py
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -261,15 +261,19 @@
def descr_to_dtype(descr):
'''
descr may be stored as dtype.descr, which is a list of
- (name, format, [shape]) tuples. Offsets are not explicitly saved, rather
- empty field... | diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -411,6 +411,7 @@
np.array(NbufferT, dtype=np.dtype(Ndescr).newbyteorder('<')),
np.array(PbufferT, dtype=np.dtype(Pdescr).newbyteorder('>')),
np.array(N... | null | null | namanjain12/numpy_final:e6227a0326b503172fa9f95e0544a099ec85e05d | true | null | 1 | 12 | null | 789 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1715 | 80.43325 | ||
9,157 | swe_bench::test::1640 | swe_bench | test | 1,640 | scikit-learn__scikit-learn-14458 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 243d0526ee921babd478d9f95390e29880db3c94 | Need for conversion with SAG
Running the following code snippet will lead to an error:
```python
from sklearn.datasets import fetch_openml
from sklearn.linear_model import Ridge
census = fetch_openml(data_id=534, as_frame=True)
X, y = census.data, census.target
numerical_cols = ['AGE', 'EDUCATION', 'EXPERIENCE']
mode... | We have 2 solutions:
* make `ArrayDataset**` more permissive to accept C and F arrays and internally call `check_array` in `__cninit__`
* make a `check_array` in the `make_dataset` function
What's best?
> make ArrayDataset** more permissive to accept C and F arrays and internally call check_array in __cninit__
... | diff --git a/sklearn/linear_model/base.py b/sklearn/linear_model/base.py
--- a/sklearn/linear_model/base.py
+++ b/sklearn/linear_model/base.py
@@ -91,6 +91,7 @@ def make_dataset(X, y, sample_weight, random_state=None):
seed=seed)
intercept_decay = SPARSE_INTERCEPT_DECAY
else:
+ ... | diff --git a/sklearn/linear_model/tests/test_ridge.py b/sklearn/linear_model/tests/test_ridge.py
--- a/sklearn/linear_model/tests/test_ridge.py
+++ b/sklearn/linear_model/tests/test_ridge.py
@@ -1210,3 +1210,13 @@ def test_ridge_regression_dtype_stability(solver, seed):
assert results[np.float32].dtype == np.float... | ["sklearn/linear_model/tests/test_ridge.py::test_ridge_sag_with_X_fortran"] | ["sklearn/linear_model/tests/test_ridge.py::test_ridge[svd]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[sparse_cg]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[cholesky]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[lsqr]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[sag]", "s... | null | true | 2019-07-24T14:39:51Z | 2 | 3 | 1 | 1,006 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.177667 | 80.433 | |
9,158 | r2e_gym::train::6586 | r2e_gym | train | 6,586 | pillow__ab6efcb925f615d153538e84780f093f7f9f8df2 | pillow | python-pillow/pillow | python | ab6efcb925f615d153538e84780f093f7f9f8df2 | **Title**: Saving Image to stdout Raises "image file is truncated" OSError
**Description**:
When attempting to save an image directly to `stdout`, an `OSError` is encountered, indicating that the image file is truncated. This prevents the image data from being correctly outputted to standard output, which is essential... | diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -483,13 +483,6 @@
# But, it would need at least the image size in most cases. RawEncode is
# a tricky case.
bufsize = max(MAXBLOCK, bufsize, im.size[0] * 4) # see RawEncode.c
- try:
- ... | diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py
--- a/Tests/test_file_ppm.py
+++ b/Tests/test_file_ppm.py
@@ -1,3 +1,6 @@
+import sys
+from io import BytesIO
+
import pytest
from PIL import Image
@@ -80,3 +83,30 @@
f.write("PyCMYK\n128 128\n255")
with Image.open(path) as im:
asse... | null | null | namanjain12/pillow_final:ab6efcb925f615d153538e84780f093f7f9f8df2 | true | null | 1 | 7 | null | 888 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.171333 | 80.43275 | ||
9,159 | r2e_gym::train::5516 | r2e_gym | train | 5,516 | aiohttp__28cb7d707e90fe1d8a1f7dcbf853acc831a6423c | aiohttp | aio-libs/aiohttp | python | 28cb7d707e90fe1d8a1f7dcbf853acc831a6423c | **Title:** Type errors when passing `params` as a dictionary to `content_disposition_header`
**Description:**
When using the `content_disposition_header` function with the `params` argument as a dictionary, it raises errors instead of correctly constructing the header.
**Example Code:**
```python
from aiohttp import ... | diff --git a/CHANGES/8698.breaking.rst b/CHANGES/8698.breaking.rst
--- a/CHANGES/8698.breaking.rst
+++ b/CHANGES/8698.breaking.rst
@@ -0,0 +1 @@
+Changed signature of ``content_disposition_header()`` so ``params`` is now passed as a dict, in order to reduce typing errors -- by :user:`Dreamsorcerer`.
diff --git a/aiohtt... | diff --git a/tests/test_helpers.py b/tests/test_helpers.py
--- a/tests/test_helpers.py
+++ b/tests/test_helpers.py
@@ -493,24 +493,29 @@
@pytest.mark.parametrize(
- "kwargs, result",
+ "params, quote_fields, _charset, expected",
[
- (dict(foo="bar"), 'attachment; foo="bar"'),
- (dict(foo="... | null | null | namanjain12/aiohttp_final:28cb7d707e90fe1d8a1f7dcbf853acc831a6423c | true | null | 3 | 10 | null | 821 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.170167 | 80.42925 | ||
9,160 | r2e_gym::train::4098 | r2e_gym | train | 4,098 | coveragepy__1c653dd10d3b75b9b442981139bc8e796aea148c | coveragepy | nedbat/coveragepy | python | 1c653dd10d3b75b9b442981139bc8e796aea148c | **Title:** `coverage debug` Command Does Not Recognize `premain` Option
**Description:**
When using the `coverage debug` command with the `premain` argument, the tool does not recognize `premain` as a valid option. Instead of displaying the expected pre-main stack information, it prompts the user with a help message a... | diff --git a/coverage/cmdline.py b/coverage/cmdline.py
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -715,7 +715,7 @@
"""Implementation of 'coverage debug'."""
if not args:
- show_help("What information would you like: config, data, sys?")
+ show_help("What information... | diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -248,7 +248,7 @@
""")
def test_debug(self):
- self.cmd_help("debug", "What information would you like: config, data, sys?")
+ self.cmd_help("debug", "What information w... | null | null | namanjain12/coveragepy_final:1c653dd10d3b75b9b442981139bc8e796aea148c | true | null | 2 | 9 | null | 839 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.169833 | 80.42825 | ||
9,161 | r2e_gym::train::4903 | r2e_gym | train | 4,903 | datalad__f60aa45148b4e40a6954871e7d0cfd579721f0c8 | datalad | datalad/datalad | python | f60aa45148b4e40a6954871e7d0cfd579721f0c8 | **Title:** AttributeError: 'UserPassword' object has no attribute 'fname' when deleting credentials
**Description:**
When attempting to delete a composite credential, an `AttributeError` is raised because the `UserPassword` object does not have a `fname` attribute. This prevents the credentials from being properly rem... | diff --git a/datalad/downloaders/credentials.py b/datalad/downloaders/credentials.py
--- a/datalad/downloaders/credentials.py
+++ b/datalad/downloaders/credentials.py
@@ -150,7 +150,7 @@
def delete(self):
"""Deletes credential values from the keyring"""
for f in self._FIELDS:
- self._k... | diff --git a/datalad/downloaders/tests/test_credentials.py b/datalad/downloaders/tests/test_credentials.py
--- a/datalad/downloaders/tests/test_credentials.py
+++ b/datalad/downloaders/tests/test_credentials.py
@@ -15,6 +15,7 @@
from datalad.tests.utils import SkipTest
from datalad.support.keyring_ import MemoryKeyri... | null | null | namanjain12/datalad_final:f60aa45148b4e40a6954871e7d0cfd579721f0c8 | true | null | 1 | 6 | null | 898 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.169667 | 80.42775 | ||
9,162 | r2e_gym::train::5551 | r2e_gym | train | 5,551 | aiohttp__c65a77cfc9d2f6a1550b20ca65e1342188f96f28 | aiohttp | aio-libs/aiohttp | python | c65a77cfc9d2f6a1550b20ca65e1342188f96f28 | **Title:** HTTP Request Parser Fails to Validate Invalid URIs
**Description:**
When parsing HTTP requests with invalid URIs, the parser does not raise an error as expected. For example, sending a request with an invalid URI like `GET ! HTTP/1.1\r\n\r\n` should trigger an `InvalidURLError`. However, the parser currentl... | diff --git a/CHANGES/7712.bugfix b/CHANGES/7712.bugfix
--- a/CHANGES/7712.bugfix
+++ b/CHANGES/7712.bugfix
@@ -0,0 +1 @@
+Add check to validate that absolute URIs have schemes.
diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py
--- a/aiohttp/http_parser.py
+++ b/aiohttp/http_parser.py
@@ -34,6 +34,7 @@
C... | 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
@@ -741,6 +741,11 @@
parser.feed_data(b"GET /test HTTP/1.32\r\n\r\n")
+def test_http_request_parser_bad_uri(parser: Any) -> None:
+ with pytest.raises(http_exceptions.Invali... | null | null | namanjain12/aiohttp_final:c65a77cfc9d2f6a1550b20ca65e1342188f96f28 | true | null | 2 | 8 | null | 857 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1695 | 80.42725 | ||
9,163 | r2e_gym::train::6605 | r2e_gym | train | 6,605 | pillow__63f31ee38017428eb4cd282be37a4b5aaf2ac595 | pillow | python-pillow/pillow | python | 63f31ee38017428eb4cd282be37a4b5aaf2ac595 | **Title:** `quantize()` Method Does Not Accept `dither` Parameter, Causing TypeError
**Description:**
When attempting to use the `dither` parameter with the `quantize()` method, a `TypeError` is raised because the method does not recognize the `dither` keyword argument.
**Example Code:**
```python
from PIL import Ima... | diff --git a/docs/releasenotes/6.0.0.rst b/docs/releasenotes/6.0.0.rst
--- a/docs/releasenotes/6.0.0.rst
+++ b/docs/releasenotes/6.0.0.rst
@@ -107,6 +107,11 @@
Pillow now supports reading and writing the DIB "Device Independent Bitmap" file format.
+Image.quantize
+^^^^^^^^^^^^^^
+
+The `dither` option is now a cu... | diff --git a/Tests/test_image_quantize.py b/Tests/test_image_quantize.py
--- a/Tests/test_image_quantize.py
+++ b/Tests/test_image_quantize.py
@@ -46,3 +46,19 @@
converted = image.quantize()
self.assert_image(converted, 'P', converted.size)
self.assert_image_similar(converted.convert('RGB'), ... | null | null | namanjain12/pillow_final:63f31ee38017428eb4cd282be37a4b5aaf2ac595 | true | null | 2 | 13 | null | 755 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.169167 | 80.42625 | ||
9,164 | r2e_gym::train::4317 | r2e_gym | train | 4,317 | numpy__af95739054cb3707447834861820c4231b1bc5e1 | numpy | numpy/numpy | python | af95739054cb3707447834861820c4231b1bc5e1 | **Title:** `np.dtype(ctypes.c_void_p)` Raises AttributeError Instead of Returning `np.uintp`
**Description:**
When creating a NumPy dtype from `ctypes.c_void_p`, an `AttributeError` is raised instead of returning the expected `np.uintp` dtype. This behavior deviates from the historical functionality where `np.dtype(ct... | diff --git a/numpy/core/_dtype_ctypes.py b/numpy/core/_dtype_ctypes.py
--- a/numpy/core/_dtype_ctypes.py
+++ b/numpy/core/_dtype_ctypes.py
@@ -70,9 +70,9 @@
"""
Return the dtype type with endianness included if it's the case
"""
- if t.__ctype_be__ is t:
+ if getattr(t, '__ctype_be__', None) is t:
... | diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py
--- a/numpy/core/tests/test_dtype.py
+++ b/numpy/core/tests/test_dtype.py
@@ -807,6 +807,9 @@
p_uint8 = ctypes.POINTER(ctypes.c_uint8)
assert_raises(TypeError, np.dtype, p_uint8)
+ def test_void_pointer(self):
+ s... | null | null | namanjain12/numpy_final:af95739054cb3707447834861820c4231b1bc5e1 | true | null | 1 | 6 | null | 894 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.169 | 80.42575 | ||
9,165 | r2e_gym::train::6137 | r2e_gym | train | 6,137 | pillow__e110e093a67070183292067fe302b792154a9f40 | pillow | python-pillow/pillow | python | e110e093a67070183292067fe302b792154a9f40 | **Title:** `alpha_composite` Raises ValueError When Destination Offset Is Negative
**Description:**
Using the `alpha_composite` method with a negative destination offset results in a `ValueError`, preventing the intended image composition.
**Example Code:**
```python
from PIL import Image
src = Image.new("RGBA", (12... | diff --git a/docs/releasenotes/8.2.0.rst b/docs/releasenotes/8.2.0.rst
--- a/docs/releasenotes/8.2.0.rst
+++ b/docs/releasenotes/8.2.0.rst
@@ -12,6 +12,14 @@
API Changes
===========
+
+Image.alpha_composite: dest
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When calling :py:meth:`~PIL.Image.Image.alpha_composite`, the ``dest`` ... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -344,6 +344,12 @@
assert_image_equal(offset.crop((64, 64, 127, 127)), target.crop((0, 0, 63, 63)))
assert offset.size == (128, 128)
+ # with negative offset
+ offset = src.copy... | null | null | namanjain12/pillow_final:e110e093a67070183292067fe302b792154a9f40 | true | null | 2 | 10 | null | 806 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.167667 | 80.42175 | ||
9,166 | swe_bench::test::1760 | swe_bench | test | 1,760 | sphinx-doc__sphinx-11544 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | 89808c6f49e1738765d18309244dca0156ee28f6 | linkcheck failing after Sphinx 7.1.0 release
### Describe the bug
Starting with `Sphinx 7.1.0`, my package(s) started reporting `linkcheck` failures due to "Anchor not found", e.g., https://github.com/astropy/photutils/actions/runs/5688763395/job/15419142358.
Reverting to Sphinx 7.0.1 fixes the issue.
`git bisect` r... | cc: @pllim
I wouldn't have suspected Sphinx itself. Thanks for investigating!
@larrybradley @pllim @adamtheturtle thanks for reporting this (both here and in #11532). The [regression](https://github.com/sphinx-doc/sphinx/pull/11432#discussion_r1279598982) was indeed introduced in #11432.
I'm working on fix for this... | diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -406,7 +406,8 @@ def _check_uri(self, uri: str, hyperlink: Hyperlink) -> tuple[str, str, int]:
_user_agent=self.user_agent,
_tls_inf... | 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
@@ -152,6 +152,7 @@ def test_defaults(app):
}
# looking for '#top' and '#does-not-exist' not found should fail
assert rowsby["http://localhost:7777/#top"]["in... | ["tests/test_build_linkcheck.py::test_too_many_requests_retry_after_HTTP_date"] | ["tests/test_build_linkcheck.py::test_defaults", "tests/test_build_linkcheck.py::test_check_link_response_only", "tests/test_build_linkcheck.py::test_too_many_retries", "tests/test_build_linkcheck.py::test_raw_node", "tests/test_build_linkcheck.py::test_anchors_ignored", "tests/test_build_linkcheck.py::test_anchors_ign... | null | true | 2023-07-31T22:21:47Z | 1 | 3 | 1 | 983 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.173833 | 80.4215 | |
9,167 | r2e_gym::train::4167 | r2e_gym | train | 4,167 | numpy__83c6d769e00e5ee424221244d9d2be474c1fe532 | numpy | numpy/numpy | python | 83c6d769e00e5ee424221244d9d2be474c1fe532 | **Title:** `meshgrid` Ignores Unexpected Keyword Arguments Instead of Raising an Error
**Description:**
When using the `meshgrid` function with an unknown keyword argument, it silently ignores the argument instead of raising an appropriate error. This behavior can lead to unexpected results and make debugging more dif... | 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
@@ -3370,9 +3370,13 @@
"""
ndim = len(xi)
- copy_ = kwargs.get('copy', True)
- sparse = kwargs.get('sparse', False)
- indexing = kwargs.get('indexing', 'xy')
+ c... | 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
@@ -1454,6 +1454,13 @@
assert_array_equal(X, np.array([[1, 2, 3]]))
assert_array_equal(Y, np.array([[4], [5], [6], [7]]))
... | null | null | namanjain12/numpy_final:83c6d769e00e5ee424221244d9d2be474c1fe532 | true | null | 1 | 10 | null | 805 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1675 | 80.42125 | ||
9,168 | r2e_gym::train::380 | r2e_gym | train | 380 | orange3__60a2f61c55b32af5f072c14d6826ba1cc3952497 | orange3 | biolab/orange3 | python | 60a2f61c55b32af5f072c14d6826ba1cc3952497 | **Title:** Setting `penalty` to `None` in Logistic Regression Triggers ValueError
**Description:**
When attempting to configure the Logistic Regression model without regularization by setting the `penalty` argument to `None`, an error is raised. This prevents users from disabling regularization as intended.
**Example... | diff --git a/Orange/widgets/model/owlogisticregression.py b/Orange/widgets/model/owlogisticregression.py
--- a/Orange/widgets/model/owlogisticregression.py
+++ b/Orange/widgets/model/owlogisticregression.py
@@ -49,7 +49,7 @@
max_iter = 10000
penalty_types = ("Lasso (L1)", "Ridge (L2)", "None")
- penalty_... | diff --git a/Orange/widgets/model/tests/test_owlogisticregression.py b/Orange/widgets/model/tests/test_owlogisticregression.py
--- a/Orange/widgets/model/tests/test_owlogisticregression.py
+++ b/Orange/widgets/model/tests/test_owlogisticregression.py
@@ -125,10 +125,10 @@
self.assertTrue(self.widget.Warning.cl... | null | null | namanjain12/orange3_final:60a2f61c55b32af5f072c14d6826ba1cc3952497 | true | null | 1 | 6 | null | 884 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.167333 | 80.42075 | ||
9,169 | r2e_gym::train::5826 | r2e_gym | train | 5,826 | tornado__d8d5f588dd034ea262fdd8e6098e3ae20c805837 | tornado | tornadoweb/tornado | python | d8d5f588dd034ea262fdd8e6098e3ae20c805837 | **Title:** Unrecognized `{% whitespace %}` Directive Causes Parse Error
**Description**
When using the `{% whitespace %}` directive in a Tornado template, a parse error is raised, preventing the template from being processed correctly.
**Example Code:**
```python
template_content = """{% whitespace oneline %}
{% ... | diff --git a/tornado/template.py b/tornado/template.py
--- a/tornado/template.py
+++ b/tornado/template.py
@@ -186,6 +186,11 @@
``{% while *condition* %}... {% end %}``
Same as the python ``while`` statement. ``{% break %}`` and
``{% continue %}`` may be used inside the loop.
+
+``{% whitespace *mode* %}``
... | diff --git a/tornado/test/template_test.py b/tornado/test/template_test.py
--- a/tornado/test/template_test.py
+++ b/tornado/test/template_test.py
@@ -457,6 +457,19 @@
self.assertEqual(loader.load("foo.html").generate(), b" foo ")
self.assertEqual(loader.load("bar.txt").generate(), b" bar ")
+ de... | null | null | namanjain12/tornado_final:d8d5f588dd034ea262fdd8e6098e3ae20c805837 | true | null | 1 | 14 | null | 724 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.167333 | 80.42075 | ||
9,170 | swe_bench::dev::45 | swe_bench | dev | 45 | pvlib__pvlib-python-1480 | pvlib/pvlib-python | pvlib/pvlib-python | python | 35af84e9a7bede8dfe86d6d6c73002393544ab5a | Consider extracting the surface orientation calculation in pvlib.tracking.singleaxis() to its own function
**Is your feature request related to a problem? Please describe.**
The usual workflow for modeling single-axis tracking in pvlib is to treat tracker rotation (`tracker_theta`) as an unknown to be calculated from s... | I like this.
This is related to an issue submitted for NREL SAM, https://github.com/NREL/SAM/issues/850, and I think @mjprilliman is looking at something related.
@kanderso-nrel Nice meeting you at PVSC the other day. I've been working on this a bit using the tilt and azimuth equations in the technical report by ... | diff --git a/pvlib/tools.py b/pvlib/tools.py
--- a/pvlib/tools.py
+++ b/pvlib/tools.py
@@ -85,6 +85,25 @@ def asind(number):
return res
+def acosd(number):
+ """
+ Inverse Cosine returning an angle in degrees
+
+ Parameters
+ ----------
+ number : float
+ Input number
+
+ Returns
+ ... | diff --git a/pvlib/tests/test_tracking.py b/pvlib/tests/test_tracking.py
--- a/pvlib/tests/test_tracking.py
+++ b/pvlib/tests/test_tracking.py
@@ -517,3 +517,72 @@ def test_singleaxis_aoi_gh1221():
fixed = pvlib.irradiance.aoi(90, 180, sp['apparent_zenith'], sp['azimuth'])
fixed[np.isnan(tr['aoi'])] = np.nan
... | ["pvlib/tests/test_tracking.py::test_calc_surface_orientation_types", "pvlib/tests/test_tracking.py::test_calc_surface_orientation_kwargs", "pvlib/tests/test_tracking.py::test_calc_surface_orientation_special"] | ["pvlib/tests/test_tracking.py::test_solar_noon", "pvlib/tests/test_tracking.py::test_scalars", "pvlib/tests/test_tracking.py::test_arrays", "pvlib/tests/test_tracking.py::test_nans", "pvlib/tests/test_tracking.py::test_arrays_multi", "pvlib/tests/test_tracking.py::test_azimuth_north_south", "pvlib/tests/test_tracking.... | null | true | 2022-06-22T01:59:14Z | 2 | 166 | 3 | 2,651 | 0.020833 | 0.8 | 1 | 0.7 | 0.75 | 0.941833 | 80.419276 | |
9,171 | r2e_gym::train::5048 | r2e_gym | train | 5,048 | datalad__37fa322dc319003a7c78826c08b972f283810034 | datalad | datalad/datalad | python | 37fa322dc319003a7c78826c08b972f283810034 | **Title:** Logger Fails with TypeError When Path Contains `%` Character
**Description:**
When a path containing the `%` character is passed to the logger, it causes string interpolation to fail. This results in a `TypeError` due to incorrect formatting of the log message.
**Example Code:**
```python
def example():
... | diff --git a/datalad/interface/utils.py b/datalad/interface/utils.py
--- a/datalad/interface/utils.py
+++ b/datalad/interface/utils.py
@@ -579,8 +579,12 @@
msgargs = msg[1:]
msg = msg[0]
if 'path' in res:
+ path = res['path']
+ if msgargs:
+ ... | diff --git a/datalad/interface/tests/test_utils.py b/datalad/interface/tests/test_utils.py
--- a/datalad/interface/tests/test_utils.py
+++ b/datalad/interface/tests/test_utils.py
@@ -465,17 +465,27 @@
class TestUtils2(Interface):
# result_renderer = custom_renderer
- _params_ = dict()
+ _params_ = dict(
+... | null | null | namanjain12/datalad_final:37fa322dc319003a7c78826c08b972f283810034 | true | null | 1 | 6 | null | 881 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.166833 | 80.41925 | ||
9,172 | r2e_gym::train::6522 | r2e_gym | train | 6,522 | pillow__95e9379f45533290edd66242c1213e9649845f82 | pillow | python-pillow/pillow | python | 95e9379f45533290edd66242c1213e9649845f82 | **Title:** `Image` objects lack `_repr_png_` method, causing AttributeError in iPython
**Description:**
When attempting to use the `_repr_png_` method on a `PIL.Image.Image` object for iPython display hooks, an `AttributeError` is raised because the method does not exist.
**Example Code:**
```python
from PIL import I... | 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 byt... | 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:95e9379f45533290edd66242c1213e9649845f82 | true | null | 1 | 10 | null | 795 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.165833 | 80.41625 | ||
9,173 | r2e_gym::train::6407 | r2e_gym | train | 6,407 | pillow__3aa93265745a872509950e005db72c5332a09805 | pillow | python-pillow/pillow | python | 3aa93265745a872509950e005db72c5332a09805 | **Title:** Saving 'L' Mode GIF with `optimize=True` Raises `SystemError: unknown raw mode`
**Description:**
When attempting to save a grayscale ('L' mode) image as a GIF with optimization enabled, the operation fails and raises a `SystemError`.
**Example Code:**
```python
from PIL import Image
from io import BytesIO
... | diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py
--- a/PIL/GifImagePlugin.py
+++ b/PIL/GifImagePlugin.py
@@ -268,10 +268,9 @@
except IOError:
pass # write uncompressed file
- try:
- rawmode = RAWMODE[im.mode]
+ if im.mode in RAWMODE:
imOut = im
- except KeyErro... | diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py
--- a/Tests/test_file_gif.py
+++ b/Tests/test_file_gif.py
@@ -34,6 +34,14 @@
return len(file.getvalue())
self.assertEqual(test(0), 800)
self.assertEqual(test(1), 38)
+
+ def test_optimize_full_l(self):
+ from io import... | null | null | namanjain12/pillow_final:3aa93265745a872509950e005db72c5332a09805 | true | null | 1 | 15 | null | 692 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.165333 | 80.41475 | ||
9,174 | r2e_gym::train::5086 | r2e_gym | train | 5,086 | pyramid__eac06005ac849b279b94149bbbf87d2aff802495 | pyramid | pylons/pyramid | python | eac06005ac849b279b94149bbbf87d2aff802495 | **Title:** Passing `quiet` Argument to `pserve.main` Causes TypeError
**Description:**
When attempting to run the server with the `quiet` option, a `TypeError` is raised because the `main` function does not accept the `quiet` keyword argument.
**Example Buggy Code:**
```python
from pyramid.scripts.pserve import main
... | diff --git a/pyramid/scripts/pserve.py b/pyramid/scripts/pserve.py
--- a/pyramid/scripts/pserve.py
+++ b/pyramid/scripts/pserve.py
@@ -45,8 +45,8 @@
else:
kill = os.kill
-def main(argv=sys.argv):
- command = PServeCommand(argv)
+def main(argv=sys.argv, quiet=False):
+ command = PServeCommand(argv, quiet=q... | diff --git a/pyramid/tests/test_scripts/test_pserve.py b/pyramid/tests/test_scripts/test_pserve.py
--- a/pyramid/tests/test_scripts/test_pserve.py
+++ b/pyramid/tests/test_scripts/test_pserve.py
@@ -259,7 +259,7 @@
class Test_main(unittest.TestCase):
def _callFUT(self, argv):
from pyramid.scripts.pserve ... | null | null | namanjain12/pyramid_final:eac06005ac849b279b94149bbbf87d2aff802495 | true | null | 1 | 11 | null | 771 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.165167 | 80.41425 | ||
9,175 | r2e_gym::train::5980 | r2e_gym | train | 5,980 | tornado__34edd2e8020b42cd16c3dc9a8c0417b9fae1e6d4 | tornado | tornadoweb/tornado | python | 34edd2e8020b42cd16c3dc9a8c0417b9fae1e6d4 | **Title:** Yielding a List of Futures in `@gen.engine` Causes AssertionError
**Description:**
When yielding a list of `Future` objects within a function decorated with `@gen.engine`, an `AssertionError` is raised because the engine expects all yielded items to be instances of `YieldPoint`.
**Example Code:**
```python... | diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -276,8 +276,12 @@
a list of ``YieldPoints``.
"""
def __init__(self, children):
- assert all(isinstance(i, YieldPoint) for i in children)
- self.children = children
+ self.children = []
+ ... | diff --git a/tornado/test/gen_test.py b/tornado/test/gen_test.py
--- a/tornado/test/gen_test.py
+++ b/tornado/test/gen_test.py
@@ -1,12 +1,15 @@
from __future__ import absolute_import, division, print_function, with_statement
+
import functools
+from tornado.concurrent import return_future
from tornado.escape import... | null | null | namanjain12/tornado_final:34edd2e8020b42cd16c3dc9a8c0417b9fae1e6d4 | true | null | 1 | 11 | null | 761 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1635 | 80.40925 | ||
9,176 | r2e_gym::train::5569 | r2e_gym | train | 5,569 | scrapy__e938752973b4fc53e0fa0c0bc68a431613b987e4 | scrapy | scrapy/scrapy | python | e938752973b4fc53e0fa0c0bc68a431613b987e4 | **Title:** Keys Remain as Strings When Exporting Items in Binary Mode
**Description:**
When exporting items using `PythonItemExporter` with `binary=True`, the exported item's keys are not converted to bytes. This leads to inconsistencies where the values are in binary format, but the keys remain as strings.
**Example... | diff --git a/scrapy/exporters.py b/scrapy/exporters.py
--- a/scrapy/exporters.py
+++ b/scrapy/exporters.py
@@ -272,7 +272,11 @@
def _serialize_dict(self, value):
for key, val in six.iteritems(value):
+ key = to_bytes(key) if self.binary else key
yield key, self._serialize_value(v... | diff --git a/tests/test_exporters.py b/tests/test_exporters.py
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -2,6 +2,7 @@
import re
import json
import unittest
+import warnings
from io import BytesIO
from six.moves import cPickle as pickle
@@ -114,6 +115,12 @@
self.assertEqual(exported,... | null | null | namanjain12/scrapy_final:e938752973b4fc53e0fa0c0bc68a431613b987e4 | true | null | 1 | 6 | null | 858 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.163 | 80.40775 | ||
9,177 | swe_bench::dev::133 | swe_bench | dev | 133 | pylint-dev__astroid-1268 | pylint-dev/astroid | pylint-dev/astroid | python | ce5cbce5ba11cdc2f8139ade66feea1e181a7944 | 'AsStringVisitor' object has no attribute 'visit_unknown'
```python
>>> import astroid
>>> astroid.nodes.Unknown().as_string()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/tusharsadhwani/code/marvin-python/venv/lib/python3.9/site-packages/astroid/nodes/node_ng.py", line 609, i... | Thank you for opening the issue.
I don't believe `Unknown().as_string()` is ever called regularly. AFAIK it's only used during inference. What should the string representation of an `Unknown` node be? So not sure this needs to be addressed.
Probably just `'Unknown'`.
It's mostly only a problem when we do something like... | diff --git a/astroid/nodes/as_string.py b/astroid/nodes/as_string.py
--- a/astroid/nodes/as_string.py
+++ b/astroid/nodes/as_string.py
@@ -36,6 +36,7 @@
MatchSingleton,
MatchStar,
MatchValue,
+ Unknown,
)
# pylint: disable=unused-argument
@@ -643,6 +644,9 @@ def visit_property(... | diff --git a/tests/unittest_nodes.py b/tests/unittest_nodes.py
--- a/tests/unittest_nodes.py
+++ b/tests/unittest_nodes.py
@@ -306,6 +306,11 @@ def test_f_strings(self):
ast = abuilder.string_build(code)
self.assertEqual(ast.as_string().strip(), code.strip())
+ @staticmethod
+ def test_as_stri... | ["tests/unittest_nodes.py::AsStringTest::test_as_string_unknown"] | ["tests/unittest_nodes.py::AsStringTest::test_3k_annotations_and_metaclass", "tests/unittest_nodes.py::AsStringTest::test_3k_as_string", "tests/unittest_nodes.py::AsStringTest::test_as_string", "tests/unittest_nodes.py::AsStringTest::test_as_string_for_list_containing_uninferable", "tests/unittest_nodes.py::AsStringTes... | null | true | 2021-11-21T16:15:23Z | 1 | 4 | 1 | 934 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.169 | 80.407 | |
9,178 | r2e_gym::train::5245 | r2e_gym | train | 5,245 | pyramid__13b3034d5f180fb34706871ec74ddf841c34992d | pyramid | pylons/pyramid | python | 13b3034d5f180fb34706871ec74ddf841c34992d | **Title:** `aslist` Method Raises AttributeError When Non-String Objects Are Passed
**Description**
When passing a non-string object, such as an integer, to the `aslist` method, it raises an `AttributeError` because it attempts to call the `.split()` method on the object.
**Example Code**
```python
from pyramid.setti... | diff --git a/src/pyramid/settings.py b/src/pyramid/settings.py
--- a/src/pyramid/settings.py
+++ b/src/pyramid/settings.py
@@ -21,14 +21,17 @@
def aslist(value, flatten=True):
- """ Return a list of strings, separating the input based on newlines
+ """ Return a list. Separating the input based on newlines
... | diff --git a/tests/test_settings.py b/tests/test_settings.py
--- a/tests/test_settings.py
+++ b/tests/test_settings.py
@@ -69,6 +69,14 @@
result = self._callFUT(['abc', 'def'])
self.assertEqual(list(result), ['abc', 'def'])
+ def test_with_integer(self):
+ result = self._callFUT([1])
+ ... | null | null | namanjain12/pyramid_final:13b3034d5f180fb34706871ec74ddf841c34992d | true | null | 1 | 11 | null | 756 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.162667 | 80.40675 | ||
9,179 | r2e_gym::train::5395 | r2e_gym | train | 5,395 | aiohttp__60313571defa8d66e3a6d4bc0be1fa78b475652f | aiohttp | aio-libs/aiohttp | python | 60313571defa8d66e3a6d4bc0be1fa78b475652f | **Title:** WebSocketWriter Initialization Fails with Unexpected 'use_mask' Argument
**Description:**
When attempting to create an instance of `WebSocketWriter` with the `use_mask` keyword argument, a `TypeError` is raised because the constructor does not recognize this parameter. This prevents proper masking of WebSoc... | diff --git a/aiohttp/websocket.py b/aiohttp/websocket.py
--- a/aiohttp/websocket.py
+++ b/aiohttp/websocket.py
@@ -179,16 +179,16 @@
class WebSocketWriter:
- def __init__(self, writer, *, mask=True, random=random.Random()):
+ def __init__(self, writer, *, use_mask=False, random=random.Random()):
sel... | diff --git a/tests/test_websocket.py b/tests/test_websocket.py
--- a/tests/test_websocket.py
+++ b/tests/test_websocket.py
@@ -311,7 +311,7 @@
def setUp(self):
self.transport = unittest.mock.Mock()
- self.writer = websocket.WebSocketWriter(self.transport, mask=False)
+ self.writer = websoc... | null | null | namanjain12/aiohttp_final:60313571defa8d66e3a6d4bc0be1fa78b475652f | true | null | 2 | 8 | null | 809 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1615 | 80.40325 | ||
9,180 | swe_bench::dev::2 | swe_bench | dev | 2 | marshmallow-code__marshmallow-1252 | marshmallow-code/marshmallow | marshmallow-code/marshmallow | python | b063a103ae5222a5953cd7453a1eb0d161dc5b52 | ISO8601 DateTimes ending with Z considered not valid in 2.19.4
Probably related to #1247 and #1234 - in marshmallow `2.19.4`, with `python-dateutil` _not_ installed, it seems that loading a datetime in ISO8601 that ends in `Z` (UTC time) results in an error:
```python
class Foo(Schema):
date = DateTime(required=Tr... | @lafrech Would you mind looking into this?
Thanks for reporting.
This is definitely a side effect of https://github.com/marshmallow-code/marshmallow/pull/1249/files. Sorry about that.
I don't own a copy of the spec, so the work on this is based on examples... I assumed that microseconds always came as a six-pack.... | diff --git a/src/marshmallow/utils.py b/src/marshmallow/utils.py
--- a/src/marshmallow/utils.py
+++ b/src/marshmallow/utils.py
@@ -285,6 +285,9 @@ def from_iso(datestring, use_dateutil=True):
# Strip off timezone info.
if '.' in datestring:
# datestring contains microseconds
+ ... | diff --git a/tests/test_utils.py b/tests/test_utils.py
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -200,6 +200,15 @@ def test_from_iso_datetime(use_dateutil, timezone):
assert type(result) == dt.datetime
assert_datetime_equal(result, d)
+ # Test with 3-digit only microseconds
+ # Regression... | ["tests/test_utils.py::test_from_iso_datetime[timezone1-False]"] | ["tests/test_utils.py::test_missing_singleton_copy", "tests/test_utils.py::test_to_marshallable_type", "tests/test_utils.py::test_to_marshallable_type_none", "tests/test_utils.py::test_to_marshallable_type_with_namedtuple", "tests/test_utils.py::test_get_value_from_object[obj0]", "tests/test_utils.py::test_get_value_fr... | null | true | 2019-06-17T13:44:50Z | 1 | 3 | 1 | 941 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.166833 | 80.4005 | |
9,181 | r2e_gym::train::6473 | r2e_gym | train | 6,473 | pillow__3d82672404730656bfc5c1eeb59743841bbbdcaf | pillow | python-pillow/pillow | python | 3d82672404730656bfc5c1eeb59743841bbbdcaf | **Title:** Unsupported 'hsb' Color Specifier in `ImageColor.getrgb`
**Description:**
When attempting to use the `'hsb(...)'` color string with the `ImageColor.getrgb` function, a `ValueError` is raised indicating that the color specifier is unknown. This prevents the use of HSB color specifications alongside the exist... | diff --git a/docs/reference/ImageColor.rst b/docs/reference/ImageColor.rst
--- a/docs/reference/ImageColor.rst
+++ b/docs/reference/ImageColor.rst
@@ -34,7 +34,9 @@
* Hue-Saturation-Value (HSV) functions, given as ``hsv(hue, saturation%,
value%)`` where hue and saturation are the same as HSL, and value is between
... | diff --git a/Tests/test_imagecolor.py b/Tests/test_imagecolor.py
--- a/Tests/test_imagecolor.py
+++ b/Tests/test_imagecolor.py
@@ -82,6 +82,10 @@
self.assertEqual((255, 0, 0), ImageColor.getrgb("hsv(360,100%,100%)"))
self.assertEqual((0, 255, 255), ImageColor.getrgb("hsv(180,100%,100%)"))
+ #... | null | null | namanjain12/pillow_final:3d82672404730656bfc5c1eeb59743841bbbdcaf | true | null | 2 | 6 | null | 842 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.160333 | 80.39975 | ||
9,182 | r2e_gym::train::4855 | r2e_gym | train | 4,855 | numpy__ca5658bb0e63030011d8a0f30815b34f4dc6dc8a | numpy | numpy/numpy | python | ca5658bb0e63030011d8a0f30815b34f4dc6dc8a | **Title:** `np.rec.fromarrays` Raises ValueError When Input Includes Structured Arrays
**Description:**
When attempting to create a record array using `np.rec.fromarrays` with one of the input arrays already being a structured array, a `ValueError` is raised. This issue arises specifically when constructing nested str... | diff --git a/numpy/core/records.py b/numpy/core/records.py
--- a/numpy/core/records.py
+++ b/numpy/core/records.py
@@ -610,9 +610,7 @@
# and determine the formats.
formats = []
for obj in arrayList:
- if not isinstance(obj, ndarray):
- raise ValueError("item in the a... | diff --git a/numpy/core/tests/test_records.py b/numpy/core/tests/test_records.py
--- a/numpy/core/tests/test_records.py
+++ b/numpy/core/tests/test_records.py
@@ -437,6 +437,13 @@
arr = np.zeros((3,), dtype=[('x', int), ('y', int)])
assert_raises(ValueError, lambda: arr[['nofield']])
+ def test_f... | null | null | namanjain12/numpy_final:ca5658bb0e63030011d8a0f30815b34f4dc6dc8a | true | null | 1 | 6 | null | 841 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.160167 | 80.39925 | ||
9,183 | r2e_gym::train::4339 | r2e_gym | train | 4,339 | numpy__c01165f43068fea96722c172eb23efed4ca99763 | numpy | numpy/numpy | python | c01165f43068fea96722c172eb23efed4ca99763 | **Title:** ValueError Raised When Using `np.ix_` with Non-Empty ndarrays
**Description:**
When using `np.ix_` with non-empty ndarray inputs, a `ValueError` is unexpectedly raised. This occurs when constructing open mesh index arrays with multiple non-empty sequences.
**Example Code:**
```python
import numpy as np
si... | diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -72,10 +72,12 @@
out = []
nd = len(args)
for k, new in enumerate(args):
- # Explicitly type empty sequences to avoid float default
- new = asarray(new, dtype... | diff --git a/numpy/lib/tests/test_index_tricks.py b/numpy/lib/tests/test_index_tricks.py
--- a/numpy/lib/tests/test_index_tricks.py
+++ b/numpy/lib/tests/test_index_tricks.py
@@ -171,17 +171,21 @@
class TestIx_(TestCase):
def test_regression_1(self):
- # Empty inputs create ouputs of indexing type, gh-58... | null | null | namanjain12/numpy_final:c01165f43068fea96722c172eb23efed4ca99763 | true | null | 1 | 8 | null | 801 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.160167 | 80.39925 | ||
9,184 | r2e_gym::train::6301 | r2e_gym | train | 6,301 | pillow__620d08245792449bcb1ddc988dc14d4079f333d5 | pillow | python-pillow/pillow | python | 620d08245792449bcb1ddc988dc14d4079f333d5 | ### Incorrect Scaling in JPEG Image Drafting Causes Size Mismatch and Loading Errors
**Description:**
When drafting JPEG images with minimal scaling, the resulting image sizes do not match the expected dimensions. Additionally, attempting to load the drafted image results in a broken data stream error.
**Example Code... | diff --git a/PIL/JpegImagePlugin.py b/PIL/JpegImagePlugin.py
--- a/PIL/JpegImagePlugin.py
+++ b/PIL/JpegImagePlugin.py
@@ -341,6 +341,10 @@
if len(self.tile) != 1:
return
+ # Protect from second call
+ if self.decoderconfig:
+ return
+
d, e, o, a = self.tile[0]
... | diff --git a/Tests/test_image_draft.py b/Tests/test_image_draft.py
--- a/Tests/test_image_draft.py
+++ b/Tests/test_image_draft.py
@@ -2,36 +2,73 @@
from PIL import Image
-CODECS = dir(Image.core)
-FILENAME = "Tests/images/hopper.jpg"
-DATA = tostring(Image.open(FILENAME).resize((512, 512)), "JPEG")
-
-
-def draft... | null | null | namanjain12/pillow_final:620d08245792449bcb1ddc988dc14d4079f333d5 | true | null | 1 | 6 | null | 839 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.159833 | 80.39825 | ||
9,185 | r2e_gym::train::4363 | r2e_gym | train | 4,363 | numpy__d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 | numpy | numpy/numpy | python | d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 | **Title:** Broadcasting Object Arrays Raises TypeError Due to Missing REFS_OK Flag
**Description:**
When attempting to broadcast an array with `dtype=object` to a larger shape, a `TypeError` is raised. This prevents the expected behavior of creating a broadcasted view of the original array.
**Example Code:**
```pytho... | diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py
--- a/numpy/lib/stride_tricks.py
+++ b/numpy/lib/stride_tricks.py
@@ -60,9 +60,9 @@
if any(size < 0 for size in shape):
raise ValueError('all elements of broadcast shape must be non-'
'negative')
- broadcast ... | diff --git a/numpy/lib/tests/test_stride_tricks.py b/numpy/lib/tests/test_stride_tricks.py
--- a/numpy/lib/tests/test_stride_tricks.py
+++ b/numpy/lib/tests/test_stride_tricks.py
@@ -364,5 +364,15 @@
assert_equal(result.flags.writeable, False)
+def test_reference_types():
+ input_array = np.array('a', dtype... | null | null | namanjain12/numpy_final:d5a67b5b421c12cc46d9bcd07ddc4b91c1e5fef3 | true | null | 1 | 6 | null | 837 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1595 | 80.39725 | ||
9,186 | r2e_gym::train::448 | r2e_gym | train | 448 | orange3__77af97d1c5c024935f42cc606d2ccb4f9fa06193 | orange3 | biolab/orange3 | python | 77af97d1c5c024935f42cc606d2ccb4f9fa06193 | **Title:** ValueError When Setting `comparison_criterion` to an Integer
**Description:**
When initializing the `OWTestLearners` widget, setting the `comparison_criterion` attribute to an integer causes the combo box to fail in finding the corresponding item. This results in a `ValueError` indicating that the combo box... | diff --git a/Orange/widgets/evaluate/owtestlearners.py b/Orange/widgets/evaluate/owtestlearners.py
--- a/Orange/widgets/evaluate/owtestlearners.py
+++ b/Orange/widgets/evaluate/owtestlearners.py
@@ -39,7 +39,6 @@
from Orange.widgets.utils.widgetpreview import WidgetPreview
from Orange.widgets.utils.concurrent import ... | diff --git a/Orange/widgets/evaluate/tests/test_owtestlearners.py b/Orange/widgets/evaluate/tests/test_owtestlearners.py
--- a/Orange/widgets/evaluate/tests/test_owtestlearners.py
+++ b/Orange/widgets/evaluate/tests/test_owtestlearners.py
@@ -403,7 +403,7 @@
w = self.widget
control = w.controls.compar... | null | null | namanjain12/orange3_final:77af97d1c5c024935f42cc606d2ccb4f9fa06193 | true | null | 1 | 13 | null | 697 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1595 | 80.39725 | ||
9,187 | r2e_gym::train::4803 | r2e_gym | train | 4,803 | numpy__feee90d9e14490daa2439eb37c8511555d073f92 | numpy | numpy/numpy | python | feee90d9e14490daa2439eb37c8511555d073f92 | **Title:** `set_printoptions` Raises `ValueError` for Non-Numeric `threshold` Instead of `TypeError`
**Description:**
When setting the `threshold` parameter in `numpy.set_printoptions` to a non-numeric type, a `ValueError` is raised instead of the expected `TypeError`. This makes it unclear whether the issue is relate... | diff --git a/changelog/13899.changes.rst b/changelog/13899.changes.rst
--- a/changelog/13899.changes.rst
+++ b/changelog/13899.changes.rst
@@ -0,0 +1,4 @@
+Incorrect ``threshold`` in ``np.set_printoptions`` raises ``TypeError`` or ``ValueError``
+-------------------------------------------------------------------------... | 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
@@ -847,9 +847,9 @@
)
def test_bad_args(self):
- assert_raises(ValueError, np.set_printoptions, threshold='nan')
- asse... | null | null | namanjain12/numpy_final:feee90d9e14490daa2439eb37c8511555d073f92 | true | null | 2 | 10 | null | 757 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1595 | 80.39725 | ||
9,188 | r2e_gym::train::4998 | r2e_gym | train | 4,998 | datalad__8a300d306e3040eb34ce0e973be526f210df1863 | datalad | datalad/datalad | python | 8a300d306e3040eb34ce0e973be526f210df1863 | **Title:** Function Raises ValueError When Percentage Data Is Missing
**Description:**
When attempting to calculate the full size based on the reported percentage completion, the function crashes if the percentage information is missing or empty. This occurs because the function tries to convert an empty string to a f... | 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:8a300d306e3040eb34ce0e973be526f210df1863 | true | null | 1 | 10 | null | 756 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.159333 | 80.39675 | ||
9,189 | r2e_gym::train::103 | r2e_gym | train | 103 | orange3__40396e392f184aa9e70348039f43cfb852d701f6 | orange3 | biolab/orange3 | python | 40396e392f184aa9e70348039f43cfb852d701f6 | **Title:** DBSCAN Assigns Excessive Cluster Labels with eps=1
**Description:**
When using DBSCAN with an epsilon value of 1, the clustering process incorrectly assigns a unique cluster label to each data point instead of grouping them into the expected number of clusters.
**Example:**
```python
def test_dbscan_values... | diff --git a/Orange/clustering/dbscan.py b/Orange/clustering/dbscan.py
--- a/Orange/clustering/dbscan.py
+++ b/Orange/clustering/dbscan.py
@@ -1,5 +1,5 @@
import sklearn.cluster as skl_cluster
-from numpy import ndarray
+from numpy import ndarray, unique
from Orange.data import Table, DiscreteVariable, Domain, Inst... | diff --git a/Orange/tests/test_clustering_dbscan.py b/Orange/tests/test_clustering_dbscan.py
--- a/Orange/tests/test_clustering_dbscan.py
+++ b/Orange/tests/test_clustering_dbscan.py
@@ -29,3 +29,19 @@
c = dbscan(self.iris)
X = self.iris.X[::20]
p = c(X)
+
+ def test_values(self):
+ ... | null | null | namanjain12/orange3_final:40396e392f184aa9e70348039f43cfb852d701f6 | true | null | 1 | 6 | null | 832 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.158667 | 80.39475 | ||
9,190 | r2e_gym::train::4770 | r2e_gym | train | 4,770 | numpy__1273caf16cda1bfce8c1686876162c206bcf9867 | numpy | numpy/numpy | python | 1273caf16cda1bfce8c1686876162c206bcf9867 | **Title:** `hstack` Raises `IndexError` When Given Empty Input Instead of `ValueError`
**Description:**
When attempting to horizontally stack an empty sequence of arrays using `numpy.hstack`, an `IndexError` is raised. According to the function's documentation, providing an empty input should result in a `ValueError` ... | diff --git a/doc/release/1.13.0-notes.rst b/doc/release/1.13.0-notes.rst
--- a/doc/release/1.13.0-notes.rst
+++ b/doc/release/1.13.0-notes.rst
@@ -28,6 +28,12 @@
Compatibility notes
===================
+
+
+Error type changes
+~~~~~~~~~~~~~~~~~~
+
+``numpy.hstack()`` now throws ValueError instead of IndexError when... | diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py
--- a/numpy/core/tests/test_shape_base.py
+++ b/numpy/core/tests/test_shape_base.py
@@ -123,6 +123,9 @@
def test_non_iterable(self):
assert_raises(TypeError, hstack, 1)
+ def test_empty_input(self):
+ assert... | null | null | namanjain12/numpy_final:1273caf16cda1bfce8c1686876162c206bcf9867 | true | null | 2 | 8 | null | 792 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.158667 | 80.39475 | ||
9,191 | r2e_gym::train::5607 | r2e_gym | train | 5,607 | scrapy__9aec7856b009f0732fa82ae80dd0cc7ef3931fa1 | scrapy | scrapy/scrapy | python | 9aec7856b009f0732fa82ae80dd0cc7ef3931fa1 | **Title:** AttributeError When Handling Forms with Unsupported HTTP Methods
**Description:**
When using `FormRequest.from_response` to process a form that specifies an unsupported HTTP method, an `AttributeError` is raised because the `FormRequest` class does not recognize the method.
**Example Code:**
```python
resp... | diff --git a/scrapy/http/request/form.py b/scrapy/http/request/form.py
--- a/scrapy/http/request/form.py
+++ b/scrapy/http/request/form.py
@@ -18,6 +18,7 @@
class FormRequest(Request):
+ valid_form_methods = ['GET', 'POST']
def __init__(self, *args, **kwargs):
formdata = kwargs.pop('formdata', 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
@@ -1105,6 +1105,20 @@
self.assertRaises(ValueError, self.request_class.from_response,
response, formcss="input[name='abc']")
+ def test_from_re... | null | null | namanjain12/scrapy_final:9aec7856b009f0732fa82ae80dd0cc7ef3931fa1 | true | null | 1 | 7 | null | 810 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.158333 | 80.39375 | ||
9,192 | swe_bench::test::1341 | swe_bench | test | 1,341 | pylint-dev__pylint-5859 | pylint-dev/pylint | pylint-dev/pylint | python | 182cc539b8154c0710fcea7e522267e42eba8899 | "--notes" option ignores note tags that are entirely punctuation
### Bug description
If a note tag specified with the `--notes` option is entirely punctuation, pylint won't report a fixme warning (W0511).
```python
# YES: yes
# ???: no
```
`pylint test.py --notes="YES,???"` will return a fixme warning (W0511) for th... | Did a little investigation, this is we're actually converting this option in a regular expression pattern (thereby making it awfully similar to the `notes-rgx` option). Since `?` is a special character in regex this doesn't get picked up. Using `\?\?\?` in either `notes` or `notes-rgx` should work. | diff --git a/pylint/checkers/misc.py b/pylint/checkers/misc.py
--- a/pylint/checkers/misc.py
+++ b/pylint/checkers/misc.py
@@ -121,9 +121,9 @@ def open(self):
notes = "|".join(re.escape(note) for note in self.config.notes)
if self.config.notes_rgx:
- regex_string = rf"#\s*({notes}|{self.c... | diff --git a/tests/checkers/unittest_misc.py b/tests/checkers/unittest_misc.py
--- a/tests/checkers/unittest_misc.py
+++ b/tests/checkers/unittest_misc.py
@@ -68,6 +68,16 @@ def test_without_space_fixme(self) -> None:
):
self.checker.process_tokens(_tokenize_str(code))
+ @set_config(notes=["?... | ["tests/checkers/unittest_misc.py::TestFixme::test_non_alphanumeric_codetag"] | ["tests/checkers/unittest_misc.py::TestFixme::test_fixme_with_message", "tests/checkers/unittest_misc.py::TestFixme::test_todo_without_message", "tests/checkers/unittest_misc.py::TestFixme::test_xxx_without_space", "tests/checkers/unittest_misc.py::TestFixme::test_xxx_middle", "tests/checkers/unittest_misc.py::TestFixm... | null | true | 2022-03-04T00:01:54Z | 1 | 4 | 1 | 905 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.164167 | 80.3925 | |
9,193 | r2e_gym::train::4969 | r2e_gym | train | 4,969 | datalad__7ea54d08b9f1eb7c6d9bbfe76dc66d146cbb4176 | datalad | datalad/datalad | python | 7ea54d08b9f1eb7c6d9bbfe76dc66d146cbb4176 | **Title:** addurls plugin does not raise error for improperly formatted meta arguments
**Description:**
When providing meta arguments that are not in the 'field=value' format, the `addurls` plugin incorrectly accepts them instead of raising an error. This behavior can lead to unexpected results since the arguments are... | diff --git a/datalad/plugin/addurls.py b/datalad/plugin/addurls.py
--- a/datalad/plugin/addurls.py
+++ b/datalad/plugin/addurls.py
@@ -82,8 +82,7 @@
raise ValueError("Empty field name")
field, value = parts
else:
- field = "tag"
- value = parts[0]
+ ... | diff --git a/datalad/plugin/tests/test_addurls.py b/datalad/plugin/tests/test_addurls.py
--- a/datalad/plugin/tests/test_addurls.py
+++ b/datalad/plugin/tests/test_addurls.py
@@ -63,12 +63,14 @@
def test_clean_meta_args():
- for args, expect in [(["", "field="], []),
+ for args, expect in [(["field="], []),
... | null | null | namanjain12/datalad_final:7ea54d08b9f1eb7c6d9bbfe76dc66d146cbb4176 | true | null | 1 | 8 | null | 784 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.157333 | 80.39075 | ||
9,194 | r2e_gym::train::4616 | r2e_gym | train | 4,616 | numpy__6bb48b0639322a0f5908996f33c98db62304b839 | numpy | numpy/numpy | python | 6bb48b0639322a0f5908996f33c98db62304b839 | **Title:** NameValidator Fails to Handle Unrecognized `case_sensitive` Values
**Description:**
When initializing `NameValidator` with an invalid value for the `case_sensitive` parameter, no error is raised. This allows the validator to operate with unexpected configurations, potentially leading to incorrect validation... | diff --git a/numpy/lib/_iotools.py b/numpy/lib/_iotools.py
--- a/numpy/lib/_iotools.py
+++ b/numpy/lib/_iotools.py
@@ -320,12 +320,13 @@
# Process the case option .....
if (case_sensitive is None) or (case_sensitive is True):
self.case_converter = lambda x: x
- elif (case_sensitive... | diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py
--- a/numpy/lib/tests/test__iotools.py
+++ b/numpy/lib/tests/test__iotools.py
@@ -7,7 +7,8 @@
import numpy as np
from numpy.compat import asbytes, asbytes_nested
from numpy.testing import (
- run_module_suite, TestCase, assert_, asse... | null | null | namanjain12/numpy_final:6bb48b0639322a0f5908996f33c98db62304b839 | true | null | 1 | 7 | null | 801 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.156833 | 80.38925 | ||
9,195 | r2e_gym::train::5883 | r2e_gym | train | 5,883 | tornado__00703240498a106fa9bee24cf01777e6647804f3 | tornado | tornadoweb/tornado | python | 00703240498a106fa9bee24cf01777e6647804f3 | **Title:** TypeError When Passing Positional Arguments to `Configurable.initialize`
**Description:**
Initializing a `Configurable` subclass with positional arguments results in a `TypeError`. The `__new__` method does not accept positional arguments, causing the initialization to fail when extra arguments are provided... | diff --git a/tornado/util.py b/tornado/util.py
--- a/tornado/util.py
+++ b/tornado/util.py
@@ -198,21 +198,21 @@
__impl_class = None
__impl_kwargs = None
- def __new__(cls, **kwargs):
- base = cls.configurable_base()
- args = {}
+ def __new__(cls, *args, **kwargs):
+ base = cls.co... | diff --git a/tornado/test/util_test.py b/tornado/test/util_test.py
--- a/tornado/test/util_test.py
+++ b/tornado/test/util_test.py
@@ -46,13 +46,15 @@
class TestConfig1(TestConfigurable):
- def initialize(self, a=None):
+ def initialize(self, pos_arg=None, a=None):
self.a = a
+ self.pos_arg =... | null | null | namanjain12/tornado_final:00703240498a106fa9bee24cf01777e6647804f3 | true | null | 1 | 15 | null | 641 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.156833 | 80.38925 | ||
9,196 | r2e_gym::train::4734 | r2e_gym | train | 4,734 | numpy__db5f9d3a61d639b4fdb95c161012678ea8847424 | numpy | numpy/numpy | python | db5f9d3a61d639b4fdb95c161012678ea8847424 | **Title:** `numpy.block` Does Not Return a Copy for Single Arrays, Causing Unintended Side Effects
**Description:**
When using `numpy.block` with a single array, the returned array is not a copy. As a result, modifying the returned array inadvertently alters the original array, leading to unexpected behavior.
**Examp... | diff --git a/numpy/core/shape_base.py b/numpy/core/shape_base.py
--- a/numpy/core/shape_base.py
+++ b/numpy/core/shape_base.py
@@ -617,4 +617,11 @@
_block_format_index(bottom_index)
)
)
- return _block(arrays, list_ndim, max(arr_ndim, list_ndim))
+ result = _block(arrays, li... | diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py
--- a/numpy/core/tests/test_shape_base.py
+++ b/numpy/core/tests/test_shape_base.py
@@ -191,6 +191,12 @@
class TestConcatenate(object):
+ def test_returns_copy(self):
+ a = np.eye(3)
+ b = np.concatenate([a])
+ ... | null | null | namanjain12/numpy_final:db5f9d3a61d639b4fdb95c161012678ea8847424 | true | null | 1 | 9 | null | 761 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.156833 | 80.38925 | ||
9,197 | r2e_gym::train::4663 | r2e_gym | train | 4,663 | numpy__1b3e6f1d8dad0b3b7d8a0891dcb2050cdc023075 | numpy | numpy/numpy | python | 1b3e6f1d8dad0b3b7d8a0891dcb2050cdc023075 | **Title:** `np.resize` Discards Empty Dimensions, Causing Incorrect Array Shapes
**Description:**
When using `np.resize` to reshape an array with dimensions that include zero, the function incorrectly discards the empty dimensions. This results in arrays that do not match the expected shape, leading to assertion failu... | diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1120,18 +1120,16 @@
new_shape = (new_shape,)
a = ravel(a)
Na = len(a)
- if not Na:
+ total_size = um.multiply.reduce(new_shape)
+ if Na == 0 or total_size ==... | diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -33,6 +33,12 @@
Ar = np.resize(A, (0,))
assert_array_equal(Ar, np.array([]))
assert_equal(A.dtype, Ar.dtype)
+
+ Ar = np.res... | null | null | namanjain12/numpy_final:1b3e6f1d8dad0b3b7d8a0891dcb2050cdc023075 | true | null | 1 | 12 | null | 700 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.156667 | 80.38875 | ||
9,198 | r2e_gym::train::4131 | r2e_gym | train | 4,131 | numpy__389bd44e32b0eace0d024b126931a0a00d14cffe | numpy | numpy/numpy | python | 389bd44e32b0eace0d024b126931a0a00d14cffe | **Title:** Unable to Modify `poly1d.coeffs` Property Raises AttributeError
**Description:**
When attempting to modify the coefficients of a `poly1d` object using the `coeffs` property, an `AttributeError` is raised. This behavior is unexpected and disrupts workflows that rely on directly updating the polynomial coeff... | diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -1040,8 +1040,14 @@
@property
def coeffs(self):
- """ A copy of the polynomial coefficients """
- return self._coeffs.copy()
+ """ The polynomial coefficients ""... | diff --git a/numpy/lib/tests/test_polynomial.py b/numpy/lib/tests/test_polynomial.py
--- a/numpy/lib/tests/test_polynomial.py
+++ b/numpy/lib/tests/test_polynomial.py
@@ -222,19 +222,19 @@
assert_equal(p == p2, False)
assert_equal(p != p2, True)
- def test_poly_coeffs_immutable(self):
- ""... | null | null | namanjain12/numpy_final:389bd44e32b0eace0d024b126931a0a00d14cffe | true | null | 1 | 10 | null | 740 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.156667 | 80.38875 | ||
9,199 | r2e_gym::train::4144 | r2e_gym | train | 4,144 | numpy__e36d7cab82570b82df3ff0dbc1fc066ae1632768 | numpy | numpy/numpy | python | e36d7cab82570b82df3ff0dbc1fc066ae1632768 | **Title:** `np.piecewise` raises ValueError with multidimensional inputs and multiple conditions
**Description:**
When using `np.piecewise` with a multidimensional array and multiple conditions, a `ValueError` is raised instead of computing the expected results.
**Example Code:**
```python
import numpy as np
x = np.... | 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
@@ -944,11 +944,16 @@
condlist = condlist.T
if n == n2 - 1: # compute the "otherwise" condition.
totlist = np.logical_or.reduce(condlist, axis=0)
- co... | 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
@@ -1862,6 +1862,10 @@
x = piecewise([1, 2], [[True, False], [False, True]], [3, 4])
assert_array_equal(x, [3, 4])
+ d... | null | null | namanjain12/numpy_final:e36d7cab82570b82df3ff0dbc1fc066ae1632768 | true | null | 1 | 13 | null | 679 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1565 | 80.38825 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.