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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,800 | r2e_gym::train::6082 | r2e_gym | train | 6,082 | pillow__fc497ffe5ec273be985af890119925178bf25dd3 | pillow | python-pillow/pillow | python | fc497ffe5ec273be985af890119925178bf25dd3 | **Title:** GIF Palette Optimization Fails to Reduce Palette Size Correctly
**Description:**
When optimizing GIF images, the palette size is not reduced as expected under certain conditions. Specifically, when the number of used palette colors should allow for a smaller palette, the optimization either does not reduce ... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -824,9 +824,18 @@
if count:
used_palette_colors.append(i)
- if optimise or (
- len(used_palette_colors) <= 128
- ... | 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
@@ -158,6 +158,9 @@
assert_image_equal(im.convert("RGB"), reloaded.convert("RGB"))
# These do optimize the palette
+ check(256, 511, 256)
+ check(255, 511, 255)
+ check(129... | null | null | namanjain12/pillow_final:fc497ffe5ec273be985af890119925178bf25dd3 | true | null | 1 | 15 | null | 1,124 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.237333 | 80.63075 | ||
8,801 | r2e_gym::train::5185 | r2e_gym | train | 5,185 | pyramid__72bf6bb1b942a56a39d5ae33634e7aa8fac7080a | pyramid | pylons/pyramid | python | 72bf6bb1b942a56a39d5ae33634e7aa8fac7080a | **Title:** `render_to_response` Does Not Accept `response` Argument, Causing TypeError
**Description:**
When attempting to pass a custom response object to the `render_to_response` function, a `TypeError` is raised because the function does not recognize the `response` keyword argument. This prevents developers from u... | diff --git a/pyramid/renderers.py b/pyramid/renderers.py
--- a/pyramid/renderers.py
+++ b/pyramid/renderers.py
@@ -79,7 +79,11 @@
return result
-def render_to_response(renderer_name, value, request=None, package=None):
+def render_to_response(renderer_name,
+ value,
+ ... | diff --git a/pyramid/tests/test_renderers.py b/pyramid/tests/test_renderers.py
--- a/pyramid/tests/test_renderers.py
+++ b/pyramid/tests/test_renderers.py
@@ -517,10 +517,11 @@
def tearDown(self):
testing.tearDown()
- def _callFUT(self, renderer_name, value, request=None, package=None):
+ def _cal... | null | null | namanjain12/pyramid_final:72bf6bb1b942a56a39d5ae33634e7aa8fac7080a | true | null | 1 | 14 | null | 1,144 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.237333 | 80.63075 | ||
8,802 | r2e_gym::train::68 | r2e_gym | train | 68 | orange3__c27a803027d75e302c6a71902ebe4be5b9052706 | orange3 | biolab/orange3 | python | c27a803027d75e302c6a71902ebe4be5b9052706 | **Title:** In-Place Modification of Base Learner Causes Unexpected Behavior in Calibrated Learner
**Description:**
When configuring the `OWCalibratedLearner` without applying calibration or threshold optimization, the created learner instance is identical to the base learner. This leads to unintended modifications of ... | diff --git a/Orange/widgets/model/owcalibratedlearner.py b/Orange/widgets/model/owcalibratedlearner.py
--- a/Orange/widgets/model/owcalibratedlearner.py
+++ b/Orange/widgets/model/owcalibratedlearner.py
@@ -1,3 +1,5 @@
+import copy
+
from Orange.classification import CalibratedLearner, ThresholdLearner, \
NaiveBa... | diff --git a/Orange/widgets/model/tests/test_owcalibratedlearner.py b/Orange/widgets/model/tests/test_owcalibratedlearner.py
--- a/Orange/widgets/model/tests/test_owcalibratedlearner.py
+++ b/Orange/widgets/model/tests/test_owcalibratedlearner.py
@@ -95,7 +95,7 @@
widget.calibration = widget.NoCalibration
... | null | null | namanjain12/orange3_final:c27a803027d75e302c6a71902ebe4be5b9052706 | true | null | 1 | 12 | null | 1,184 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.237333 | 80.63075 | ||
8,803 | r2e_gym::train::6577 | r2e_gym | train | 6,577 | pillow__bbb3be9a9d018a2cb777ebf63307b8a047921451 | pillow | python-pillow/pillow | python | bbb3be9a9d018a2cb777ebf63307b8a047921451 | **Title:** Saving RGB GIF with Transparency Tuple Raises TypeError
**Description:**
When attempting to save an RGB image with the `transparency` attribute set as a tuple, the save operation fails with a `TypeError`. This issue occurs because the GIF encoder expects the `transparency` value to be an integer, not a tupl... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -393,6 +393,8 @@
def _write_single_frame(im, fp, palette):
im_out = _normalize_mode(im, True)
+ for k, v in im_out.info.items():
+ im.encoderinfo.setdefault(k, v)
... | 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
@@ -536,6 +536,27 @@
self.assertEqual(reloaded.info['transparency'], 253)
+ def test_rgb_transparency(self):
+ out = self.tempfile('temp.gif')
+
+ # Single frame
+ ... | null | null | namanjain12/pillow_final:bbb3be9a9d018a2cb777ebf63307b8a047921451 | true | null | 1 | 17 | null | 1,084 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.237333 | 80.63075 | ||
8,804 | r2e_gym::train::6032 | r2e_gym | train | 6,032 | tornado__3fe0c5eea6b91564d7116c4257276e125cfbc241 | tornado | tornadoweb/tornado | python | 3fe0c5eea6b91564d7116c4257276e125cfbc241 | **Title**: `PeriodicCallback` Fails When Using Unsupported `jitter` Parameter
**Description**:
Attempting to initialize `PeriodicCallback` with the `jitter` argument results in a `TypeError`. This prevents developers from adding variability to callback timings to reduce alignment with other timers.
**Example Code**:
... | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -47,6 +47,7 @@
import time
import traceback
import math
+import random
from tornado.concurrent import Future, is_future, chain_future, future_set_exc_info, future_add_done_callback # noqa: E501
from tornado.log... | diff --git a/tornado/test/ioloop_test.py b/tornado/test/ioloop_test.py
--- a/tornado/test/ioloop_test.py
+++ b/tornado/test/ioloop_test.py
@@ -10,6 +10,13 @@
import threading
import time
import types
+try:
+ from unittest import mock # type: ignore
+except ImportError:
+ try:
+ import mock # type: ign... | null | null | namanjain12/tornado_final:3fe0c5eea6b91564d7116c4257276e125cfbc241 | true | null | 1 | 18 | null | 1,063 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.237167 | 80.63025 | ||
8,805 | r2e_gym::train::6599 | r2e_gym | train | 6,599 | pillow__7e4fd9d84591a220d142cbc4652b18250984cf41 | pillow | python-pillow/pillow | python | 7e4fd9d84591a220d142cbc4652b18250984cf41 | **Title:** MorphOp Methods Raise Generic Exception Instead of ValueError for Non-Binary Images
**Description:**
When using MorphOp operations on images that are not in binary mode (`'L'`), a generic `Exception` is raised instead of a more specific `ValueError`. This makes it harder to handle specific error cases and ... | diff --git a/src/PIL/ImageMorph.py b/src/PIL/ImageMorph.py
--- a/src/PIL/ImageMorph.py
+++ b/src/PIL/ImageMorph.py
@@ -196,7 +196,7 @@
raise Exception("No operator loaded")
if image.mode != "L":
- raise Exception("Image must be binary, meaning it must use mode L")
+ raise V... | diff --git a/Tests/test_imagemorph.py b/Tests/test_imagemorph.py
--- a/Tests/test_imagemorph.py
+++ b/Tests/test_imagemorph.py
@@ -235,19 +235,19 @@
)
-def test_non_binary_images():
+def test_incorrect_mode():
im = hopper("RGB")
mop = ImageMorph.MorphOp(op_name="erosion8")
- with pytest.raises(E... | null | null | namanjain12/pillow_final:7e4fd9d84591a220d142cbc4652b18250984cf41 | true | null | 1 | 6 | null | 1,300 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.236667 | 80.62875 | ||
8,806 | r2e_gym::train::5117 | r2e_gym | train | 5,117 | pyramid__5aaecd1395dddc6f2e27f904cf759497d63f7eaf | pyramid | pylons/pyramid | python | 5aaecd1395dddc6f2e27f904cf759497d63f7eaf | **Title:** HTTPException Initialization with Default `code=None` and `title=None` Causes Invalid Status Code Errors
**Description:**
When an `HTTPException` is instantiated without specifying the `code` and `title`, it defaults to `code=None` and `title=None`. This results in the creation of an invalid status string `... | diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py
--- a/pyramid/httpexceptions.py
+++ b/pyramid/httpexceptions.py
@@ -160,6 +160,13 @@
# title = 'OK'
# explanation = 'why this happens'
# body_template_obj = Template('response template')
+ #
+ # This class itself uses the error code... | diff --git a/pyramid/tests/test_httpexceptions.py b/pyramid/tests/test_httpexceptions.py
--- a/pyramid/tests/test_httpexceptions.py
+++ b/pyramid/tests/test_httpexceptions.py
@@ -120,7 +120,7 @@
def test_ctor_calls_Response_ctor(self):
exc = self._makeOne('message')
- self.assertEqual(exc.status,... | null | null | namanjain12/pyramid_final:5aaecd1395dddc6f2e27f904cf759497d63f7eaf | true | null | 1 | 11 | null | 1,200 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.236667 | 80.62875 | ||
8,807 | r2e_gym::train::6043 | r2e_gym | train | 6,043 | pillow__ffa18c8efd38a40ed4aa49f0f8748c96b64527ad | pillow | python-pillow/pillow | python | ffa18c8efd38a40ed4aa49f0f8748c96b64527ad | **Title:** Missing `ImageOps.scale` Function Causes AttributeError When Scaling Images
**Description:**
Attempting to scale an image using the `ImageOps.scale` function results in an `AttributeError` because the `scale` attribute does not exist in the `ImageOps` module.
**Example Code:**
```python
from PIL import Ima... | diff --git a/PIL/ImageOps.py b/PIL/ImageOps.py
--- a/PIL/ImageOps.py
+++ b/PIL/ImageOps.py
@@ -178,6 +178,27 @@
)
+def scale(image, factor, resample=Image.NEAREST):
+ """
+ Returns a rescaled image by a specific factor given in parameter.
+ A factor greater than 1 expands the image, between 0 and ... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -78,6 +78,22 @@
ImageOps.equalize(i.convert("P"))
ImageOps.equalize(i.convert("RGB"))
+ def test_scale(self):
+ # Test the scaling function
+ i = hopper("L").res... | null | null | namanjain12/pillow_final:ffa18c8efd38a40ed4aa49f0f8748c96b64527ad | true | null | 1 | 21 | null | 999 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2365 | 80.62825 | ||
8,808 | r2e_gym::train::5463 | r2e_gym | train | 5,463 | aiohttp__8cc211adc3f36af12898c6beca2ac6b701de0a0b | aiohttp | aio-libs/aiohttp | python | 8cc211adc3f36af12898c6beca2ac6b701de0a0b | **Title:** Registering Routes with Dashes in Name Still Fails Validation
**Description:**
After updating the URL dispatcher to allow dashes in route names, attempting to register a route that includes dashes still results in a validation error.
**Example Buggy Code:**
```python
from aiohttp import web
def handler(re... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,12 @@
CHANGES
=======
+
+0.18.4 (13-11-2015)
+-------------------
+
+- Relax rule for router names again by adding dash to allowed
+ characters: they may contain identifiers, dashes, dots and columns
+
0.18.3 (25-10-2015)
-----... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -83,7 +83,7 @@
route = PlainRoute('GET', handler, 'return', '/handler/to/path')
self.assertRaises(ValueError, self.router.register_route, route)
- route = Plai... | null | null | namanjain12/aiohttp_final:8cc211adc3f36af12898c6beca2ac6b701de0a0b | true | null | 2 | 15 | null | 1,117 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.236167 | 80.62725 | ||
8,809 | r2e_gym::train::5766 | r2e_gym | train | 5,766 | scrapy__12a26755ae601c9b3244a4a6b55d0e880fc21864 | scrapy | scrapy/scrapy | python | 12a26755ae601c9b3244a4a6b55d0e880fc21864 | **Title:** `render_templatefile` Raises AttributeError When Passed a Path Object
**Description:**
When using the `render_templatefile` function with a `Path` object, an `AttributeError` is thrown. This occurs because the function expects a string path and attempts to use string-specific methods on a `Path` object, whi... | diff --git a/scrapy/commands/startproject.py b/scrapy/commands/startproject.py
--- a/scrapy/commands/startproject.py
+++ b/scrapy/commands/startproject.py
@@ -109,7 +109,7 @@
move(project_dir / 'module', project_dir / project_name)
for paths in TEMPLATES_TO_RENDER:
tplfile = Path(project_... | diff --git a/tests/test_utils_template.py b/tests/test_utils_template.py
--- a/tests/test_utils_template.py
+++ b/tests/test_utils_template.py
@@ -28,7 +28,7 @@
template_path.write_text(template, encoding='utf8')
assert template_path.is_file() # Failure of test itself
- render_templatefile(s... | null | null | namanjain12/scrapy_final:12a26755ae601c9b3244a4a6b55d0e880fc21864 | true | null | 2 | 17 | null | 1,077 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.236167 | 80.62725 | ||
8,810 | r2e_gym::train::4492 | r2e_gym | train | 4,492 | numpy__6386fdb247a409f757fed3ab7026585fd0d2aa3d | numpy | numpy/numpy | python | 6386fdb247a409f757fed3ab7026585fd0d2aa3d | **Title:** Incorrect `fill_value` in multifield view of `MaskedArray`
**Description:**
When creating a view of a `MaskedArray` by selecting specific fields, the `fill_value` incorrectly retains fields that are not part of the view. This leads to mismatched `fill_value` entries, causing unexpected behavior when working... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -449,17 +449,15 @@
"""
ndtype = np.dtype(ndtype)
- fields = ndtype.fields
if fill_value is None:
fill_value = default_fill_value(ndtype)
- elif fields:
- fdtype = [(_[0], _[1]) for _ ... | diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -2029,6 +2029,17 @@
assert_equal(x.fill_value, 999.)
assert_equal(x._fill_value, np.array(999.))
+ def test_subarray_fillvalue(self):
+ # gh-10483 ... | null | null | namanjain12/numpy_final:6386fdb247a409f757fed3ab7026585fd0d2aa3d | true | null | 1 | 14 | null | 1,136 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.236 | 80.62675 | ||
8,811 | r2e_gym::train::4315 | r2e_gym | train | 4,315 | numpy__bec40c2b7912c4d94894929a2f4aca18c6d344e6 | numpy | numpy/numpy | python | bec40c2b7912c4d94894929a2f4aca18c6d344e6 | **Title:** TypeError When Accessing `fill_value` for Structured Masked Arrays with String or Bytes Fields
**Description:**
When using masked arrays with structured data types that include string or bytes fields, attempting to retrieve the `fill_value` results in a `TypeError`. This occurs because the `fill_value` for ... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3530,7 +3530,14 @@
"""
if self._fill_value is None:
self._fill_value = _check_fill_value(None, self.dtype)
- return self._fill_value[()]
+
+ # Temporary workaround to account f... | 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
@@ -1819,6 +1819,13 @@
y = x.view(dtype=np.int32)
assert_(y.fill_value == 999999)
+ def test_fillvalue_bytes_or_str(self):
+ # Test whether fill values... | null | null | namanjain12/numpy_final:bec40c2b7912c4d94894929a2f4aca18c6d344e6 | true | null | 1 | 9 | null | 1,235 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.235833 | 80.62625 | ||
8,812 | r2e_gym::train::5508 | r2e_gym | train | 5,508 | aiohttp__f19d920658b6d6800d28c2dc0b99423da3c3750a | aiohttp | aio-libs/aiohttp | python | f19d920658b6d6800d28c2dc0b99423da3c3750a | **Title:** URL Dispatcher Fails to Match Routes with Fixed String Followed by Variable After Slash
**Description:**
When defining a route that includes a fixed string followed by a variable with a regex, the URL dispatcher does not correctly match certain URLs, resulting in unexpected 404 errors.
**Example Code:**
``... | diff --git a/CHANGES/8566.bugfix.rst b/CHANGES/8566.bugfix.rst
--- a/CHANGES/8566.bugfix.rst
+++ b/CHANGES/8566.bugfix.rst
@@ -0,0 +1 @@
+Fixed url dispatcher index not matching when a variable is preceded by a fixed string after a slash -- by :user:`bdraco`.
diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urld... | diff --git a/tests/test_web_urldispatcher.py b/tests/test_web_urldispatcher.py
--- a/tests/test_web_urldispatcher.py
+++ b/tests/test_web_urldispatcher.py
@@ -937,3 +937,27 @@
r = await client.get("///a")
assert r.status == 200
await r.release()
+
+
+async def test_route_with_regex(aiohttp_client: Aiohtt... | null | null | namanjain12/aiohttp_final:f19d920658b6d6800d28c2dc0b99423da3c3750a | true | null | 2 | 11 | null | 1,194 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.235667 | 80.62575 | ||
8,813 | r2e_gym::train::4811 | r2e_gym | train | 4,811 | numpy__5f5ccecbfc116284ed8c8d53cd8b203ceef5f7c7 | numpy | numpy/numpy | python | 5f5ccecbfc116284ed8c8d53cd8b203ceef5f7c7 | **Title:** TypeError when using 'copy' parameter with `nan_to_num`
**Description:**
When attempting to perform an in-place conversion using the `nan_to_num` function with the `copy=False` parameter, a `TypeError` is raised because the function does not accept the `copy` argument.
**Example Code:**
```python
import nu... | diff --git a/numpy/lib/type_check.py b/numpy/lib/type_check.py
--- a/numpy/lib/type_check.py
+++ b/numpy/lib/type_check.py
@@ -315,7 +315,7 @@
f = getlimits.finfo(t)
return f.max, f.min
-def nan_to_num(x):
+def nan_to_num(x, copy=True):
"""
Replace nan with zero and inf with finite numbers.
@@ -... | diff --git a/numpy/lib/tests/test_type_check.py b/numpy/lib/tests/test_type_check.py
--- a/numpy/lib/tests/test_type_check.py
+++ b/numpy/lib/tests/test_type_check.py
@@ -320,6 +320,16 @@
assert_(vals[1] == 0)
assert_all(vals[2] > 1e10) and assert_all(np.isfinite(vals[2]))
+ # perform the sam... | null | null | namanjain12/numpy_final:5f5ccecbfc116284ed8c8d53cd8b203ceef5f7c7 | true | null | 1 | 11 | null | 1,191 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.235167 | 80.62425 | ||
8,814 | r2e_gym::train::4626 | r2e_gym | train | 4,626 | numpy__d18156b00d4215d869d71f1d4c7d66037bd50b4b | numpy | numpy/numpy | python | d18156b00d4215d869d71f1d4c7d66037bd50b4b | **Title:** `np.unique` Raises `ValueError` When Handling Axes with Length 0
**Description:**
When using `np.unique` on arrays that include an axis with length 0, a `ValueError` is unexpectedly raised. This occurs even when the input array is otherwise valid, preventing proper handling of empty axes.
**Example Code:**... | diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -270,20 +270,33 @@
# Must reshape to a contiguous 2D array for this to work...
orig_shape, orig_dtype = ar.shape, ar.dtype
- ar = ar.reshape(orig_shape[0], -1)
+ ar = ar.re... | diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -563,6 +563,12 @@
result = np.array([[-0.0, 0.0]])
assert_array_equal(unique(data, axis=0), result, msg)
+ @pytest.mark.par... | null | null | namanjain12/numpy_final:d18156b00d4215d869d71f1d4c7d66037bd50b4b | true | null | 1 | 20 | null | 1,005 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.234167 | 80.62125 | ||
8,815 | r2e_gym::train::5126 | r2e_gym | train | 5,126 | pyramid__ba93133ee29ecacad04770af7dffc39f2b2d3aff | pyramid | pylons/pyramid | python | ba93133ee29ecacad04770af7dffc39f2b2d3aff | **Title:** PTweensCommand Raises TypeError When Accessing Command-Line Arguments
**Description:**
When running the `PTweensCommand` without providing the `config_vars` argument, the command incorrectly attempts to access the command-line arguments as if they were a list. However, the arguments are actually a `Namespac... | diff --git a/pyramid/scripts/ptweens.py b/pyramid/scripts/ptweens.py
--- a/pyramid/scripts/ptweens.py
+++ b/pyramid/scripts/ptweens.py
@@ -36,6 +36,14 @@
default=None,
help='The URI to the configuration file.')
+ parser.add_argument(
+ 'config_vars',
+ ... | diff --git a/pyramid/tests/test_scripts/test_ptweens.py b/pyramid/tests/test_scripts/test_ptweens.py
--- a/pyramid/tests/test_scripts/test_ptweens.py
+++ b/pyramid/tests/test_scripts/test_ptweens.py
@@ -9,7 +9,7 @@
def _makeOne(self):
cmd = self._getTargetClass()([])
cmd.bootstrap = (dummy.DummyB... | null | null | namanjain12/pyramid_final:ba93133ee29ecacad04770af7dffc39f2b2d3aff | true | null | 1 | 14 | null | 1,125 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.234167 | 80.62125 | ||
8,816 | r2e_gym::train::5292 | r2e_gym | train | 5,292 | aiohttp__dccf97578e6a8e094dac0c0a4ac46a59eb3ac2b1 | aiohttp | aio-libs/aiohttp | python | dccf97578e6a8e094dac0c0a4ac46a59eb3ac2b1 | **Title:** Unable to Send Masked WebSocket Frames Due to Unexpected 'random' Argument
**Description:**
When attempting to send a masked WebSocket frame using a custom random generator, an error occurs because the `WebSocketWriter` does not accept the `random` keyword argument. This prevents the creation of determinist... | diff --git a/aiohttp/websocket.py b/aiohttp/websocket.py
--- a/aiohttp/websocket.py
+++ b/aiohttp/websocket.py
@@ -5,7 +5,8 @@
import collections
import hashlib
import os
-from random import randrange
+import random
+
from struct import Struct
from aiohttp import errors, hdrs
from aiohttp.log import ws_logger
@@ ... | diff --git a/tests/test_websocket.py b/tests/test_websocket.py
--- a/tests/test_websocket.py
+++ b/tests/test_websocket.py
@@ -3,6 +3,7 @@
import base64
import hashlib
import os
+import random
import struct
import unittest
import unittest.mock
@@ -310,41 +311,55 @@
def setUp(self):
self.transport ... | null | null | namanjain12/aiohttp_final:dccf97578e6a8e094dac0c0a4ac46a59eb3ac2b1 | true | null | 1 | 11 | null | 1,184 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.234 | 80.62075 | ||
8,817 | r2e_gym::train::4073 | r2e_gym | train | 4,073 | coveragepy__c28544cc9a0c5113bd3a9279f47a2b7ea8826980 | coveragepy | nedbat/coveragepy | python | c28544cc9a0c5113bd3a9279f47a2b7ea8826980 | **Title:** Debug Messages Use Simplified Regex Patterns Causing Assertion Failures
**Description:**
After configuring multiple path aliases, the debug output displays regex patterns without the previously used non-capturing group `(?:...)`. This change leads to assertion failures because the expected debug messages in... | diff --git a/coverage/misc.py b/coverage/misc.py
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -182,7 +182,11 @@
def join_regex(regexes):
"""Combine a series of regexes into one that matches any of them."""
- return "|".join(f"(?:{r})" for r in regexes)
+ regexes = list(regexes)
+ if len(regexes) ==... | diff --git a/tests/test_files.py b/tests/test_files.py
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -309,9 +309,9 @@
assert msgs == [
"Aliases (relative=True):",
" Rule: '/home/*/src' -> './mysrc/' using regex " +
- "'(?:(?s:[\\\\\\\\/]home[\\\... | null | null | namanjain12/coveragepy_final:c28544cc9a0c5113bd3a9279f47a2b7ea8826980 | true | null | 1 | 6 | null | 1,284 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.234 | 80.62075 | ||
8,818 | r2e_gym::train::313 | r2e_gym | train | 313 | orange3__f6b7dde95ebc4782b304a9175e4c7df34cb85f17 | orange3 | biolab/orange3 | python | f6b7dde95ebc4782b304a9175e4c7df34cb85f17 | **Title:** Sorting Fails with TypeError When Adding a New Column to Domain
**Description:**
When a new column is added to the data domain, attempting to sort the attributes results in a `TypeError`. This occurs because the sorting mechanism tries to compare `ContinuousVariable` instances directly, which is not support... | diff --git a/Orange/widgets/data/owselectcolumns.py b/Orange/widgets/data/owselectcolumns.py
--- a/Orange/widgets/data/owselectcolumns.py
+++ b/Orange/widgets/data/owselectcolumns.py
@@ -362,9 +362,10 @@
all_vars = data.domain.variables + data.domain.metas
def attrs_for_role(role):
- retu... | diff --git a/Orange/widgets/data/tests/test_owselectcolumns.py b/Orange/widgets/data/tests/test_owselectcolumns.py
--- a/Orange/widgets/data/tests/test_owselectcolumns.py
+++ b/Orange/widgets/data/tests/test_owselectcolumns.py
@@ -2,6 +2,7 @@
from unittest import TestCase
from unittest.mock import Mock
+import nump... | null | null | namanjain12/orange3_final:f6b7dde95ebc4782b304a9175e4c7df34cb85f17 | true | null | 1 | 7 | null | 1,264 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.234 | 80.62075 | ||
8,819 | r2e_gym::train::5064 | r2e_gym | train | 5,064 | datalad__553892df7fb3c1650f960c70c547342a77527440 | datalad | datalad/datalad | python | 553892df7fb3c1650f960c70c547342a77527440 | **Title:** Missing Default for `--output-format` Causes TypeError When Not Specified
**Description:**
After recent changes to expose the result render mode via a common keyword argument, the `--output-format` option no longer has a default value. As a result, executing commands without explicitly specifying `--output-... | diff --git a/datalad/cmdline/main.py b/datalad/cmdline/main.py
--- a/datalad/cmdline/main.py
+++ b/datalad/cmdline/main.py
@@ -108,7 +108,7 @@
read from a file, but is potentially overridden itself by configuration
variables in the process environment.""")
parser.add_argument(
- '--output-... | 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
@@ -378,7 +378,7 @@
assert_in("return_type", doc1)
assert_in("list", doc1)
assert_in("None", doc1)
- assert_in("choose how ... | null | null | namanjain12/datalad_final:553892df7fb3c1650f960c70c547342a77527440 | true | null | 3 | 19 | null | 1,023 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.233833 | 80.62025 | ||
8,820 | r2e_gym::train::5063 | r2e_gym | train | 5,063 | datalad__d1a45eaa510354812258cd022388cd202bff9080 | datalad | datalad/datalad | python | d1a45eaa510354812258cd022388cd202bff9080 | **Title:** External Metadata Indexers Not Invoked, Causing Incomplete Metadata
**Description:**
When using external metadata indexers, the additional metadata they are supposed to provide is missing. Instead of including the key-value pairs from the external indexer, only the original metadata is present.
**Example:*... | diff --git a/datalad/metadata/indexers/base.py b/datalad/metadata/indexers/base.py
--- a/datalad/metadata/indexers/base.py
+++ b/datalad/metadata/indexers/base.py
@@ -38,7 +38,7 @@
Metadata created by an extractor.
Returns
- ----------
+ -------
dict:
key-value p... | diff --git a/datalad/metadata/tests/test_search.py b/datalad/metadata/tests/test_search.py
--- a/datalad/metadata/tests/test_search.py
+++ b/datalad/metadata/tests/test_search.py
@@ -18,6 +18,9 @@
dirname,
join as opj,
)
+
+from pkg_resources import EntryPoint
+
from datalad.api import Dataset
from datalad... | null | null | namanjain12/datalad_final:d1a45eaa510354812258cd022388cd202bff9080 | true | null | 2 | 24 | null | 922 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.233667 | 80.61975 | ||
8,821 | r2e_gym::train::4020 | r2e_gym | train | 4,020 | coveragepy__97997d2cd6801d0335e3fa162b719d6f8c160266 | coveragepy | nedbat/coveragepy | python | 97997d2cd6801d0335e3fa162b719d6f8c160266 | **Title:** Unable to Modify 'paths' Configuration via Plugins
**Description:**
When attempting to alter the `paths` configuration after initializing a `Coverage` instance, the operation fails because the `paths` option is not recognized. This prevents plugins from dynamically modifying the `paths` settings as intended... | diff --git a/coverage/config.py b/coverage/config.py
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -421,6 +421,9 @@
`value` is the new value for the option.
"""
+ if option_name == "paths":
+ self.paths = value
+ return
# Check all the hard-coded option... | diff --git a/tests/test_config.py b/tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -3,6 +3,7 @@
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Test the config file handling for coverage.py"""
+from collections import OrderedDict
import mock
@@ -340,... | null | null | namanjain12/coveragepy_final:97997d2cd6801d0335e3fa162b719d6f8c160266 | true | null | 1 | 6 | null | 1,281 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2335 | 80.61925 | ||
8,822 | r2e_gym::train::6476 | r2e_gym | train | 6,476 | pillow__87092ad4f8e55444ec3134ed857e4de5d19cd175 | pillow | python-pillow/pillow | python | 87092ad4f8e55444ec3134ed857e4de5d19cd175 | **Title:** Passing a List of Durations Causes TypeError When Saving GIFs
**Description:**
When attempting to save an animated GIF with varying frame durations by passing a list of integers to the `duration` parameter, a `TypeError` is raised. This prevents setting different durations for each frame, limiting the flexi... | diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py
--- a/PIL/GifImagePlugin.py
+++ b/PIL/GifImagePlugin.py
@@ -352,10 +352,18 @@
first_frame = None
append_images = im.encoderinfo.get("append_images", [])
+ if "duration" in im.encoderinfo:
+ duration = im.encoderinfo["durati... | 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
@@ -281,6 +281,30 @@
self.assertEqual(reread.info['duration'], duration)
+ def test_multiple_duration(self):
+ duration_list = [1000, 2000, 3000]
+
+ out = self.tempfile('... | null | null | namanjain12/pillow_final:87092ad4f8e55444ec3134ed857e4de5d19cd175 | true | null | 2 | 12 | null | 1,158 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.233 | 80.61775 | ||
8,823 | r2e_gym::train::6181 | r2e_gym | train | 6,181 | pillow__8a9bd2cdcdd7fc9ecd89fa79323463f4d24f53b8 | pillow | python-pillow/pillow | python | 8a9bd2cdcdd7fc9ecd89fa79323463f4d24f53b8 | **Title:** Missing 'dpi' Information When ResolutionUnit is Absent in TIFF Files
**Description:**
When opening a TIFF image that does not include the `ResolutionUnit` tag, the `dpi` information is not added to the image's metadata. Attempting to access `im.info['dpi']` results in a `KeyError`, which can cause downstre... | diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py
--- a/PIL/TiffImagePlugin.py
+++ b/PIL/TiffImagePlugin.py
@@ -1163,11 +1163,15 @@
yres = self.tag_v2.get(Y_RESOLUTION, 1)
if xres and yres:
- resunit = self.tag_v2.get(RESOLUTION_UNIT, 1)
+ resunit = self.tag_v2.get(R... | 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
@@ -92,6 +92,24 @@
TiffImagePlugin.IFDRational)
self.assertEqual(im.info['dpi'], (72., 72.))
+
+ def test_xyres_fallback_tiff(self):
+ from PIL.T... | null | null | namanjain12/pillow_final:8a9bd2cdcdd7fc9ecd89fa79323463f4d24f53b8 | true | null | 1 | 6 | null | 1,277 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232833 | 80.61725 | ||
8,824 | r2e_gym::train::5770 | r2e_gym | train | 5,770 | scrapy__5f0af906743e8a079cfb65ae8d232988bbac44b1 | scrapy | scrapy/scrapy | python | 5f0af906743e8a079cfb65ae8d232988bbac44b1 | **Title:** Relative Sitemap URLs in `robots.txt` Cause Invalid Request URLs
**Description:**
When `robots.txt` contains relative sitemap URLs, the sitemap processing fails to resolve them correctly. This results in `Request` objects being created with URLs missing the scheme, leading to errors.
**Example Buggy Code:*... | diff --git a/scrapy/spiders/sitemap.py b/scrapy/spiders/sitemap.py
--- a/scrapy/spiders/sitemap.py
+++ b/scrapy/spiders/sitemap.py
@@ -32,7 +32,7 @@
def _parse_sitemap(self, response):
if response.url.endswith('/robots.txt'):
- for url in sitemap_urls_from_robots(response.text):
+ ... | diff --git a/tests/test_spider.py b/tests/test_spider.py
--- a/tests/test_spider.py
+++ b/tests/test_spider.py
@@ -332,13 +332,17 @@
robots = b"""# Sitemap files
Sitemap: http://example.com/sitemap.xml
Sitemap: http://example.com/sitemap-product-index.xml
+Sitemap: HTTP://example.com/sitemap-uppercase.xml
+S... | null | null | namanjain12/scrapy_final:5f0af906743e8a079cfb65ae8d232988bbac44b1 | true | null | 2 | 9 | null | 1,216 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232667 | 80.61675 | ||
8,825 | r2e_gym::train::6627 | r2e_gym | train | 6,627 | pillow__b98dc8abe1d6b82425571477d0bd9b8bd3350cd8 | pillow | python-pillow/pillow | python | b98dc8abe1d6b82425571477d0bd9b8bd3350cd8 | **Title:** PNG Saving Fails with `save_all=True` and `default_image=True` for Certain Modes
**Description:**
When attempting to save a PNG image using `save_all=True` and `default_image=True` with image modes like "RGBA", "RGB", or "P", the operation fails. This issue arises because the image conversion does not corre... | diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py
--- a/src/PIL/PngImagePlugin.py
+++ b/src/PIL/PngImagePlugin.py
@@ -1166,6 +1166,8 @@
# default image IDAT (if it exists)
if default_image:
+ if im.mode != rawmode:
+ im = im.convert(rawmode)
ImageFile._save(im, _i... | diff --git a/Tests/test_file_apng.py b/Tests/test_file_apng.py
--- a/Tests/test_file_apng.py
+++ b/Tests/test_file_apng.py
@@ -673,10 +673,16 @@
@pytest.mark.parametrize("mode", ("RGBA", "RGB", "P"))
-def test_different_modes_in_later_frames(mode, tmp_path):
+@pytest.mark.parametrize("default_image", (True, False)... | null | null | namanjain12/pillow_final:b98dc8abe1d6b82425571477d0bd9b8bd3350cd8 | true | null | 1 | 8 | null | 1,236 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232667 | 80.61675 | ||
8,826 | swe_bench::test::1701 | swe_bench | test | 1,701 | scikit-learn__scikit-learn-25805 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 67ea7206bc052eb752f7881eb6043a00fe27c800 | CalibratedClassifierCV fails on lgbm fit_params
Hi,
I'm trying to use CalibratedClassifierCV to calibrate the probabilities from a LGBM model. The issue is that when I try CalibratedClassifierCV with eval_set, I get an error ValueError: Found input variables with inconsistent numbers of samples: [43364, 1] which is ca... | Once we have metadata routing with would have an explicit way to tell how to broadcast such parameters to the base estimators. However as far as I know, the current state of SLEP6 does not have a way to tell whether or not we want to apply cross-validation indexing and therefore disable the length consistency check for... | diff --git a/sklearn/calibration.py b/sklearn/calibration.py
--- a/sklearn/calibration.py
+++ b/sklearn/calibration.py
@@ -308,9 +308,6 @@ def fit(self, X, y, sample_weight=None, **fit_params):
if sample_weight is not None:
sample_weight = _check_sample_weight(sample_weight, X)
- for samp... | diff --git a/sklearn/tests/test_calibration.py b/sklearn/tests/test_calibration.py
--- a/sklearn/tests/test_calibration.py
+++ b/sklearn/tests/test_calibration.py
@@ -974,23 +974,6 @@ def fit(self, X, y, **fit_params):
pc_clf.fit(X, y, sample_weight=sample_weight)
-def test_calibration_with_fit_params_inco... | ["sklearn/tests/test_calibration.py::test_calibration_with_non_sample_aligned_fit_param"] | ["sklearn/tests/test_calibration.py::test_calibration[True-sigmoid]", "sklearn/tests/test_calibration.py::test_calibration[True-isotonic]", "sklearn/tests/test_calibration.py::test_calibration[False-sigmoid]", "sklearn/tests/test_calibration.py::test_calibration[False-isotonic]", "sklearn/tests/test_calibration.py::tes... | null | true | 2023-03-10T12:37:03Z | 1 | 3 | 1 | 1,373 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.238833 | 80.6165 | |
8,827 | r2e_gym::train::5026 | r2e_gym | train | 5,026 | datalad__022cfde286c9f961e97aae152e414279c1a198cb | datalad | datalad/datalad | python | 022cfde286c9f961e97aae152e414279c1a198cb | **Issue Title:**
Missing Dependency for Downloader Not Explicitly Handled
**Description:**
When attempting to use a downloader without its required dependency, the system does not raise a clear and explicit error. This can lead to confusing runtime issues later in the workflow.
**Example Buggy Code:**
```python
from ... | diff --git a/datalad/downloaders/providers.py b/datalad/downloaders/providers.py
--- a/datalad/downloaders/providers.py
+++ b/datalad/downloaders/providers.py
@@ -23,6 +23,7 @@
from .http import HTTPDownloader
from .s3 import S3Authenticator, S3Downloader
from ..support.configparserinc import SafeConfigParserWithInc... | diff --git a/datalad/downloaders/tests/test_providers.py b/datalad/downloaders/tests/test_providers.py
--- a/datalad/downloaders/tests/test_providers.py
+++ b/datalad/downloaders/tests/test_providers.py
@@ -8,14 +8,18 @@
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Tests for data... | null | null | namanjain12/datalad_final:022cfde286c9f961e97aae152e414279c1a198cb | true | null | 1 | 19 | null | 1,014 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232333 | 80.61575 | ||
8,828 | r2e_gym::train::4361 | r2e_gym | train | 4,361 | numpy__9fa0dba63ac76a43a157e07c2a43f4678355653e | numpy | numpy/numpy | python | 9fa0dba63ac76a43a157e07c2a43f4678355653e | **[ISSUE]**
### Error Setting `writeable` Flag with `broadcast_arrays` and `as_strided` Arrays
When using `broadcast_arrays` with an `as_strided` array, attempting to set the `writeable` flag on the resulting broadcasted array raises a `ValueError`. This prevents modifying arrays that should be writable based on the ... | 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
@@ -62,11 +62,14 @@
if any(size < 0 for size in shape):
raise ValueError('all elements of broadcast shape must be non-'
'negative')
+ needs_wr... | 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
@@ -390,6 +390,14 @@
_, result = broadcast_arrays(0, original)
assert_equal(result.flags.writeable, False)
+ # regresssion tes... | null | null | namanjain12/numpy_final:9fa0dba63ac76a43a157e07c2a43f4678355653e | true | null | 1 | 9 | null | 1,214 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232333 | 80.61575 | ||
8,829 | r2e_gym::train::6330 | r2e_gym | train | 6,330 | pillow__69768c514b1a404e62c3eabd90dc5c56b7fa538d | pillow | python-pillow/pillow | python | 69768c514b1a404e62c3eabd90dc5c56b7fa538d | **Title:** Missing `alpha_composite` Method Causes AttributeError During In-Place Compositing
**Description:**
When attempting to perform in-place alpha compositing on an `Image` instance, calling the `alpha_composite` method results in an `AttributeError`. This prevents developers from using in-place compositing func... | diff --git a/PIL/Image.py b/PIL/Image.py
--- a/PIL/Image.py
+++ b/PIL/Image.py
@@ -1373,6 +1373,34 @@
else:
self.im.paste(im, box)
+ def alpha_composite(self, im, box=None):
+ """ 'In-place' analog of Image.alpha_composite
+
+ :param im: image to composite over this one
+ ... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -201,6 +201,37 @@
# Assert
img_colors = sorted(img.getcolors())
self.assertEqual(img_colors, expected_colors)
+
+ def test_alpha_inplace(self):
+ src = Image.new('RGBA', (12... | null | null | namanjain12/pillow_final:69768c514b1a404e62c3eabd90dc5c56b7fa538d | true | null | 1 | 28 | null | 833 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232167 | 80.61525 | ||
8,830 | r2e_gym::train::5571 | r2e_gym | train | 5,571 | scrapy__daf0f660d12a3c998e64a7690e67cdf846ae02f1 | scrapy | scrapy/scrapy | python | daf0f660d12a3c998e64a7690e67cdf846ae02f1 | **Title:** MailSender.send Fails When Passing 'charset' Parameter
**Description:**
When attempting to send an email with a specified charset, the `send` method of `MailSender` does not recognize the `charset` parameter. This leads to a `TypeError`, preventing the email from being sent with the desired encoding.
**Exa... | diff --git a/docs/topics/email.rst b/docs/topics/email.rst
--- a/docs/topics/email.rst
+++ b/docs/topics/email.rst
@@ -76,7 +76,7 @@
:param settings: the e-mail recipients
:type settings: :class:`scrapy.settings.Settings` object
- .. method:: send(to, subject, body, cc=None, attachs=(), mimetype=... | diff --git a/tests/test_mail.py b/tests/test_mail.py
--- a/tests/test_mail.py
+++ b/tests/test_mail.py
@@ -1,5 +1,8 @@
+# coding=utf-8
+
import unittest
from io import BytesIO
+from email.charset import Charset
from scrapy.mail import MailSender
@@ -54,11 +57,58 @@
text, attach = payload
self... | null | null | namanjain12/scrapy_final:daf0f660d12a3c998e64a7690e67cdf846ae02f1 | true | null | 2 | 12 | null | 1,152 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232 | 80.61475 | ||
8,831 | r2e_gym::train::425 | r2e_gym | train | 425 | orange3__1eca4d67c0f8f44e706fe8fab1eea4d858ce51fd | orange3 | biolab/orange3 | python | 1eca4d67c0f8f44e706fe8fab1eea4d858ce51fd | **TypeError When Computing ROC Curves Due to Incorrect Threshold Initialization**
**Description**
When generating ROC curves using evaluation results, the first threshold is not properly initialized under certain conditions. This leads to a `TypeError` during the ROC data processing phase.
For example, consider the f... | diff --git a/Orange/widgets/evaluate/owrocanalysis.py b/Orange/widgets/evaluate/owrocanalysis.py
--- a/Orange/widgets/evaluate/owrocanalysis.py
+++ b/Orange/widgets/evaluate/owrocanalysis.py
@@ -825,6 +825,13 @@
drop_intermediate=drop_intermediate
)
+ # skl sets the first threshold to the highest thr... | diff --git a/Orange/widgets/evaluate/tests/test_owrocanalysis.py b/Orange/widgets/evaluate/tests/test_owrocanalysis.py
--- a/Orange/widgets/evaluate/tests/test_owrocanalysis.py
+++ b/Orange/widgets/evaluate/tests/test_owrocanalysis.py
@@ -214,7 +214,7 @@
pos = view.mapFromScene(pos)
mouseMove(... | null | null | namanjain12/orange3_final:1eca4d67c0f8f44e706fe8fab1eea4d858ce51fd | true | null | 1 | 7 | null | 1,252 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.232 | 80.61475 | ||
8,832 | r2e_gym::train::5650 | r2e_gym | train | 5,650 | scrapy__51767655895f7b893be4c91df37a360f8285f056 | scrapy | scrapy/scrapy | python | 51767655895f7b893be4c91df37a360f8285f056 | **Unhandled Exceptions in Contract Methods Cause Test Errors**
**Description**
When a contract method raises an exception, it is not properly handled, leading to unrecorded errors in test results. This causes tests that use such contract methods to fail unexpectedly without clear error reporting.
**Example Code**
```... | diff --git a/scrapy/contracts/__init__.py b/scrapy/contracts/__init__.py
--- a/scrapy/contracts/__init__.py
+++ b/scrapy/contracts/__init__.py
@@ -42,7 +42,11 @@
requests = []
for method in self.tested_methods_from_spidercls(type(spider)):
bound_method = spider.__getattribute__(method)
- ... | diff --git a/tests/test_contracts.py b/tests/test_contracts.py
--- a/tests/test_contracts.py
+++ b/tests/test_contracts.py
@@ -25,6 +25,21 @@
url = 'http://scrapy.org'
+class CustomSuccessContract(Contract):
+ name = 'custom_success_contract'
+
+ def adjust_request_args(self, args):
+ args['url'] ... | null | null | namanjain12/scrapy_final:51767655895f7b893be4c91df37a360f8285f056 | true | null | 1 | 6 | null | 1,270 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.231667 | 80.61375 | ||
8,833 | r2e_gym::train::4239 | r2e_gym | train | 4,239 | numpy__d0224de082a7a1786bdf1df20fdc4e58990f9789 | numpy | numpy/numpy | python | d0224de082a7a1786bdf1df20fdc4e58990f9789 | **Title:** Accessing `bits` Attribute on `numpy.finfo` Raises AttributeError
**Description:**
When attempting to access the `bits` attribute of a `numpy.finfo` object, an `AttributeError` is raised, indicating that the attribute does not exist.
**Example Code:**
```python
import numpy as np
info = np.finfo(np.float6... | diff --git a/doc/release/1.12.0-notes.rst b/doc/release/1.12.0-notes.rst
--- a/doc/release/1.12.0-notes.rst
+++ b/doc/release/1.12.0-notes.rst
@@ -164,8 +164,8 @@
Generalized Ufuncs, including most of the linalg module, will now unlock
the Python global interpreter lock.
-np.roll can now roll multiple axes at the s... | diff --git a/numpy/core/tests/test_getlimits.py b/numpy/core/tests/test_getlimits.py
--- a/numpy/core/tests/test_getlimits.py
+++ b/numpy/core/tests/test_getlimits.py
@@ -42,6 +42,19 @@
ftype2 = finfo(longdouble)
assert_equal(id(ftype), id(ftype2))
+class TestFinfo(TestCase):
+ def test_basic(sel... | null | null | namanjain12/numpy_final:d0224de082a7a1786bdf1df20fdc4e58990f9789 | true | null | 2 | 26 | null | 870 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.231667 | 80.61375 | ||
8,834 | r2e_gym::train::5261 | r2e_gym | train | 5,261 | pyramid__22f0ebbc04f1fa03139ca7c99e02e39a2635590f | pyramid | pylons/pyramid | python | 22f0ebbc04f1fa03139ca7c99e02e39a2635590f | **Title:** Spaces in URL anchors encoded as '+' instead of '%20' causing inconsistencies
**Description:**
When generating URLs with anchor values that include spaces, the spaces are being encoded as '+' instead of the expected '%20'. This leads to unexpected URL formats and can cause issues with URL parsing and handli... | diff --git a/pyramid/encode.py b/pyramid/encode.py
--- a/pyramid/encode.py
+++ b/pyramid/encode.py
@@ -6,8 +6,13 @@
url_quote_plus as _quote_plus,
)
-def url_quote(s, safe=''): # bw compat api
- return _url_quote(s, safe=safe)
+def url_quote(val, safe=''): # bw compat api
+ cls = val.__class__
+ if... | diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py
--- a/pyramid/tests/test_config/test_views.py
+++ b/pyramid/tests/test_config/test_views.py
@@ -3839,7 +3839,7 @@
result = inst.generate('package:path/abc def', request, a=1,
_anchor=u... | null | null | namanjain12/pyramid_final:22f0ebbc04f1fa03139ca7c99e02e39a2635590f | true | null | 2 | 21 | null | 969 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2315 | 80.61325 | ||
8,835 | r2e_gym::train::6565 | r2e_gym | train | 6,565 | pillow__318ff7d332ed47fbb25ec5f2c5dc805b7bce2765 | pillow | python-pillow/pillow | python | 318ff7d332ed47fbb25ec5f2c5dc805b7bce2765 | **Title:** Unable to Load `hopper.ras` and Other RGB Sun Raster Files
**Description:**
When attempting to open `hopper.ras`, an RGB Sun raster file, the image fails to load and raises an error. This issue affects the ability to work with RGB Sun raster files, preventing proper image processing.
**Example Code:**
```p... | diff --git a/PIL/SunImagePlugin.py b/PIL/SunImagePlugin.py
--- a/PIL/SunImagePlugin.py
+++ b/PIL/SunImagePlugin.py
@@ -48,16 +48,19 @@
self.size = i32(s[4:8]), i32(s[8:12])
depth = i32(s[12:16])
+ file_type = i32(s[20:24])
+
if depth == 1:
self.mode, rawmode = "1... | diff --git a/Tests/test_file_sun.py b/Tests/test_file_sun.py
--- a/Tests/test_file_sun.py
+++ b/Tests/test_file_sun.py
@@ -1,4 +1,4 @@
-from helper import unittest, PillowTestCase
+from helper import unittest, PillowTestCase, hopper
from PIL import Image, SunImagePlugin
@@ -16,11 +16,11 @@
# Assert
... | null | null | namanjain12/pillow_final:318ff7d332ed47fbb25ec5f2c5dc805b7bce2765 | true | null | 1 | 35 | null | 689 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2315 | 80.61325 | ||
8,836 | r2e_gym::train::6239 | r2e_gym | train | 6,239 | pillow__a0602fb68c62ccf3825b7cd074751153772cef70 | pillow | python-pillow/pillow | python | a0602fb68c62ccf3825b7cd074751153772cef70 | **Title:** Handling Full Transparency in Palette-Based PNGs Causes TypeError
**Description:**
When saving a fully transparent PNG image in palette mode, the transparency information is incorrectly stored as an integer instead of a sequence. This leads to a `TypeError` when attempting to determine its length.
**Exampl... | diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py
--- a/PIL/PngImagePlugin.py
+++ b/PIL/PngImagePlugin.py
@@ -74,8 +74,7 @@
}
-_simple_palette = re.compile(b'^\xff+\x00\xff*$')
-_null_palette = re.compile(b'^\x00*$')
+_simple_palette = re.compile(b'^\xff*\x00\xff*$')
# Maximum decompressed size for a i... | 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
@@ -203,6 +203,7 @@
def test_load_transparent_rgb(self):
test_file = "Tests/images/rgb_trns.png"
im = Image.open(test_file)
+ self.assertEqual(im.info["transparency"], (0,... | null | null | namanjain12/pillow_final:a0602fb68c62ccf3825b7cd074751153772cef70 | true | null | 2 | 23 | null | 927 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.231167 | 80.61225 | ||
8,837 | r2e_gym::train::5216 | r2e_gym | train | 5,216 | pyramid__813eb45a18fb040bf211b5bf1b0164d5dbca678c | pyramid | pylons/pyramid | python | 813eb45a18fb040bf211b5bf1b0164d5dbca678c | **Title:** IPv6 Addresses Cause ValueError in Authentication Digest Calculation
**Description:**
When using IPv6 addresses for authentication, the system raises a `ValueError` because it attempts to parse the IPv6 address as an IPv4 address. This prevents successful authentication for users with IPv6 addresses.
**Exa... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -192,3 +192,5 @@
- Robert Jackiewicz, 2012/11/12
- John Anderson, 2012/11/14
+
+- Bert JW Regeer, 2013/02/01
diff --git a/pyramid/authentication.py b/pyramid/authentication.py
--- a/pyramid/authentication.py
+++ b/pyra... | diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py
--- a/pyramid/tests/test_authentication.py
+++ b/pyramid/tests/test_authentication.py
@@ -561,9 +561,13 @@
helper.BadTicket = auth_tkt.BadTicket
return helper
- def _makeRequest(self, cookie=None):
+ def _... | null | null | namanjain12/pyramid_final:813eb45a18fb040bf211b5bf1b0164d5dbca678c | true | null | 2 | 20 | null | 986 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.231 | 80.61175 | ||
8,838 | r2e_gym::train::6478 | r2e_gym | train | 6,478 | pillow__9c6d0bdcb7c37a18b05aba6802b540960d7153e0 | pillow | python-pillow/pillow | python | 9c6d0bdcb7c37a18b05aba6802b540960d7153e0 | **Title:** `ImageOps.autocontrast()` Fails with Unexpected `mask` Keyword Argument
**Description:**
When using the `mask` parameter with `ImageOps.autocontrast()`, a `TypeError` is raised, preventing the function from applying contrast adjustments based on the mask.
**Example Code:**
```python
from PIL import Image, ... | diff --git a/docs/releasenotes/8.0.0.rst b/docs/releasenotes/8.0.0.rst
--- a/docs/releasenotes/8.0.0.rst
+++ b/docs/releasenotes/8.0.0.rst
@@ -50,6 +50,14 @@
API Additions
=============
+ImageOps.autocontrast: add mask parameter
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+:py:func:`.ImageOps.autocontrast` can now... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -1,6 +1,6 @@
import pytest
-from PIL import Image, ImageOps, features
+from PIL import Image, ImageDraw, ImageOps, ImageStat, features
from .helper import (
assert_image_equal,
@@ -25,7 +... | null | null | namanjain12/pillow_final:9c6d0bdcb7c37a18b05aba6802b540960d7153e0 | true | null | 2 | 21 | null | 966 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.231 | 80.61175 | ||
8,839 | swe_bench::test::1754 | swe_bench | test | 1,754 | sphinx-doc__sphinx-11316 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | db739afaeb6129676504e964ce287fe6becb3471 | Napoleon causes warning about missing end-string when encountering a reference on the first line of a docstring in a dataclass
### Describe the bug
When using `ext.napoleon`, a docstring of a dataclass attribute will cause an `Inline interpreted text or phrase reference start-string without end-string` warning for a r... | When using `sphinx.ext.napoleon`, the docstrings are assumed to follow either NumPy or Google docstrings. According to [[1]](#1) and [[2]](#2), docstrings used on attributes and placed *after* the attribute *may* specify their type first, followed by a colon, and then by whatever you want. In particular, if a colon is ... | diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py
--- a/sphinx/ext/napoleon/docstring.py
+++ b/sphinx/ext/napoleon/docstring.py
@@ -23,7 +23,9 @@
_single_colon_regex = re.compile(r'(?<!:):(?!:)')
_xref_or_code_regex = re.compile(
r'((?::(?:[a-zA-Z0-9]+[\-_+:.])*[a-zA-Z0-9]+:`.+?`)|... | diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py
--- a/tests/test_ext_napoleon_docstring.py
+++ b/tests/test_ext_napoleon_docstring.py
@@ -47,8 +47,8 @@ class TestNamedtupleSubclass:
def test_attributes_docstring(self):
config = Config()
actual = str(NumpyD... | ["tests/test_ext_napoleon_docstring.py::TestInlineAttribute::test_class_data_member_inline_no_type"] | ["tests/test_ext_napoleon_docstring.py::TestNamedtupleSubclass::test_attributes_docstring", "tests/test_ext_napoleon_docstring.py::TestInlineAttribute::test_class_data_member", "tests/test_ext_napoleon_docstring.py::TestInlineAttribute::test_class_data_member_inline", "tests/test_ext_napoleon_docstring.py::TestInlineAt... | null | true | 2023-04-11T14:20:08Z | 1 | 4 | 1 | 1,343 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.237167 | 80.6115 | |
8,840 | r2e_gym::train::4524 | r2e_gym | train | 4,524 | numpy__c23bd98de665733dd090636f38b6aacf9f99450b | numpy | numpy/numpy | python | c23bd98de665733dd090636f38b6aacf9f99450b | **Title:** `ix_` Function Overrides Specified dtype for Empty Arrays
**Description:**
When using the `ix_` function with empty arrays that have a specified `dtype`, the resulting array incorrectly defaults to `intp` instead of preserving the original `dtype`. This behavior leads to unexpected dtype changes, which can ... | 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
@@ -94,12 +94,13 @@
out = []
nd = len(args)
for k, new in enumerate(args):
- new = asarray(new)
+ if not isinstance(new, _nx.ndarray):
+ new = asarra... | 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
@@ -292,11 +292,16 @@
class TestIx_(object):
def test_regression_1(self):
- # Test empty inputs create outputs of indexing type, g... | null | null | namanjain12/numpy_final:c23bd98de665733dd090636f38b6aacf9f99450b | true | null | 1 | 9 | null | 1,204 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.230667 | 80.61075 | ||
8,841 | swe_bench::test::1187 | swe_bench | test | 1,187 | psf__requests-2466 | psf/requests | psf/requests | python | 461b740db6ae3d3ab1c5d975b657307f5c630fcb | Issue with pyinstaller
Can't seem to wrap my head around this.
having a problem compiling a windows exe in python 2.7.9 that uses the requests library and can't find anything on google about the specific error. My script runs fine from the interpreter but when i use pyinstaller, i get :ImportError: No module named 'r... | So it looks like pyinstaller isn't detecting an import of the standard library's `sys` module even though it finds `httplib`, `os` and others. You should see if anyone on [StackOverflow](https://stackoverflow.com) can help you with this (or if this is a bug in pyinstaller). It's certainly not a bug in requests though
... | diff --git a/requests/packages/__init__.py b/requests/packages/__init__.py
--- a/requests/packages/__init__.py
+++ b/requests/packages/__init__.py
@@ -27,9 +27,13 @@
class VendorAlias(object):
- def __init__(self):
+ def __init__(self, package_names):
+ self._package_names = package_names
sel... | diff --git a/test_requests.py b/test_requests.py
--- a/test_requests.py
+++ b/test_requests.py
@@ -1598,5 +1598,12 @@ def test_urllib3_retries():
with pytest.raises(RetryError):
s.get(httpbin('status/500'))
+def test_vendor_aliases():
+ from requests.packages import urllib3
+ from requests.package... | ["test_requests.py::RequestsTestCase::test_DIGEST_AUTH_RETURNS_COOKIE", "test_requests.py::RequestsTestCase::test_auth_is_retained_for_redirect_on_host", "test_requests.py::RequestsTestCase::test_auth_is_stripped_on_redirect_off_host", "test_requests.py::RequestsTestCase::test_cookie_quote_wrapped", "test_requests.py::... | ["test_requests.py::RequestsTestCase::test_BASICAUTH_TUPLE_HTTP_200_OK_GET", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_QUOTES_QOP_VALUE", "test_requests.py::RequestsTestCase::test_DIGESTAUTH_WRONG_HTTP_401_GET", "test_requests.py::RequestsTestCase::test_DIGEST_AUTH_SETS_SESSION_COOKIES", "test_requests.py::R... | null | true | 2015-02-28T16:53:27Z | 1 | 16 | 7 | 6,769 | 0 | 0.8 | 1 | 0.5 | 1 | 0.553333 | 80.61 | |
8,842 | r2e_gym::train::4082 | r2e_gym | train | 4,082 | coveragepy__2094909df35db45ca7a409cc37f38d49c3191d2a | coveragepy | nedbat/coveragepy | python | 2094909df35db45ca7a409cc37f38d49c3191d2a | **Title:** combine() Does Not Suppress Suffixes with `data_suffix=False` and Multiprocessing
**Description:**
When configuring Coverage with `data_suffix=False` and using multiprocessing for concurrency, the `combine()` method fails to suppress the suffixes as intended. This results in multiple `.coverage.*` files ins... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -37,6 +37,10 @@
- API: The exceptions raised by Coverage.py have been specialized, to provide
finer-grained catching of exceptions by third-party code.
+- API: Using ``suffix=False`` when constructing a Coverage object with
+ multiproc... | diff --git a/tests/test_api.py b/tests/test_api.py
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -1199,3 +1199,23 @@
assert files == {'foo.py', 'bar.py', os_sep('modsrc/__init__.py')}
res = cov.report()
assert res == 100
+
+ def test_combine_no_suffix_multiprocessing(self):
+ s... | null | null | namanjain12/coveragepy_final:2094909df35db45ca7a409cc37f38d49c3191d2a | true | null | 2 | 12 | null | 1,142 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.230333 | 80.60975 | ||
8,843 | r2e_gym::train::4330 | r2e_gym | train | 4,330 | numpy__0a476002600cb42068a899f4dc2cf0bc8cdb26d7 | numpy | numpy/numpy | python | 0a476002600cb42068a899f4dc2cf0bc8cdb26d7 | **Title: MaskedArray methods like copy and count fail with Python built-in types**
**Description:**
When using MaskedArray methods with Python built-in types such as lists and tuples, unexpected behaviors occur.
**Example Buggy Code:**
```python
import numpy as np
# Using copy with a list
result = np.ma.copy([1, 2,... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -6372,21 +6372,16 @@
def __call__(self, a, *args, **params):
if self.reversed:
args = list(args)
- arr = args[0]
- args[0] = a
- a = arr
- # Get the method... | 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
@@ -433,6 +433,11 @@
assert_not_equal(y._data.ctypes.data, x._data.ctypes.data)
assert_not_equal(y._mask.ctypes.data, x._mask.ctypes.data)
+ def test_copy_on_... | null | null | namanjain12/numpy_final:0a476002600cb42068a899f4dc2cf0bc8cdb26d7 | true | null | 1 | 23 | null | 920 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.23 | 80.60875 | ||
8,844 | r2e_gym::train::5371 | r2e_gym | train | 5,371 | aiohttp__b1091c35c381851f3fa200f4a9fe1c38c5dfb678 | aiohttp | aio-libs/aiohttp | python | b1091c35c381851f3fa200f4a9fe1c38c5dfb678 | **Title:** `WebSocketResponse` Missing `can_prepare` Method Causes AttributeError
**Description:**
When attempting to test WebSocket connections, calling the `can_prepare` method on a `WebSocketResponse` instance results in an `AttributeError`. This prevents proper validation of WebSocket upgrade requests and causes r... | diff --git a/aiohttp/web_ws.py b/aiohttp/web_ws.py
--- a/aiohttp/web_ws.py
+++ b/aiohttp/web_ws.py
@@ -86,7 +86,7 @@
self._post_start(request, parser, protocol, writer)
return resp_impl
- def can_start(self, request):
+ def can_prepare(self, request):
if self._writer is not None:
... | diff --git a/tests/test_web_websocket.py b/tests/test_web_websocket.py
--- a/tests/test_web_websocket.py
+++ b/tests/test_web_websocket.py
@@ -141,33 +141,33 @@
with self.assertRaises(RuntimeError):
ws.write(b'data')
- def test_can_start_ok(self):
+ def test_can_prepare_ok(self):
... | null | null | namanjain12/aiohttp_final:b1091c35c381851f3fa200f4a9fe1c38c5dfb678 | true | null | 1 | 8 | null | 1,218 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.229667 | 80.60775 | ||
8,845 | r2e_gym::train::5547 | r2e_gym | train | 5,547 | aiohttp__1c1c0ea353041c8814a6131c3a92978dc2373e52 | aiohttp | aio-libs/aiohttp | python | 1c1c0ea353041c8814a6131c3a92978dc2373e52 | **Title:** run_app() Logs Exceptions That Are Also Raised, Causing Duplicate Logging
**Description**
When using `run_app()` to start the aiohttp application, exceptions raised within the application context are being both raised and logged. This results in duplicate log entries for the same exception, making logs clut... | diff --git a/CHANGES/6807.bugfix.rst b/CHANGES/6807.bugfix.rst
--- a/CHANGES/6807.bugfix.rst
+++ b/CHANGES/6807.bugfix.rst
@@ -0,0 +1 @@
+Stopped logging exceptions from ``web.run_app()`` that would be raised regardless -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b... | diff --git a/tests/test_run_app.py b/tests/test_run_app.py
--- a/tests/test_run_app.py
+++ b/tests/test_run_app.py
@@ -9,7 +9,7 @@
import subprocess
import sys
import time
-from typing import Callable, NoReturn, Set
+from typing import AsyncIterator, Callable, NoReturn, Set
from unittest import mock
from uuid impo... | null | null | namanjain12/aiohttp_final:1c1c0ea353041c8814a6131c3a92978dc2373e52 | true | null | 2 | 14 | null | 1,096 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.229333 | 80.60675 | ||
8,846 | r2e_gym::train::5142 | r2e_gym | train | 5,142 | pyramid__92b456610438bdd94b7906683f8b2049fe5765bd | pyramid | pylons/pyramid | python | 92b456610438bdd94b7906683f8b2049fe5765bd | **[ISSUE]**
**Title:** PredicateMismatch exception lacks predicate details in the error message
**Description:**
When a view's predicate fails, the `PredicateMismatch` exception does not include details about which predicate caused the mismatch. This makes it difficult to debug issues related to predicate evaluations... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -54,3 +54,7 @@
result for the view being called. The uri format using an asset spec is
package:path/to/template#defname.mako. The old way of returning a tuple
from the view is supported for backward compatibility, ('defname', {}).
... | diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py
--- a/pyramid/tests/test_config/test_views.py
+++ b/pyramid/tests/test_config/test_views.py
@@ -2905,6 +2905,7 @@
view = lambda *arg: response
def predicate1(context, request):
return False
+ ... | null | null | namanjain12/pyramid_final:92b456610438bdd94b7906683f8b2049fe5765bd | true | null | 2 | 16 | null | 1,055 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.229167 | 80.60625 | ||
8,847 | r2e_gym::train::5219 | r2e_gym | train | 5,219 | pyramid__678f49d2e08b128785e32ed6fc9e12df4713ad7c | pyramid | pylons/pyramid | python | 678f49d2e08b128785e32ed6fc9e12df4713ad7c | **Title:** `principals_allowed_by_permission` Fails When `__acl__` Is Callable
**Description:**
When a resource's `__acl__` attribute is a callable function that returns an ACL list, the `principals_allowed_by_permission` method does not handle it correctly. Instead of invoking the callable to retrieve the ACL, it att... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -9,6 +9,11 @@
Previously saying ``pcreate -s starter /foo/bar/`` produced different output
than saying ``pcreate -s starter /foo/bar``. The former did not work
properly.
+
+- Fix the ``principals_allowed_by_permission`` method of ... | diff --git a/pyramid/tests/test_authorization.py b/pyramid/tests/test_authorization.py
--- a/pyramid/tests/test_authorization.py
+++ b/pyramid/tests/test_authorization.py
@@ -146,6 +146,19 @@
policy.principals_allowed_by_permission(context, 'read'))
self.assertEqual(result, ['chrism'])
+ def ... | null | null | namanjain12/pyramid_final:678f49d2e08b128785e32ed6fc9e12df4713ad7c | true | null | 2 | 8 | null | 1,214 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.229 | 80.60575 | ||
8,848 | r2e_gym::train::6403 | r2e_gym | train | 6,403 | pillow__a3f7ce5b7344b2f559474f3b8f2d3d5486de1d39 | pillow | python-pillow/pillow | python | a3f7ce5b7344b2f559474f3b8f2d3d5486de1d39 | **Title:** Cropping with Negative Coordinates Incorrectly Triggers DecompressionBombError
**Description:**
When attempting to crop an image using coordinates where the end points are less than the start points, the cropping operation incorrectly raises a `DecompressionBombError`. This prevents cropping even when the r... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1117,12 +1117,9 @@
x0, y0, x1, y1 = map(int, map(round, box))
- if x1 < x0:
- x1 = x0
- if y1 < y0:
- y1 = y0
-
- _decompression_bomb_check((x1, y1))
+ absolu... | 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
@@ -61,6 +61,29 @@
self.assert_warning(Image.DecompressionBombWarning,
self.src.crop, box)
+ def test_crop_decompressi... | null | null | namanjain12/pillow_final:a3f7ce5b7344b2f559474f3b8f2d3d5486de1d39 | true | null | 1 | 9 | null | 1,193 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.228833 | 80.60525 | ||
8,849 | r2e_gym::train::6383 | r2e_gym | train | 6,383 | pillow__8bd7e81b5d2ca75567aec961dd4e17e33daf6259 | pillow | python-pillow/pillow | python | 8bd7e81b5d2ca75567aec961dd4e17e33daf6259 | **AttributeError When Applying Transparency to P Mode Images**
When working with P mode images that include a "transparency" key in the info dictionary, attempting to apply transparency results in an AttributeError because the `apply_transparency` method is not available.
**Example Code:**
```python
from PIL import I... | diff --git a/docs/reference/Image.rst b/docs/reference/Image.rst
--- a/docs/reference/Image.rst
+++ b/docs/reference/Image.rst
@@ -123,6 +123,7 @@
.. automethod:: PIL.Image.Image.alpha_composite
+.. automethod:: PIL.Image.Image.apply_transparency
.. automethod:: PIL.Image.Image.convert
The following example co... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -849,6 +849,35 @@
im = Image.new("RGB", size)
assert im.tobytes() == b""
+ def test_apply_transparency(self):
+ im = Image.new("P", (1, 1))
+ im.putpalette((0, 0, 0, 1, 1, 1... | null | null | namanjain12/pillow_final:8bd7e81b5d2ca75567aec961dd4e17e33daf6259 | true | null | 3 | 32 | null | 732 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.228667 | 80.60475 | ||
8,850 | r2e_gym::train::5275 | r2e_gym | train | 5,275 | aiohttp__fc11fd22ce4b424d3897d2010415946e8194648f | aiohttp | aio-libs/aiohttp | python | fc11fd22ce4b424d3897d2010415946e8194648f | **Title:** PATH_INFO Incorrectly Unquoted, Causing Loss of Encoded Characters
**Description:**
When handling HTTP requests with percent-encoded paths, the server is unquoting the `PATH_INFO` environment variable. This results in decoded paths, which can lead to issues when the encoded characters are necessary for corr... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,10 +1,15 @@
CHANGES
=======
-0.10.2 (XX-XX-XXXX)
+0.10.3 (XX-XX-XXXX)
-------------------
- Add *endpoint* to aiohttp.web.UrlDispatcher
+
+0.10.2 (11-19-2014)
+-------------------
+
+- Don't unquote `environ['PATH_INFO']` in wsgi.p... | diff --git a/tests/test_wsgi.py b/tests/test_wsgi.py
--- a/tests/test_wsgi.py
+++ b/tests/test_wsgi.py
@@ -273,3 +273,11 @@
[c[1][0] for c in self.writer.write.mock_calls])
self.assertTrue(content.startswith(b'HTTP/1.0 200 OK'))
self.assertTrue(content.endswith(b'data'))
+
+ def test_d... | null | null | namanjain12/aiohttp_final:fc11fd22ce4b424d3897d2010415946e8194648f | true | null | 3 | 13 | null | 1,112 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.228667 | 80.60475 | ||
8,851 | r2e_gym::train::5098 | r2e_gym | train | 5,098 | pyramid__dfa449126a8cb87c58e6e7519df5aecf252d5127 | pyramid | pylons/pyramid | python | dfa449126a8cb87c58e6e7519df5aecf252d5127 | **Title:** `add_forbidden_view` Raises ConfigurationError When 'view' Argument Is Not Provided
**Description:**
When configuring a forbidden view without specifying the `view` argument, Pyramid raises a `ConfigurationError` instead of using a default exception response view. This behavior requires developers to always... | diff --git a/pyramid/config/views.py b/pyramid/config/views.py
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -1592,9 +1592,12 @@
config.add_forbidden_view(forbidden)
+ If ``view`` argument is not provided, the view callable defaults to
+ :func:`~pyramid.httpexceptions.def... | diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py
--- a/pyramid/tests/test_config/test_views.py
+++ b/pyramid/tests/test_config/test_views.py
@@ -1782,6 +1782,21 @@
request_iface=IRequest)
result = view(None, request)
s... | null | null | namanjain12/pyramid_final:dfa449126a8cb87c58e6e7519df5aecf252d5127 | true | null | 1 | 8 | null | 1,211 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2285 | 80.60425 | ||
8,852 | r2e_gym::train::4022 | r2e_gym | train | 4,022 | coveragepy__016af5f6352d69206ac8f7537c2b18828767bcae | coveragepy | nedbat/coveragepy | python | 016af5f6352d69206ac8f7537c2b18828767bcae | **Title:** Coverage Crashes with UnicodeEncodeError on Non-UTF8 Filenames
**Description:**
When using coverage.py to trace files, if a file has a non-UTF8 encodable filename, attempting to save the coverage data results in a crash with a `UnicodeEncodeError`. This occurs because coverage.py tries to encode the filenam... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -30,6 +30,11 @@
information about the config files read now shows absolute paths to the
files.
+- The handling of source files with non-encodable file names has changed.
+ Previously, if a file name could not be encoded as UTF-8, an ... | diff --git a/tests/test_oddball.py b/tests/test_oddball.py
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -3,6 +3,7 @@
"""Oddball cases for testing coverage.py"""
+import os.path
import sys
from flaky import flaky
@@ -562,6 +563,18 @@
self.assertEqual(statements, [31])
self.assert... | null | null | namanjain12/coveragepy_final:016af5f6352d69206ac8f7537c2b18828767bcae | true | null | 2 | 12 | null | 1,129 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.228167 | 80.60325 | ||
8,853 | r2e_gym::train::6529 | r2e_gym | train | 6,529 | pillow__d822d85af6d9b1c108650832d56b75cd86b2f5a9 | pillow | python-pillow/pillow | python | d822d85af6d9b1c108650832d56b75cd86b2f5a9 | **Title:** Saving and Loading JPEGs with Comments Raises `KeyError: 'COM'`
**Description:**
When saving a JPEG image without explicitly setting a comment, reopening the saved image results in a `KeyError` when accessing the `'COM'` field. This issue occurs because the comment metadata is not preserved during the save ... | diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py
--- a/src/PIL/JpegImagePlugin.py
+++ b/src/PIL/JpegImagePlugin.py
@@ -44,6 +44,7 @@
from . import Image, ImageFile, TiffImagePlugin
from ._binary import i16be as i16
from ._binary import i32be as i32
+from ._binary import o16be as o16
from ._binar... | 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
@@ -86,6 +86,18 @@
assert len(im.applist) == 2
assert im.info["comment"] == b"File written by Adobe Photoshop\xa8 4.0\x00"
+
+ def test_com_write(self):
+ dumm... | null | null | namanjain12/pillow_final:d822d85af6d9b1c108650832d56b75cd86b2f5a9 | true | null | 1 | 10 | null | 1,168 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.228 | 80.60275 | ||
8,854 | r2e_gym::train::6319 | r2e_gym | train | 6,319 | pillow__6f44ae1d27fa89a9e313e0da9dbfe3d129bb0763 | pillow | python-pillow/pillow | python | 6f44ae1d27fa89a9e313e0da9dbfe3d129bb0763 | **Title:** Unable to Set `size` Attribute on TIFF Images Raises AttributeError
**Description:**
When working with TIFF images using the Pillow library, attempting to modify the `size` attribute directly results in an `AttributeError`. This behavior prevents developers from adjusting the image size through the attribut... | diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py
--- a/src/PIL/TiffImagePlugin.py
+++ b/src/PIL/TiffImagePlugin.py
@@ -1049,6 +1049,19 @@
"Return the current frame number"
return self.__frame
+ @property
+ def size(self):
+ return self._size
+
+ @size.setter
+ ... | 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
@@ -68,6 +68,14 @@
ifd.legacy_api = None
self.assertEqual(str(e.exception),
"Not allowing setting of legacy api")
+
+ def test_size(self):
+ ... | null | null | namanjain12/pillow_final:6f44ae1d27fa89a9e313e0da9dbfe3d129bb0763 | true | null | 1 | 13 | null | 1,107 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227833 | 80.60225 | ||
8,855 | r2e_gym::train::440 | r2e_gym | train | 440 | orange3__a89c640a882cc4374207a39b7cf313fb7448809e | orange3 | biolab/orange3 | python | a89c640a882cc4374207a39b7cf313fb7448809e | **Title:** Missing 'data' Output in OWPCA Widget Causes AttributeError
**Description:**
When using the OWPCA widget, attempting to access the `'data'` output results in an `AttributeError` because the `'data'` output is not defined in the widget's outputs. This prevents users from retrieving the original dataset along... | diff --git a/Orange/widgets/unsupervised/owpca.py b/Orange/widgets/unsupervised/owpca.py
--- a/Orange/widgets/unsupervised/owpca.py
+++ b/Orange/widgets/unsupervised/owpca.py
@@ -31,6 +31,7 @@
class Outputs:
transformed_data = Output("Transformed Data", Table, replaces=["Transformed data"])
+ dat... | diff --git a/Orange/widgets/unsupervised/tests/test_owpca.py b/Orange/widgets/unsupervised/tests/test_owpca.py
--- a/Orange/widgets/unsupervised/tests/test_owpca.py
+++ b/Orange/widgets/unsupervised/tests/test_owpca.py
@@ -220,6 +220,28 @@
invalidate.assert_not_called()
self.assertEqual(widget.ncompon... | null | null | namanjain12/orange3_final:a89c640a882cc4374207a39b7cf313fb7448809e | true | null | 1 | 13 | null | 1,105 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2275 | 80.60125 | ||
8,856 | r2e_gym::train::4574 | r2e_gym | train | 4,574 | numpy__b074b21c326ecaa6b6519fc7dfcf54fa4e4457af | numpy | numpy/numpy | python | b074b21c326ecaa6b6519fc7dfcf54fa4e4457af | **Title:** TypeError When Using `subok` Parameter with `np.copy`
---
**Problem Description**
When attempting to copy a masked array using `np.copy` with the `subok` parameter, a `TypeError` is raised because the dispatcher does not recognize the `subok` keyword argument.
**Example Code**
```python
import numpy as ... | diff --git a/doc/release/upcoming_changes/15685.new_feature.rst b/doc/release/upcoming_changes/15685.new_feature.rst
--- a/doc/release/upcoming_changes/15685.new_feature.rst
+++ b/doc/release/upcoming_changes/15685.new_feature.rst
@@ -0,0 +1,9 @@
+``subok`` option for `numpy.copy`
+---------------------------------
+A ... | 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
@@ -272,6 +272,13 @@
a_fort_copy = np.copy(a_fort)
assert_(not a_fort_copy.flags.c_contiguous)
assert_(a_fort_copy... | null | null | namanjain12/numpy_final:b074b21c326ecaa6b6519fc7dfcf54fa4e4457af | true | null | 2 | 24 | null | 885 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2275 | 80.60125 | ||
8,857 | r2e_gym::train::4785 | r2e_gym | train | 4,785 | numpy__443a49a271e6d7c4c1dda72fe721eaed318ff764 | numpy | numpy/numpy | python | 443a49a271e6d7c4c1dda72fe721eaed318ff764 | **Title:** `np.nanmedian` Fails to Handle Arrays Containing `inf` Values Correctly
**Description:**
When using `np.nanmedian` on arrays that include `inf` (infinity) and `nan` (Not a Number) values, the function does not return the expected median values. Specifically, the presence of `inf` should propagate through th... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5073,7 +5073,11 @@
return self
if fill_value is None:
if endwith:
- filler = minimum_fill_value(self)
+ # nan > inf
+ ... | diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py
--- a/numpy/lib/tests/test_nanfunctions.py
+++ b/numpy/lib/tests/test_nanfunctions.py
@@ -645,6 +645,22 @@
assert_raises(IndexError, np.nanmedian, d, axis=(0, 4))
assert_raises(ValueError, np.nanmedian, d, axis=(1... | null | null | namanjain12/numpy_final:443a49a271e6d7c4c1dda72fe721eaed318ff764 | true | null | 2 | 25 | null | 865 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2275 | 80.60125 | ||
8,858 | r2e_gym::train::344 | r2e_gym | train | 344 | orange3__03cbf86eae6dc470698eab26351b752669000651 | orange3 | biolab/orange3 | python | 03cbf86eae6dc470698eab26351b752669000651 | ### Title: Error and Incorrect Color Assignments for Discrete Variables with Over 256 Values
#### Description
When creating a `LimitedDiscretePalette` with more than 256 colors, an `IndexError` occurs, causing the palette initialization to fail. Additionally, assigning colors to discrete variables with a large number ... | diff --git a/Orange/widgets/utils/colorpalettes.py b/Orange/widgets/utils/colorpalettes.py
--- a/Orange/widgets/utils/colorpalettes.py
+++ b/Orange/widgets/utils/colorpalettes.py
@@ -176,11 +176,15 @@
"use 'force_glasbey' instead", DeprecationWarning)
if force_glasbey or force_hsv \
... | diff --git a/Orange/widgets/utils/tests/test_colorpalettes.py b/Orange/widgets/utils/tests/test_colorpalettes.py
--- a/Orange/widgets/utils/tests/test_colorpalettes.py
+++ b/Orange/widgets/utils/tests/test_colorpalettes.py
@@ -158,6 +158,27 @@
palette = LimitedDiscretePalette(100)
np.testing.assert_... | null | null | namanjain12/orange3_final:03cbf86eae6dc470698eab26351b752669000651 | true | null | 1 | 10 | null | 1,165 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2275 | 80.60125 | ||
8,859 | r2e_gym::train::4887 | r2e_gym | train | 4,887 | numpy__7127cdfb8553030ba317455c9f31fe4d7ed74e81 | numpy | numpy/numpy | python | 7127cdfb8553030ba317455c9f31fe4d7ed74e81 | **[ISSUE]**
**Title:** `trim_zeros` Raises ValueError for Non-Boolean Compatible Input Arrays
**Description:**
When using the `trim_zeros` function with input arrays that are not inherently boolean compatible, such as arrays of strings, the function raises a `ValueError`. This issue occurs because the function attemp... | diff --git a/doc/release/upcoming_changes/16911.deprecation.rst b/doc/release/upcoming_changes/16911.deprecation.rst
--- a/doc/release/upcoming_changes/16911.deprecation.rst
+++ b/doc/release/upcoming_changes/16911.deprecation.rst
@@ -4,4 +4,4 @@
following two properties:
* It must be 1D.
-* It must be convertable ... | diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py
--- a/numpy/core/tests/test_deprecations.py
+++ b/numpy/core/tests/test_deprecations.py
@@ -710,15 +710,19 @@
class TestTrimZeros(_DeprecationTestCase):
# Numpy 1.20.0, 2020-07-31
- @pytest.mark.parametrize("arr", [np.... | null | null | namanjain12/numpy_final:7127cdfb8553030ba317455c9f31fe4d7ed74e81 | true | null | 2 | 10 | null | 1,165 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2275 | 80.60125 | ||
8,860 | r2e_gym::train::6521 | r2e_gym | train | 6,521 | pillow__80dbd3b193c7149a20ecac0a08c33eb47d4ad76d | pillow | python-pillow/pillow | python | 80dbd3b193c7149a20ecac0a08c33eb47d4ad76d | **Title:** Missing `cover` Method in `PIL.ImageOps` Causes AttributeError
**Description:**
When attempting to use the `cover` method from the `PIL.ImageOps` module to resize images while maintaining their aspect ratio, an `AttributeError` is raised because the method does not exist.
**Example Code:**
```python
from P... | diff --git a/docs/reference/ImageOps.rst b/docs/reference/ImageOps.rst
--- a/docs/reference/ImageOps.rst
+++ b/docs/reference/ImageOps.rst
@@ -13,6 +13,7 @@
.. autofunction:: autocontrast
.. autofunction:: colorize
.. autofunction:: contain
+.. autofunction:: cover
.. autofunction:: pad
.. autofunction:: crop
.. ... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -38,6 +38,9 @@
ImageOps.contain(hopper("L"), (128, 128))
ImageOps.contain(hopper("RGB"), (128, 128))
+
+ ImageOps.cover(hopper("L"), (128, 128))
+ ImageOps.cover(hopper("RGB"), (12... | null | null | namanjain12/pillow_final:80dbd3b193c7149a20ecac0a08c33eb47d4ad76d | true | null | 2 | 32 | null | 724 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227333 | 80.60075 | ||
8,861 | r2e_gym::train::4203 | r2e_gym | train | 4,203 | numpy__e141d9074e95bbdaa33ce727e9c9baa33d00875a | numpy | numpy/numpy | python | e141d9074e95bbdaa33ce727e9c9baa33d00875a | **Title:** Deepcopy of Masked Arrays with Object Dtype Alters Original Data and Raises Errors
**Description:**
When attempting to create a deep copy of a masked array with `object` dtype, modifications to the copied array inadvertently affect the original array. Additionally, deepcopy operations can raise errors relat... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2870,7 +2870,13 @@
_data._mask = _data._mask.copy()
# Reset the shape of the original mask
if getmask(data) is not nomask:
- data._mask... | 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
@@ -8,6 +8,7 @@
import sys
import warnings
+import copy
import operator
import itertools
import textwrap
@@ -5570,3 +5571,47 @@
original note"""
assert_equal(np.ma.co... | null | null | namanjain12/numpy_final:e141d9074e95bbdaa33ce727e9c9baa33d00875a | true | null | 1 | 14 | null | 1,084 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227333 | 80.60075 | ||
8,862 | r2e_gym::train::6177 | r2e_gym | train | 6,177 | pillow__1ee30ded0b672c8e8862720ec1dc71825db8ca81 | pillow | python-pillow/pillow | python | 1ee30ded0b672c8e8862720ec1dc71825db8ca81 | **Title: Palette Reloading Incorrectly Alters Palette Mode and Transparency**
**Description:**
When reloading an image's palette, the palette mode is unexpectedly modified, and the palette data is processed incorrectly. This results in inaccurate transparency information and causes the converted image to differ from ... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1834,23 +1834,19 @@
m_im = self.copy()
m_im.mode = "P"
- m_im.palette = ImagePalette.ImagePalette(
- "RGB", palette=mapping_palette * 3, size=768
- )
+ m_im.palette = Im... | diff --git a/Tests/test_image_convert.py b/Tests/test_image_convert.py
--- a/Tests/test_image_convert.py
+++ b/Tests/test_image_convert.py
@@ -93,7 +93,7 @@
im_l.save(f)
im_rgb = im.convert("RGB")
- assert im_rgb.info["transparency"] == (0, 0, 0) # undone
+ assert im_rgb.info["transparency"] == (0, 1... | null | null | namanjain12/pillow_final:1ee30ded0b672c8e8862720ec1dc71825db8ca81 | true | null | 2 | 12 | null | 1,123 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227167 | 80.60025 | ||
8,863 | r2e_gym::train::429 | r2e_gym | train | 429 | orange3__39cdce60dc81c3b8524e578c34d17eab61d02fe5 | orange3 | biolab/orange3 | python | 39cdce60dc81c3b8524e578c34d17eab61d02fe5 | **Title:** Statistics Utility Incorrectly Counts Zeros as NaNs, Leading to Inaccurate Calculations
**Description:**
In the statistical utilities, zeros are being mistakenly counted as NaN (Not a Number) values. This miscount affects the accuracy of statistical measures such as mean, variance, and the count of valid en... | diff --git a/Orange/statistics/util.py b/Orange/statistics/util.py
--- a/Orange/statistics/util.py
+++ b/Orange/statistics/util.py
@@ -344,31 +344,22 @@
if X.size and is_numeric:
if is_sparse:
+ nans = countnans(X, axis=0)
X = X.tocsc()
+ else:
+ nans = np.isnan... | 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
@@ -107,26 +107,26 @@
def test_stats_sparse(self):
X = csr_matrix(np.identity(5))
- np.testing.assert_equal(stats(X), [[0, 1, .2, 0, 4, 1],
- ... | null | null | namanjain12/orange3_final:39cdce60dc81c3b8524e578c34d17eab61d02fe5 | true | null | 1 | 19 | null | 983 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227167 | 80.60025 | ||
8,864 | r2e_gym::train::6646 | r2e_gym | train | 6,646 | pillow__e107af41a9b640e1f183e95e4bec809606e6b81a | pillow | python-pillow/pillow | python | e107af41a9b640e1f183e95e4bec809606e6b81a | **Title:** ImageGrab.grabclipboard() Unsupported on Linux Without wl-paste or xclip
**Description:**
On Linux systems, attempting to use `ImageGrab.grabclipboard()` raises a `NotImplementedError`, indicating that the function is only available on macOS and Windows. This limitation prevents users from accessing clipboa... | diff --git a/src/PIL/ImageGrab.py b/src/PIL/ImageGrab.py
--- a/src/PIL/ImageGrab.py
+++ b/src/PIL/ImageGrab.py
@@ -132,4 +132,18 @@
return BmpImagePlugin.DibImageFile(data)
return None
else:
- raise NotImplementedError("ImageGrab.grabclipboard() is macOS and Windows only")
+ ... | diff --git a/Tests/test_imagegrab.py b/Tests/test_imagegrab.py
--- a/Tests/test_imagegrab.py
+++ b/Tests/test_imagegrab.py
@@ -64,9 +64,13 @@
)
p.communicate()
else:
- with pytest.raises(NotImplementedError) as e:
- ImageGrab.grabclipboard()
- asse... | null | null | namanjain12/pillow_final:e107af41a9b640e1f183e95e4bec809606e6b81a | true | null | 1 | 16 | null | 1,042 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227 | 80.59975 | ||
8,865 | r2e_gym::train::4910 | r2e_gym | train | 4,910 | datalad__d6c9d4270020ec244bd1b722a12fc1032c26e473 | datalad | datalad/datalad | python | d6c9d4270020ec244bd1b722a12fc1032c26e473 | **Title:** TypeError when processing output: `'str' does not support the buffer interface`
**Description:**
When processing the remaining output, passing a bytes-like object causes a `TypeError` because a string is used where a bytes object is expected. This issue arises when the code attempts to split the output usin... | diff --git a/datalad/cmd.py b/datalad/cmd.py
--- a/datalad/cmd.py
+++ b/datalad/cmd.py
@@ -24,7 +24,7 @@
from collections import OrderedDict
from six import PY3, PY2
-from six import string_types, binary_type
+from six import string_types, binary_type, text_type
from os.path import abspath, isabs, pathsep, exists
... | diff --git a/datalad/tests/test_cmd.py b/datalad/tests/test_cmd.py
--- a/datalad/tests/test_cmd.py
+++ b/datalad/tests/test_cmd.py
@@ -1,4 +1,4 @@
-# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
+# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs... | null | null | namanjain12/datalad_final:d6c9d4270020ec244bd1b722a12fc1032c26e473 | true | null | 1 | 16 | null | 1,042 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227 | 80.59975 | ||
8,866 | r2e_gym::train::208 | r2e_gym | train | 208 | orange3__b3c1e8cd77d836813c2330888b77b915a81b664d | orange3 | biolab/orange3 | python | b3c1e8cd77d836813c2330888b77b915a81b664d | **Title:** Accessing `array_with_unknowns` on `Continuous` Object Raises AttributeError
**Description:**
When attempting to access the `array_with_unknowns` property of a `Continuous` object, an `AttributeError` is raised because the property does not exist. This prevents users from retrieving all values, including un... | diff --git a/Orange/statistics/contingency.py b/Orange/statistics/contingency.py
--- a/Orange/statistics/contingency.py
+++ b/Orange/statistics/contingency.py
@@ -225,6 +225,18 @@
"Fallback method for computation of contingencies is not implemented yet"
)
+ @property
+ def array_wi... | diff --git a/Orange/tests/test_contingency.py b/Orange/tests/test_contingency.py
--- a/Orange/tests/test_contingency.py
+++ b/Orange/tests/test_contingency.py
@@ -164,6 +164,32 @@
[0., 0., 1., 0., 0., 0., 0., 0., 1., 5., 5., 5., 2., 9., 6., 2.,
3., 4., 2., 1., 1., 1., 1.])
self.asser... | null | null | namanjain12/orange3_final:b3c1e8cd77d836813c2330888b77b915a81b664d | true | null | 1 | 12 | null | 1,122 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.227 | 80.59975 | ||
8,867 | r2e_gym::train::5872 | r2e_gym | train | 5,872 | tornado__4f0d837ed2776eddaeb8c80b3224daf97ff35c54 | tornado | tornadoweb/tornado | python | 4f0d837ed2776eddaeb8c80b3224daf97ff35c54 | **Title:** `gen.moment` AttributeError: `'tornado.gen'` Has No Attribute `moment`
**Description:**
I'm encountering an `AttributeError` when attempting to use `gen.moment` in my Tornado application. The error message indicates that the `'tornado.gen'` module does not have an attribute named `moment`.
**Example Code C... | diff --git a/docs/gen.rst b/docs/gen.rst
--- a/docs/gen.rst
+++ b/docs/gen.rst
@@ -37,6 +37,9 @@
.. autofunction:: maybe_future
+ .. autodata:: moment
+ :annotation:
+
Other classes
-------------
diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -502,6 +5... | 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
@@ -774,6 +774,31 @@
result = yield f2()
self.assertEqual(result, 42)
self.finished = True
+
+ @gen_test
+ def test_moment(self):
+ calls = []
+ @... | null | null | namanjain12/tornado_final:4f0d837ed2776eddaeb8c80b3224daf97ff35c54 | true | null | 3 | 19 | null | 980 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226667 | 80.59875 | ||
8,868 | r2e_gym::train::4384 | r2e_gym | train | 4,384 | numpy__68563e997aab1208c71efec5698c24214d840cda | numpy | numpy/numpy | python | 68563e997aab1208c71efec5698c24214d840cda | **Title:** `np.delete` Does Not Raise Error for Out-of-Bounds Indices When Using a List
**Description:**
Using `np.delete` with a list of indices that are out of the array's bounds does not raise an `IndexError` as expected. Instead, it only issues a `DeprecationWarning` and returns the original array unchanged. This ... | diff --git a/doc/release/upcoming_changes/15804.expired.rst b/doc/release/upcoming_changes/15804.expired.rst
--- a/doc/release/upcoming_changes/15804.expired.rst
+++ b/doc/release/upcoming_changes/15804.expired.rst
@@ -0,0 +1,8 @@
+`numpy.delete` no longer ignores out-of-bounds indices
+--------------------------------... | 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
@@ -807,7 +807,6 @@
# NOTE: The cast should be removed after warning phase for bools
if not isinstance(indices, (slice, int... | null | null | namanjain12/numpy_final:68563e997aab1208c71efec5698c24214d840cda | true | null | 2 | 25 | null | 859 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2265 | 80.59825 | ||
8,869 | r2e_gym::train::6078 | r2e_gym | train | 6,078 | pillow__fdf103c5ad2cb3fe710e16f2fa3019262d088818 | pillow | python-pillow/pillow | python | fdf103c5ad2cb3fe710e16f2fa3019262d088818 | **Title:** `ImageDraw` object has no attribute `circle` when attempting to draw a circle
**Description:**
When trying to draw a circle using the `ImageDraw` class, an `AttributeError` is raised because the `circle` method does not exist.
**Example Code:**
```python
from PIL import Image, ImageDraw
# Create a new ima... | diff --git a/docs/reference/ImageDraw.rst b/docs/reference/ImageDraw.rst
--- a/docs/reference/ImageDraw.rst
+++ b/docs/reference/ImageDraw.rst
@@ -226,6 +226,18 @@
:param width: The line width, in pixels.
.. versionadded:: 5.3.0
+
+.. py:method:: ImageDraw.circle(xy, radius, fill=None, outline=None, wid... | diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py
--- a/Tests/test_imagedraw.py
+++ b/Tests/test_imagedraw.py
@@ -2,6 +2,7 @@
import contextlib
import os.path
+from typing import Sequence
import pytest
@@ -263,6 +264,21 @@
# Assert
assert_image_equal_tofile(im, "Tests/images/imagedraw_... | null | null | namanjain12/pillow_final:fdf103c5ad2cb3fe710e16f2fa3019262d088818 | true | null | 3 | 26 | null | 838 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226333 | 80.59775 | ||
8,870 | r2e_gym::train::4482 | r2e_gym | train | 4,482 | numpy__efa1bd2c0de6cd9c07b410002f2e1c0bae8cf385 | numpy | numpy/numpy | python | efa1bd2c0de6cd9c07b410002f2e1c0bae8cf385 | **Title:** `np.gradient` Incorrectly Accepts Lists for the `axis` Parameter
**Description:**
When using the `axis` parameter in `np.gradient`, providing a list of axes is currently accepted. This behavior is unintended and can lead to unexpected results or misuse of the function. The `axis` parameter is expected to r... | 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
@@ -1679,21 +1679,10 @@
axes = kwargs.pop('axis', None)
if axes is None:
axes = tuple(range(N))
- # check axes to have correct type and no duplicate entries
- i... | 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
@@ -902,9 +902,9 @@
# test maximal number of varargs
assert_raises(TypeError, gradient, x, 1, 2, axis=1)
- assert_... | null | null | namanjain12/numpy_final:efa1bd2c0de6cd9c07b410002f2e1c0bae8cf385 | true | null | 1 | 15 | null | 1,058 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226333 | 80.59775 | ||
8,871 | r2e_gym::train::6117 | r2e_gym | train | 6,117 | pillow__0a49ec1cc0882989900eb597c53a73d35a58e18e | pillow | python-pillow/pillow | python | 0a49ec1cc0882989900eb597c53a73d35a58e18e | **Title:** PIL.Image Causes AttributeError When Rendering text/plain Output in Jupyter
**Description:**
When attempting to display a PIL `Image` in a Jupyter Notebook using the text/plain representation, an `AttributeError` is raised. This issue arises because the `Image` class lacks the `_repr_pretty_` method, resul... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -639,6 +639,22 @@
self.size[0],
self.size[1],
id(self),
+ )
+
+ def _repr_pretty_(self, p, cycle):
+ """IPython plain text display support"""
+
+ # Same as __r... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -89,6 +89,17 @@
# with pytest.raises(MemoryError):
# Image.new("L", (1000000, 1000000))
+ def test_repr_pretty(self):
+ class Pretty:
+ def text(self, text):
+ ... | null | null | namanjain12/pillow_final:0a49ec1cc0882989900eb597c53a73d35a58e18e | true | null | 1 | 16 | null | 1,038 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226333 | 80.59775 | ||
8,872 | r2e_gym::train::4829 | r2e_gym | train | 4,829 | numpy__22ae19366cf04a80d3e1ecc039d775656718a668 | numpy | numpy/numpy | python | 22ae19366cf04a80d3e1ecc039d775656718a668 | **Title:** Passing `subok=True` to `as_strided` Raises TypeError
**Description:**
When using the `as_strided` function with the `subok=True` argument, a `TypeError` is raised because the function does not accept the `subok` keyword.
**Example Code:**
```python
import numpy as np
class MyArray(np.ndarray):
pass
... | 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
@@ -20,9 +20,11 @@
self.__array_interface__ = interface
self.base = base
-def as_strided(x, shape=None, strides=None):
+def as_strided(x, shape=None, strides=None, s... | 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
@@ -3,7 +3,7 @@
import numpy as np
from numpy.testing import (
run_module_suite, assert_equal, assert_array_equal,
- assert_raises
... | null | null | namanjain12/numpy_final:22ae19366cf04a80d3e1ecc039d775656718a668 | true | null | 1 | 28 | null | 797 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226167 | 80.59725 | ||
8,873 | r2e_gym::train::6642 | r2e_gym | train | 6,642 | pillow__caf53b05ec1d8fdb7b19eb2df6d64a56bcb4c916 | pillow | python-pillow/pillow | python | caf53b05ec1d8fdb7b19eb2df6d64a56bcb4c916 | **Title:** TIFF Images Saved Without ICC Color Profiles When Using Compression=raw
**Description:**
When attempting to save TIFF images with an ICC color profile and specifying `compression='raw'`, the ICC profile is not included in the saved file. This results in TIFFs that lack the intended color profile information... | diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py
--- a/PIL/TiffImagePlugin.py
+++ b/PIL/TiffImagePlugin.py
@@ -1366,10 +1366,10 @@
ifd[key] = im.tag_v2[key]
ifd.tagtype[key] = im.tag_v2.tagtype[key]
- # preserve ICC profile (should also work when saving other forma... | 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
@@ -499,5 +499,21 @@
with Image.open(mp) as im:
self.assertEqual(im.n_frames, 3)
+ def test_saving_icc_profile(self):
+ # Tests saving TIFF with icc_profile set.
+... | null | null | namanjain12/pillow_final:caf53b05ec1d8fdb7b19eb2df6d64a56bcb4c916 | true | null | 1 | 8 | null | 1,197 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226167 | 80.59725 | ||
8,874 | r2e_gym::train::4028 | r2e_gym | train | 4,028 | coveragepy__731e9a776539dde46ca4c626ed67a5a09e0fe76a | coveragepy | nedbat/coveragepy | python | 731e9a776539dde46ca4c626ed67a5a09e0fe76a | **Title:** AttributeError when stdout lacks `isatty` method
**Description:**
When `stdout` is replaced with an object that doesn't implement the `isatty` method, calling the `stdout_link` function results in an `AttributeError`. This occurs because the function assumes that `stdout` always has the `isatty` attribute.
... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,7 +20,9 @@
Unreleased
----------
-Nothing yet.
+- Fix: ``html_report()`` could fail with an AttributeError on ``isatty`` if run
+ in an unusual environment where sys.stdout had been replaced. This is now
+ fixed.
.. scriv-star... | diff --git a/tests/test_misc.py b/tests/test_misc.py
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -6,6 +6,7 @@
from __future__ import annotations
import sys
+from typing import Any
from unittest import mock
import pytest
@@ -165,3 +166,19 @@
def test_stdout_link_not_tty() -> None:
# Without mockin... | null | null | namanjain12/coveragepy_final:731e9a776539dde46ca4c626ed67a5a09e0fe76a | true | null | 2 | 6 | null | 1,236 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226 | 80.59675 | ||
8,875 | r2e_gym::train::5240 | r2e_gym | train | 5,240 | pyramid__b2c23953cc5142238879e0075c065f31a268a770 | pyramid | pylons/pyramid | python | b2c23953cc5142238879e0075c065f31a268a770 | **Title:** Invalid Signature Error When Using Non-ASCII Characters in Session Secret
**Description:**
When using a secret containing non-ASCII characters for signing sessions, serialization and deserialization fail due to mismatched signatures.
**Example Buggy Code:**
```python
def signed_serialize(data, secret):
... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,9 @@
- Avoid crash in ``pserve --reload`` under Py3k, when iterating over posiibly
mutated ``sys.modules``.
+
+- ``UnencryptedCookieSessionFactoryConfig`` failed if the secret contained
+ higher order characters. See https://gi... | 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
@@ -519,7 +519,7 @@
from pyramid.compat import native_
from pyramid.compat import pickle
pickled = pickle.dumps(data, pickle.HIGHEST_PROTOCOL)
- sig = hmac... | null | null | namanjain12/pyramid_final:b2c23953cc5142238879e0075c065f31a268a770 | true | null | 2 | 9 | null | 1,176 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.226 | 80.59675 | ||
8,876 | r2e_gym::train::6408 | r2e_gym | train | 6,408 | pillow__b50f63430f32e9c4821a8598d57e3eca5c1c0425 | pillow | python-pillow/pillow | python | b50f63430f32e9c4821a8598d57e3eca5c1c0425 | **Title:** `getrgb` Function Fails to Parse HSV Color Strings
**Description:**
When attempting to parse HSV color strings using the `ImageColor.getrgb` function, a `ValueError` is raised, indicating that the color specifier is unknown. This prevents the use of HSV color definitions within the library.
**Example Code:... | diff --git a/docs/reference/ImageColor.rst b/docs/reference/ImageColor.rst
--- a/docs/reference/ImageColor.rst
+++ b/docs/reference/ImageColor.rst
@@ -31,6 +31,11 @@
(black=0%, normal=50%, white=100%). For example, ``hsl(0,100%,50%)`` is pure
red.
+* Hue-Saturation-Value (HSV) functions, given as ``hsv(hue, sat... | diff --git a/Tests/test_imagecolor.py b/Tests/test_imagecolor.py
--- a/Tests/test_imagecolor.py
+++ b/Tests/test_imagecolor.py
@@ -78,9 +78,16 @@
self.assertEqual((255, 0, 0), ImageColor.getrgb("hsl(360,100%,50%)"))
self.assertEqual((0, 255, 255), ImageColor.getrgb("hsl(180,100%,50%)"))
+ sel... | null | null | namanjain12/pillow_final:b50f63430f32e9c4821a8598d57e3eca5c1c0425 | true | null | 2 | 19 | null | 975 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.225833 | 80.59625 | ||
8,877 | swe_bench::test::1634 | swe_bench | test | 1,634 | scikit-learn__scikit-learn-14125 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | c0c53137cec61a4d6cd72d8a43bbe0321476e440 | [MRG] Fix 'SparseSeries deprecated: scipy-dev failing on travis' #14002
#### Reference Issues/PRs
Fixes #14002
Issue: SparseSeries deprecated: scipy-dev failing on travis
#### What does this implement/fix? Explain your changes.
Use a Series with sparse values instead instead of `SparseSeries`.
#### Any other comment... | I'm not sure why codecov/patch failed on this commit
> I'm not sure why codecov/patch failed on this commit
The build which using pandas is failing on Azure. You should check if there is a change of behaviour with the new code (maybe we need to change the error message). The codecov failure is due to the Azure fai... | diff --git a/sklearn/utils/multiclass.py b/sklearn/utils/multiclass.py
--- a/sklearn/utils/multiclass.py
+++ b/sklearn/utils/multiclass.py
@@ -240,9 +240,9 @@ def type_of_target(y):
raise ValueError('Expected array-like (array or non-string sequence), '
'got %r' % y)
- sparseseri... | diff --git a/sklearn/utils/tests/test_multiclass.py b/sklearn/utils/tests/test_multiclass.py
--- a/sklearn/utils/tests/test_multiclass.py
+++ b/sklearn/utils/tests/test_multiclass.py
@@ -2,7 +2,7 @@
import numpy as np
import scipy.sparse as sp
from itertools import product
-
+import pytest
from scipy.sparse impor... | ["sklearn/utils/tests/test_multiclass.py::test_type_of_target_pandas_sparse"] | ["sklearn/utils/tests/test_multiclass.py::test_unique_labels", "sklearn/utils/tests/test_multiclass.py::test_unique_labels_non_specific", "sklearn/utils/tests/test_multiclass.py::test_unique_labels_mixed_types", "sklearn/utils/tests/test_multiclass.py::test_is_multilabel", "sklearn/utils/tests/test_multiclass.py::test_... | null | true | 2019-06-19T15:48:38Z | 1 | 6 | 1 | 322 | 0 | 0.8 | 1 | 0.55 | 1 | 0.073667 | 80.596 | |
8,878 | r2e_gym::train::5226 | r2e_gym | train | 5,226 | pyramid__7410250313f893e5952bb2697324a4d4e3d47d22 | pyramid | pylons/pyramid | python | 7410250313f893e5952bb2697324a4d4e3d47d22 | **Title:** FileNotFoundError When Using Asset Specifications in ManifestCacheBuster
**Description:**
Initializing `ManifestCacheBuster` with an asset specification for the manifest path results in a `FileNotFoundError`. The system fails to resolve the asset spec to an absolute file path, preventing the manifest from ... | diff --git a/pyramid/static.py b/pyramid/static.py
--- a/pyramid/static.py
+++ b/pyramid/static.py
@@ -19,7 +19,10 @@
from repoze.lru import lru_cache
-from pyramid.asset import resolve_asset_spec
+from pyramid.asset import (
+ abspath_from_asset_spec,
+ resolve_asset_spec,
+)
from pyramid.compat import t... | diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py
--- a/pyramid/tests/test_static.py
+++ b/pyramid/tests/test_static.py
@@ -423,6 +423,20 @@
fut('foo', ('css', 'main.css'), {}),
(['css', 'main-test.css'], {}))
+ def test_it_with_relspec(self):
+ fut = self._m... | null | null | namanjain12/pyramid_final:7410250313f893e5952bb2697324a4d4e3d47d22 | true | null | 1 | 22 | null | 914 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.225667 | 80.59575 | ||
8,879 | r2e_gym::train::5246 | r2e_gym | train | 5,246 | pyramid__5c05cd9837adcd9b0ee0ee775added2a6d3b6688 | pyramid | pylons/pyramid | python | 5c05cd9837adcd9b0ee0ee775added2a6d3b6688 | **Title:** Finished callbacks are not invoked when closing the request
**Description:**
When a finished callback is added to a request, it is expected to be executed upon closing the request. However, the callback is not being called, which prevents necessary cleanup or finalization steps from occurring.
**Example:*... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -77,6 +77,10 @@
the overridden value. This is most useful when mocking request properties
in testing.
See https://github.com/Pylons/pyramid/pull/3559
+
+- Finished callbacks are now executed as part of the ``closer`` that is
+ invok... | diff --git a/tests/test_scripting.py b/tests/test_scripting.py
--- a/tests/test_scripting.py
+++ b/tests/test_scripting.py
@@ -1,3 +1,4 @@
+from collections import deque
import unittest
@@ -162,6 +163,20 @@
self.assertEqual(request.context, root)
self.assertEqual(request.registry, registry)
+ ... | null | null | namanjain12/pyramid_final:5c05cd9837adcd9b0ee0ee775added2a6d3b6688 | true | null | 2 | 6 | null | 1,233 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2255 | 80.59525 | ||
8,880 | r2e_gym::train::6130 | r2e_gym | train | 6,130 | pillow__c585e6ab6b4731d65570dbb1cbf396add919b3ae | pillow | python-pillow/pillow | python | c585e6ab6b4731d65570dbb1cbf396add919b3ae | **Title:** `autocontrast()` Raises TypeError When Using `preserve_tone` Option
**Description:**
When attempting to use the `preserve_tone` parameter with the `autocontrast` function from the Pillow library, a `TypeError` is raised because the function does not recognize the `preserve_tone` argument.
**Example Code:**... | diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py
--- a/src/PIL/ImageOps.py
+++ b/src/PIL/ImageOps.py
@@ -61,7 +61,7 @@
# actions
-def autocontrast(image, cutoff=0, ignore=None, mask=None):
+def autocontrast(image, cutoff=0, ignore=None, mask=None, preserve_tone=False):
"""
Maximize (normalize) imag... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -29,6 +29,7 @@
ImageOps.autocontrast(hopper("L"), cutoff=(2, 10))
ImageOps.autocontrast(hopper("L"), ignore=[0, 255])
ImageOps.autocontrast(hopper("L"), mask=hopper("L"))
+ ImageOp... | null | null | namanjain12/pillow_final:c585e6ab6b4731d65570dbb1cbf396add919b3ae | true | null | 1 | 13 | null | 1,092 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.225333 | 80.59475 | ||
8,881 | r2e_gym::train::5116 | r2e_gym | train | 5,116 | pyramid__a9cd71dd14eb357bd1a538e2763ab6b78f1bc047 | pyramid | pylons/pyramid | python | a9cd71dd14eb357bd1a538e2763ab6b78f1bc047 | **Title:** Unhandled Exceptions Raised When Loading Invalid Pickle Session Data
**Description:**
When loading session data that contains invalid or corrupted pickle data, unexpected exceptions such as `AttributeError` or `UnpicklingError` are raised. This can lead to application crashes or improper session handling.
... | diff --git a/pyramid/session.py b/pyramid/session.py
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -121,7 +121,11 @@
def loads(self, bstruct):
"""Accept bytes and return a Python object."""
- return pickle.loads(bstruct)
+ try:
+ return pickle.loads(bstruct)
+ # at... | 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:a9cd71dd14eb357bd1a538e2763ab6b78f1bc047 | true | null | 1 | 6 | null | 1,231 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.225167 | 80.59425 | ||
8,882 | r2e_gym::train::57 | r2e_gym | train | 57 | orange3__41bb6d7be53e61c299ccc892d003388b74969568 | orange3 | biolab/orange3 | python | 41bb6d7be53e61c299ccc892d003388b74969568 | **Title:** Incorrect URL Handling Causes HTTP 404 Errors for URLs with Queries and Fragments
**Description:**
When using URLs that contain query parameters or fragments, such as `https://datasets.biolab.si/core/grades.xlsx?a=1&b=2` or `https://datasets.biolab.si/core/grades.xlsx#tab=1`, attempts to read the data resul... | diff --git a/Orange/data/io.py b/Orange/data/io.py
--- a/Orange/data/io.py
+++ b/Orange/data/io.py
@@ -406,7 +406,13 @@
filename = filename.strip()
if not urlparse(filename).scheme:
filename = 'http://' + filename
- filename = quote(filename, safe="/:")
+
+ # Fully support U... | diff --git a/Orange/tests/test_url_reader.py b/Orange/tests/test_url_reader.py
--- a/Orange/tests/test_url_reader.py
+++ b/Orange/tests/test_url_reader.py
@@ -25,6 +25,19 @@
"vestnik-clanki/detektiranje-utrdb-v-šahu-.txt"
self.assertRaises(OSError, UrlReader(path).read)
+ def test_base_url... | null | null | namanjain12/orange3_final:41bb6d7be53e61c299ccc892d003388b74969568 | true | null | 1 | 8 | null | 1,189 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.224833 | 80.59325 | ||
8,883 | r2e_gym::train::5452 | r2e_gym | train | 5,452 | aiohttp__7f906a07e7a15fcabce08c89b4b6e310de033f7c | aiohttp | aio-libs/aiohttp | python | 7f906a07e7a15fcabce08c89b4b6e310de033f7c | ### Unable to Set `charset` Property on StreamResponse
#### Description
When attempting to set the `charset` property on a `StreamResponse` object, an `AttributeError` is raised instead of successfully updating the charset. This prevents developers from specifying the character encoding for the response, which is esse... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -191,6 +191,18 @@
self._check_sending_started()
self.content_type # read header values if needed
self._content_type = str(value)
+ self._generate_content_type_header()
+
+ @property
+ def c... | diff --git a/tests/test_web_response.py b/tests/test_web_response.py
--- a/tests/test_web_response.py
+++ b/tests/test_web_response.py
@@ -103,3 +103,23 @@
resp.content_type = 'text/html'
self.assertEqual('text/html', resp.headers['content-type'])
+
+ def test_cannot_change_content_type_after_sen... | null | null | namanjain12/aiohttp_final:7f906a07e7a15fcabce08c89b4b6e310de033f7c | true | null | 1 | 12 | null | 1,109 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.224833 | 80.59325 | ||
8,884 | r2e_gym::train::5308 | r2e_gym | train | 5,308 | aiohttp__c7c52506c0802e70d1bf5655d16de63769b71fb9 | aiohttp | aio-libs/aiohttp | python | c7c52506c0802e70d1bf5655d16de63769b71fb9 | **Title:** Unable to Add Dynamic Routes with Regex Patterns
**Description:**
When attempting to add a dynamic route that includes a regular expression to constrain the variable part of the path, the system raises a `ValueError` indicating that the path is invalid.
**Example Code:**
```python
router = UrlDispatcher()
... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -1044,7 +1044,9 @@
class UrlDispatcher(AbstractRouter, collections.abc.Mapping):
- DYN = re.compile(r'^\{[a-zA-Z][_a-zA-Z0-9]*\}$')
+ DYN = re.compile(r'^\{(?P<var>[a-zA-Z][_a-zA-Z0-9]*)\}$')
+ DYN_WITH_RE = re.compi... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -265,3 +265,20 @@
route = self.router.add_static('/prefix/',
os.path.dirname(aiohttp.__file__))
self.assertEqual('/prefix/', rou... | null | null | namanjain12/aiohttp_final:c7c52506c0802e70d1bf5655d16de63769b71fb9 | true | null | 1 | 24 | null | 867 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2245 | 80.59225 | ||
8,885 | r2e_gym::train::6393 | r2e_gym | train | 6,393 | pillow__b25ece364b5e7d9f97df38ca82b15c83c98daf6c | pillow | python-pillow/pillow | python | b25ece364b5e7d9f97df38ca82b15c83c98daf6c | **Title:** AttributeError When Closing Image Objects Without 'fp' Attribute
**Description:**
When attempting to close an `Image` object that does not have the `fp` attribute, an `AttributeError` is raised. This occurs in scenarios where the image was manipulated in a way that removes or never sets the `fp` attribute.
... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -550,12 +550,13 @@
more information.
"""
try:
- if getattr(self, "_fp", False):
- if self._fp != self.fp:
- self._fp.close()
- self._fp... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -1014,6 +1014,21 @@
except OSError as e:
assert str(e) == "buffer overrun when reading image file"
+ @pytest.fixture(scope="function")
+ def inject_caplog(self, caplog):
+ ... | null | null | namanjain12/pillow_final:b25ece364b5e7d9f97df38ca82b15c83c98daf6c | true | null | 1 | 13 | null | 1,087 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2245 | 80.59225 | ||
8,886 | r2e_gym::train::4185 | r2e_gym | train | 4,185 | numpy__ad48eaa76403798c298c2761e53e1e43008ab1b1 | numpy | numpy/numpy | python | ad48eaa76403798c298c2761e53e1e43008ab1b1 | **Title:** Incorrect Histogram Counts Due to Rounding Issues with float32 Data
**Description**
When generating a 2D histogram using float32 data, the total count of histogram bins is incorrect. This occurs because the edges of the histogram bins are not handled properly, leading to some data points falling outside the... | 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
@@ -336,6 +336,11 @@
smin[i] = smin[i] - .5
smax[i] = smax[i] + .5
+ # avoid rounding issues for comparisons when dealing with inexact types
+ if np.is... | 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
@@ -1070,6 +1070,13 @@
h, b = histogram(a, weights=np.ones(10, float))
assert_(issubdtype(h.dtype, float))
+ def test_... | null | null | namanjain12/numpy_final:ad48eaa76403798c298c2761e53e1e43008ab1b1 | true | null | 1 | 9 | null | 1,166 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.224333 | 80.59175 | ||
8,887 | r2e_gym::train::6645 | r2e_gym | train | 6,645 | pillow__2ecf88eaa621266f63405ca7e1fdbdb7ed4d5c8d | pillow | python-pillow/pillow | python | 2ecf88eaa621266f63405ca7e1fdbdb7ed4d5c8d | **Title:** ImageGrab.grabclipboard() Only Supports wl-paste on Linux, Ignoring xclip
**Description:**
When using `ImageGrab.grabclipboard()` on Linux systems, the function raises a `NotImplementedError` if `wl-paste` is not available, even when `xclip` is installed and could serve as an alternative for accessing the c... | diff --git a/src/PIL/ImageGrab.py b/src/PIL/ImageGrab.py
--- a/src/PIL/ImageGrab.py
+++ b/src/PIL/ImageGrab.py
@@ -132,12 +132,16 @@
return BmpImagePlugin.DibImageFile(data)
return None
else:
- if not shutil.which("wl-paste"):
+ if shutil.which("wl-paste"):
+ args... | diff --git a/Tests/test_imagegrab.py b/Tests/test_imagegrab.py
--- a/Tests/test_imagegrab.py
+++ b/Tests/test_imagegrab.py
@@ -68,8 +68,8 @@
with pytest.raises(NotImplementedError) as e:
ImageGrab.grabclipboard()
assert (
- str(e.value)
- ... | null | null | namanjain12/pillow_final:2ecf88eaa621266f63405ca7e1fdbdb7ed4d5c8d | true | null | 1 | 10 | null | 1,145 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.224167 | 80.59125 | ||
8,888 | r2e_gym::train::260 | r2e_gym | train | 260 | orange3__98182d847f6ee0fc1094d40c39b65c6e203b335f | orange3 | biolab/orange3 | python | 98182d847f6ee0fc1094d40c39b65c6e203b335f | **Title:** OWDistanceMatrix Widget Raises AttributeError When Selecting Default Label
**Description:**
**Problem:**
When using the OWDistanceMatrix widget with datasets that include string variables, an AttributeError is raised because the widget lacks the `_choose_label` method. This issue prevents the widget from a... | diff --git a/Orange/widgets/unsupervised/owdistancematrix.py b/Orange/widgets/unsupervised/owdistancematrix.py
--- a/Orange/widgets/unsupervised/owdistancematrix.py
+++ b/Orange/widgets/unsupervised/owdistancematrix.py
@@ -252,8 +252,7 @@
elif isinstance(items, Table):
annotations.extend(
... | diff --git a/Orange/widgets/unsupervised/tests/test_owdistancematrix.py b/Orange/widgets/unsupervised/tests/test_owdistancematrix.py
--- a/Orange/widgets/unsupervised/tests/test_owdistancematrix.py
+++ b/Orange/widgets/unsupervised/tests/test_owdistancematrix.py
@@ -84,6 +84,30 @@
ac.activated.emit(idx)
... | null | null | namanjain12/orange3_final:98182d847f6ee0fc1094d40c39b65c6e203b335f | true | null | 1 | 11 | null | 1,124 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.224 | 80.59075 | ||
8,889 | r2e_gym::train::6649 | r2e_gym | train | 6,649 | pillow__9074eda6087439c84503f06bf2d502b2a70c7d72 | pillow | python-pillow/pillow | python | 9074eda6087439c84503f06bf2d502b2a70c7d72 | **Title:** AttributeError When Using `ImageSequence.all_frames`
**Description:**
Attempting to retrieve all frames from an image using `ImageSequence.all_frames` results in an `AttributeError` because the `all_frames` method does not exist in the `ImageSequence` module.
**Example Code:**
```python
from PIL import I... | diff --git a/docs/releasenotes/6.1.0.rst b/docs/releasenotes/6.1.0.rst
--- a/docs/releasenotes/6.1.0.rst
+++ b/docs/releasenotes/6.1.0.rst
@@ -10,6 +10,14 @@
An optional ``include_layered_windows`` parameter has been added to ``ImageGrab.grab``,
defaulting to ``False``. If true, layered windows will be included in th... | diff --git a/Tests/test_imagesequence.py b/Tests/test_imagesequence.py
--- a/Tests/test_imagesequence.py
+++ b/Tests/test_imagesequence.py
@@ -74,3 +74,25 @@
im.seek(0)
color2 = im.getpalette()[0:3]
self.assertEqual(color1, color2)
+
+ def test_all_frames(self):
+ # Test a single im... | null | null | namanjain12/pillow_final:9074eda6087439c84503f06bf2d502b2a70c7d72 | true | null | 2 | 30 | null | 742 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.223667 | 80.58975 | ||
8,890 | r2e_gym::train::5084 | r2e_gym | train | 5,084 | pyramid__fcb6cc082ea537b046df4b958f885f6a50b18d72 | pyramid | pylons/pyramid | python | fcb6cc082ea537b046df4b958f885f6a50b18d72 | **Title:** JSONP Renderer Raises KeyError When 'request' is Missing
**Description:**
When using the JSONP renderer without providing a request object, a `KeyError` is raised because the renderer attempts to access `'request'` directly from the system dictionary.
**Example Code:**
```python
from pyramid.renderers impo... | diff --git a/pyramid/renderers.py b/pyramid/renderers.py
--- a/pyramid/renderers.py
+++ b/pyramid/renderers.py
@@ -24,7 +24,7 @@
from pyramid.path import caller_package
-from pyramid.response import Response, _get_response_factory
+from pyramid.response import _get_response_factory
from pyramid.threadlocal import... | diff --git a/pyramid/tests/test_renderers.py b/pyramid/tests/test_renderers.py
--- a/pyramid/tests/test_renderers.py
+++ b/pyramid/tests/test_renderers.py
@@ -602,6 +602,12 @@
self.assertEqual(request.response.content_type,
'application/json')
+ def test_render_without_request(se... | null | null | namanjain12/pyramid_final:fcb6cc082ea537b046df4b958f885f6a50b18d72 | true | null | 1 | 24 | null | 861 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2235 | 80.58925 | ||
8,891 | r2e_gym::train::401 | r2e_gym | train | 401 | orange3__f1e88084fc4fbe4194696109e44a5e2febb7d5d6 | orange3 | biolab/orange3 | python | f1e88084fc4fbe4194696109e44a5e2febb7d5d6 | **Title:** `stats` function raises `NotImplementedError` when computing weighted variance on sparse matrices
**Description:**
When using the `stats` function with weights and requesting variance computation on a sparse numeric matrix, a `NotImplementedError` is raised instead of computing the variance.
**Example Code... | diff --git a/Orange/statistics/util.py b/Orange/statistics/util.py
--- a/Orange/statistics/util.py
+++ b/Orange/statistics/util.py
@@ -341,31 +341,31 @@
"""
is_numeric = np.issubdtype(X.dtype, np.number)
is_sparse = sp.issparse(X)
- weighted = weights is not None and X.dtype != object
- weights = w... | 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
@@ -155,8 +155,9 @@
np.testing.assert_equal(stats(X, weights), [[0, 2, 1.5, 0, 1, 1],
[1, 3, 2.5, 0, 0,... | null | null | namanjain12/orange3_final:f1e88084fc4fbe4194696109e44a5e2febb7d5d6 | true | null | 1 | 22 | null | 900 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.223333 | 80.58875 | ||
8,892 | r2e_gym::train::4585 | r2e_gym | train | 4,585 | numpy__f9355942f6ef7c5d27691c4571096234efb67a2b | numpy | numpy/numpy | python | f9355942f6ef7c5d27691c4571096234efb67a2b | **Title:** `eye()` Raises TypeError When Using `uint64` Types for Arguments
**Description:**
When attempting to create an identity matrix using `numpy.eye()` with `uint64` types for the `N` and `M` parameters, a `TypeError` is raised. This occurs because the function does not properly handle unsigned integer types for... | diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -2,6 +2,7 @@
"""
import functools
+import operator
from numpy.core.numeric import (
asanyarray, arange, zeros, greater_equal, multiply, ones,
@@ -214,6 +215,11 @@
m = zeros(... | diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -43,6 +43,12 @@
assert_equal(eye(3) == 1,
eye(3, dtype=bool))
+
+ def test_uint64(self):
+ # Regression... | null | null | namanjain12/numpy_final:f9355942f6ef7c5d27691c4571096234efb67a2b | true | null | 1 | 12 | null | 1,099 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.223167 | 80.58825 | ||
8,893 | r2e_gym::train::5157 | r2e_gym | train | 5,157 | pyramid__68c84ae5aa2898251a07455e958fd0a11926d114 | pyramid | pylons/pyramid | python | 68c84ae5aa2898251a07455e958fd0a11926d114 | **Title:** Reference Cycle Caused by Unremoved `context` in Request Object
**Description:**
After processing a request, the `request` object retains a reference to the `context`. This prevents the garbage collector from reclaiming memory, leading to reference cycles and potential memory leaks in long-running applicati... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,3 +1,9 @@
+Unreleased
+==========
+
+- Break potential reference cycle between ``request`` and ``context``.
+ See https://github.com/Pylons/pyramid/pull/3649
+
2.0b0 (2020-12-15)
==================
diff --git a/src/pyramid/router.py b... | diff --git a/tests/test_router.py b/tests/test_router.py
--- a/tests/test_router.py
+++ b/tests/test_router.py
@@ -124,6 +124,19 @@
klass = self._getTargetClass()
return klass(self.registry)
+ def _mockFinishRequest(self, router):
+ """
+ Mock :meth:`pyramid.router.Router.finish_req... | null | null | namanjain12/pyramid_final:68c84ae5aa2898251a07455e958fd0a11926d114 | true | null | 2 | 14 | null | 1,058 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.223 | 80.58775 | ||
8,894 | r2e_gym::train::5093 | r2e_gym | train | 5,093 | pyramid__e2519d64b3dd1f53555a184eb38b5138ea9bc2f6 | pyramid | pylons/pyramid | python | e2519d64b3dd1f53555a184eb38b5138ea9bc2f6 | **Title:** Passing String Values to AuthTktCookieHelper Time Parameters Causes TypeError
**Description:**
When initializing `AuthTktCookieHelper` with string values for time-related parameters like `timeout`, `reissue_time`, or `max_age`, the system encounters unexpected `TypeError` exceptions during the authenticatio... | diff --git a/pyramid/authentication.py b/pyramid/authentication.py
--- a/pyramid/authentication.py
+++ b/pyramid/authentication.py
@@ -855,9 +855,9 @@
self.cookie_name = cookie_name
self.secure = secure
self.include_ip = include_ip
- self.timeout = timeout
- self.reissue_time = ... | diff --git a/pyramid/tests/test_authentication.py b/pyramid/tests/test_authentication.py
--- a/pyramid/tests/test_authentication.py
+++ b/pyramid/tests/test_authentication.py
@@ -599,6 +599,15 @@
cookies = SimpleCookie()
cookies.load(cookie)
return cookies.get('auth_tkt')
+
+ def test_init... | null | null | namanjain12/pyramid_final:e2519d64b3dd1f53555a184eb38b5138ea9bc2f6 | true | null | 1 | 9 | null | 1,158 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.223 | 80.58775 | ||
8,895 | r2e_gym::train::4997 | r2e_gym | train | 4,997 | datalad__073036402f40275768316a07336298e280644927 | datalad | datalad/datalad | python | 073036402f40275768316a07336298e280644927 | **Title:** Runner Closes External Files It Did Not Open, Causing FileNotFoundError
**Description:**
When using the `Runner` to handle output streams, it inadvertently closes files that were not opened by itself. This behavior leads to `FileNotFoundError` when other parts of the code attempt to access these externally ... | diff --git a/datalad/cmd.py b/datalad/cmd.py
--- a/datalad/cmd.py
+++ b/datalad/cmd.py
@@ -38,6 +38,10 @@
lgr = logging.getLogger('datalad.cmd')
_TEMP_std = sys.stdout, sys.stderr
+# To be used in the temp file name to distinguish the ones we create
+# in Runner so we take care about their removal, in contrast to t... | diff --git a/datalad/tests/test_cmd.py b/datalad/tests/test_cmd.py
--- a/datalad/tests/test_cmd.py
+++ b/datalad/tests/test_cmd.py
@@ -215,8 +215,9 @@
log_stderr='offline',
expect_stderr=True
)
- assert_equal(len(l), 100)
- import pdb; pdb.set_trace()
+ ... | null | null | namanjain12/datalad_final:073036402f40275768316a07336298e280644927 | true | null | 1 | 11 | null | 1,117 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.222833 | 80.58725 | ||
8,896 | r2e_gym::train::5321 | r2e_gym | train | 5,321 | aiohttp__d3fa32eb39057636c7e6246619a3680244061049 | aiohttp | aio-libs/aiohttp | python | d3fa32eb39057636c7e6246619a3680244061049 | **Title:** MultipartReader Fails to Read Trailing Characters, Causing Boundary Parsing Error
**Description:**
When processing multipart payloads, the `MultipartReader` fails to correctly handle boundaries if the `read_chunk` method does not read all data, specifically missing the trailing `\r\n` characters. This resul... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -43,6 +43,9 @@
- Don't process request finishing by low-level server on closed event loop
- Don't override data if multiple files are uploaded with same key #433
+
+- Ensure multipart.BodyPartReader.read_chunk read all the necessary data
... | diff --git a/tests/test_multipart.py b/tests/test_multipart.py
--- a/tests/test_multipart.py
+++ b/tests/test_multipart.py
@@ -526,6 +526,23 @@
self.assertTrue(second.at_eof())
self.assertTrue(second.at_eof())
self.assertIsNone(third)
+
+ def test_read_chunk_doesnt_breaks_reader(self):
+ ... | null | null | namanjain12/aiohttp_final:d3fa32eb39057636c7e6246619a3680244061049 | true | null | 2 | 8 | null | 1,177 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.222833 | 80.58725 | ||
8,897 | r2e_gym::train::6198 | r2e_gym | train | 6,198 | pillow__e514a60d82429a4669159176471013adb0fa8b94 | pillow | python-pillow/pillow | python | e514a60d82429a4669159176471013adb0fa8b94 | **Title:** `ImageColor.getrgb` Fails to Parse HSV Color Strings
**Description:**
When attempting to use HSV color strings with `ImageColor.getrgb`, the function raises a `ValueError`, indicating that the color specifier is unknown. This prevents the conversion of HSV values to RGB, limiting color handling capabilitie... | diff --git a/docs/reference/ImageColor.rst b/docs/reference/ImageColor.rst
--- a/docs/reference/ImageColor.rst
+++ b/docs/reference/ImageColor.rst
@@ -31,6 +31,13 @@
(black=0%, normal=50%, white=100%). For example, ``hsl(0,100%,50%)`` is pure
red.
+* Hue-Saturation-Value (HSV) functions, given as ``hsv(hue, sat... | diff --git a/Tests/test_imagecolor.py b/Tests/test_imagecolor.py
--- a/Tests/test_imagecolor.py
+++ b/Tests/test_imagecolor.py
@@ -78,9 +78,20 @@
self.assertEqual((255, 0, 0), ImageColor.getrgb("hsl(360,100%,50%)"))
self.assertEqual((0, 255, 255), ImageColor.getrgb("hsl(180,100%,50%)"))
+ sel... | null | null | namanjain12/pillow_final:e514a60d82429a4669159176471013adb0fa8b94 | true | null | 2 | 21 | null | 916 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.222667 | 80.58675 | ||
8,898 | r2e_gym::train::4549 | r2e_gym | train | 4,549 | numpy__ced6475d519552455cc50831052213c1249a909c | numpy | numpy/numpy | python | ced6475d519552455cc50831052213c1249a909c | **Title:** Stack functions do not warn when passed `map` objects, leading to unexpected errors
**Description:**
Passing a `map` object to stack functions like `hstack` results in a `ValueError` without providing a clear warning about the deprecated usage of non-sequence iterables. This behavior makes it challenging f... | 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
@@ -207,12 +207,12 @@
def _arrays_for_stack_dispatcher(arrays, stacklevel=4):
- if isinstance(arrays, types.GeneratorType):
- warnings.warn('arrays to stack should be passed as a... | 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
@@ -158,6 +158,8 @@
def test_generator(self):
with assert_warns(FutureWarning):
hstack((np.arange(3) for _ in range(2)))
+... | null | null | namanjain12/numpy_final:ced6475d519552455cc50831052213c1249a909c | true | null | 1 | 8 | null | 1,171 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.221833 | 80.58425 | ||
8,899 | r2e_gym::train::5765 | r2e_gym | train | 5,765 | scrapy__0e78acb65798a1eb4e55a472232e77d55e6c7cd5 | scrapy | scrapy/scrapy | python | 0e78acb65798a1eb4e55a472232e77d55e6c7cd5 | **Title:** MediaPipeline Does Not Log Exceptions from media_to_download, Hindering Error Diagnosis
**Description:**
When an error occurs during the media downloading process, such as a `ZeroDivisionError` in the `file_path` method, the exception is not properly logged. This lack of logging makes it difficult to ident... | diff --git a/scrapy/pipelines/media.py b/scrapy/pipelines/media.py
--- a/scrapy/pipelines/media.py
+++ b/scrapy/pipelines/media.py
@@ -112,13 +112,13 @@
info.downloading.add(fp)
dfd = mustbe_deferred(self.media_to_download, request, info, item=item)
dfd.addCallback(self._check_media_to_downlo... | diff --git a/tests/test_pipeline_crawl.py b/tests/test_pipeline_crawl.py
--- a/tests/test_pipeline_crawl.py
+++ b/tests/test_pipeline_crawl.py
@@ -9,6 +9,7 @@
from scrapy import signals
from scrapy.crawler import CrawlerRunner
+from scrapy.utils.misc import load_object
from tests.mockserver import MockServer
from... | null | null | namanjain12/scrapy_final:0e78acb65798a1eb4e55a472232e77d55e6c7cd5 | true | null | 1 | 10 | null | 1,129 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2215 | 80.58325 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.