selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,000 | r2e_gym::train::5736 | r2e_gym | train | 5,736 | scrapy__7644813286c230866c2f7287bbaead87f2be104b | scrapy | scrapy/scrapy | python | 7644813286c230866c2f7287bbaead87f2be104b | **Title:** Passing Dictionary as Settings Causes KeyError in Crawler and CrawlerRunner
**Description:**
When initializing `Crawler` or `CrawlerRunner` with a dictionary of settings instead of a `Settings` object, a `KeyError` is raised due to missing required keys.
**Example Code:**
```python
from scrapy.crawler impo... | diff --git a/docs/topics/practices.rst b/docs/topics/practices.rst
--- a/docs/topics/practices.rst
+++ b/docs/topics/practices.rst
@@ -52,16 +52,16 @@
::
from twisted.internet import reactor
- from scrapy.spider import Spider
+ import scrapy
from scrapy.crawler import CrawlerRunner
- from scrapy.s... | diff --git a/tests/test_crawler.py b/tests/test_crawler.py
--- a/tests/test_crawler.py
+++ b/tests/test_crawler.py
@@ -1,11 +1,10 @@
import warnings
import unittest
-from twisted.internet import defer
from zope.interface.verify import DoesNotImplement
from scrapy.crawler import Crawler, CrawlerRunner
-from scra... | null | null | namanjain12/scrapy_final:7644813286c230866c2f7287bbaead87f2be104b | true | null | 2 | 16 | null | 911 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205167 | 80.53425 | ||
9,001 | r2e_gym::train::5881 | r2e_gym | train | 5,881 | tornado__022c46c8c2f22e2ac7f04cd7eda1ac943cdc35d7 | tornado | tornadoweb/tornado | python | 022c46c8c2f22e2ac7f04cd7eda1ac943cdc35d7 | **Title:** Missing `gen.sleep` Causes AttributeError in Coroutine Tests
**Description:**
When using `gen.sleep(duration)` within a coroutine, an `AttributeError` is raised because the `sleep` function is not defined in the `tornado.gen` module. This prevents asynchronous sleep operations from functioning correctly in ... | diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -688,6 +688,25 @@
io_loop.add_future(
future, lambda future: io_loop.remove_timeout(timeout_handle))
return result
+
+
+def sleep(duration):
+ """Return a `.Future` that resolves after the given numbe... | 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
@@ -837,6 +837,11 @@
calls = []
yield [f('a', gen.moment), f('b', immediate)]
self.assertEqual(''.join(calls), 'abbbbbaaaa')
+
+ @gen_test
+ def test_sleep(self... | null | null | namanjain12/tornado_final:022c46c8c2f22e2ac7f04cd7eda1ac943cdc35d7 | true | null | 1 | 19 | null | 851 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205167 | 80.53425 | ||
9,002 | r2e_gym::train::6216 | r2e_gym | train | 6,216 | pillow__75c76d91e18e56c7cfccca7016d7508235c7046b | pillow | python-pillow/pillow | python | 75c76d91e18e56c7cfccca7016d7508235c7046b | **Title:** Missing `__repr__` Method in `Color3DLUT` Causes Representation Inconsistencies
**Description:**
When attempting to obtain the string representation of a `Color3DLUT` instance, the output is the default object representation instead of a meaningful description. This leads to failures in tests that verify th... | diff --git a/src/PIL/ImageFilter.py b/src/PIL/ImageFilter.py
--- a/src/PIL/ImageFilter.py
+++ b/src/PIL/ImageFilter.py
@@ -442,6 +442,15 @@
target_mode=target_mode or self.mode,
_copy_table=False)
+ def __repr__(self):
+ r = ["{0} from {1}".format(self._... | diff --git a/Tests/test_color_lut.py b/Tests/test_color_lut.py
--- a/Tests/test_color_lut.py
+++ b/Tests/test_color_lut.py
@@ -1,4 +1,6 @@
from __future__ import division
+
+from array import array
from PIL import Image, ImageFilter
from helper import unittest, PillowTestCase
@@ -264,8 +266,18 @@
self.ass... | null | null | namanjain12/pillow_final:75c76d91e18e56c7cfccca7016d7508235c7046b | true | null | 1 | 9 | null | 1,051 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205167 | 80.53425 | ||
9,003 | r2e_gym::train::4165 | r2e_gym | train | 4,165 | numpy__d8047967b6545b8677727b1257965db9d0c95d30 | numpy | numpy/numpy | python | d8047967b6545b8677727b1257965db9d0c95d30 | **Title:** TypeError When Calling `np.finfo` on Non-Hashable Objects with `dtype`
**Description:**
When attempting to use `np.finfo` with an object that is non-hashable but has a `dtype` attribute, a `TypeError` is raised. This prevents the retrieval of floating-point information for such objects, which should ideally... | diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py
--- a/numpy/core/getlimits.py
+++ b/numpy/core/getlimits.py
@@ -482,9 +482,12 @@
_finfo_cache = {}
def __new__(cls, dtype):
- obj = cls._finfo_cache.get(dtype) # most common path
- if obj is not None:
- return obj
+ ... | 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
@@ -72,6 +72,15 @@
f1 = np.finfo(np.float32(1.0))
f2 = np.finfo(np.float64(1.0))
assert f1 != f2
+
+ def test_regression_gh... | null | null | namanjain12/numpy_final:d8047967b6545b8677727b1257965db9d0c95d30 | true | null | 1 | 9 | null | 1,051 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205167 | 80.53425 | ||
9,004 | r2e_gym::train::4049 | r2e_gym | train | 4,049 | coveragepy__0d6449874cd4d3003ce908d66fa654b64bfea0c0 | coveragepy | nedbat/coveragepy | python | 0d6449874cd4d3003ce908d66fa654b64bfea0c0 | **Title:** AttributeError When Processing Empty Modules in Python 3.11.0b4
**Description:**
When using coverage.py to analyze an empty `__init__.py` module with Python version 3.11.0b4, an `AttributeError` is raised. The system expects the `PYBEHAVIOR` class to have an attribute `empty_is_empty`, which is not present,... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,11 +20,18 @@
Unreleased
----------
+- Updated for a small change in Python 3.11.0 beta 4: modules now start with a
+ line with line number 0, which is ignored. This line cannnot be executed, so
+ coverage totals were thrown off. T... | diff --git a/tests/test_arcs.py b/tests/test_arcs.py
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -158,6 +158,8 @@
if env.JYTHON:
# Jython reports no lines for an empty file.
arcz_missing=".1 1." # pragma: only jython
+ elif env.PYBEHAVIOR.empty_is_em... | null | null | namanjain12/coveragepy_final:0d6449874cd4d3003ce908d66fa654b64bfea0c0 | true | null | 3 | 12 | null | 990 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205 | 80.53375 | ||
9,005 | r2e_gym::train::4379 | r2e_gym | train | 4,379 | numpy__6756edfad754ed1b65f44e8fe84cf2c9d2f53ce9 | numpy | numpy/numpy | python | 6756edfad754ed1b65f44e8fe84cf2c9d2f53ce9 | **Title:** Mask shape is incorrectly modified when using `np.tile` on `MaskedArray`
**Description:**
When creating a masked array and performing operations like tiling, the shape of the mask is unintentionally altered, leading to inconsistencies.
**Example:**
```python
import numpy as np
# Create a masked array wit... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2999,12 +2999,15 @@
order = "K"
_mask = _mask.astype(_mask_dtype, order)
-
+ else:
+ # Take a view so shape changes, etc., do not propagate back.
+ ... | 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
@@ -352,9 +352,11 @@
assert_equal(y1._mask.__array_interface__, m.__array_interface__)
y1a = array(y1)
+ # Default for masked array is not to copy; see gh... | null | null | namanjain12/numpy_final:6756edfad754ed1b65f44e8fe84cf2c9d2f53ce9 | true | null | 1 | 7 | null | 1,089 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.204833 | 80.53325 | ||
9,006 | r2e_gym::train::6500 | r2e_gym | train | 6,500 | pillow__15ef533df9847e556eca0eaa50b7738bb71b8c34 | pillow | python-pillow/pillow | python | 15ef533df9847e556eca0eaa50b7738bb71b8c34 | **Title:** `getbbox()` Raises TypeError When Passing `alpha_only` Argument
**Description:**
When using the `getbbox()` method on images with an alpha channel, attempting to pass the `alpha_only` parameter results in a `TypeError`. This prevents specifying whether to consider only the alpha channel when calculating the... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1279,11 +1279,14 @@
"""
return ImageMode.getmode(self.mode).bands
- def getbbox(self):
+ def getbbox(self, alpha_only=True):
"""
Calculates the bounding box of the non-zero regi... | diff --git a/Tests/test_image_getbbox.py b/Tests/test_image_getbbox.py
--- a/Tests/test_image_getbbox.py
+++ b/Tests/test_image_getbbox.py
@@ -1,3 +1,5 @@
+import pytest
+
from PIL import Image
from .helper import hopper
@@ -38,3 +40,16 @@
for color in ((0, 0), (127, 0), (255, 0)):
im = Image.... | null | null | namanjain12/pillow_final:15ef533df9847e556eca0eaa50b7738bb71b8c34 | true | null | 1 | 7 | null | 1,085 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.204167 | 80.53125 | ||
9,007 | r2e_gym::train::5473 | r2e_gym | train | 5,473 | aiohttp__1f3a6be48a99767560ccf3f9e923a9a3a6fc1352 | aiohttp | aio-libs/aiohttp | python | 1f3a6be48a99767560ccf3f9e923a9a3a6fc1352 | **Title:** Content-Length header remains set when compression is enabled
**Description:**
When compression is enabled on a response, the `Content-Length` header is not removed. This causes the header to retain the original uncompressed content length, leading to inconsistencies and potential issues in how clients pro... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,10 @@
CHANGES
=======
+
+0.17.3 (XX-XX-XXXX)
+---------------------
+
+- Remove Content-Length header on compressed responses #450
0.17.2 (08-11-2015)
---------------------
diff --git a/aiohttp/__init__.py b/aiohttp/__init__.py
... | 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
@@ -290,6 +290,17 @@
msg = resp.start(req)
msg.add_compression_filter.assert_called_with('gzip')
self.assertEqual('gzip', resp.headers.get(hdrs.CONTENT_ENCODI... | null | null | namanjain12/aiohttp_final:1f3a6be48a99767560ccf3f9e923a9a3a6fc1352 | true | null | 3 | 12 | null | 985 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.204167 | 80.53125 | ||
9,008 | r2e_gym::train::5012 | r2e_gym | train | 5,012 | datalad__09879794b4cdfaab37772270d3e5f843733bc2c5 | datalad | datalad/datalad | python | 09879794b4cdfaab37772270d3e5f843733bc2c5 | **Title:** Uninformative TypeError Raised During Message Rendering with Insufficient Arguments
**Description:**
When logging messages that include format placeholders, providing fewer arguments than required results in a generic `TypeError`. This makes it difficult to identify and debug issues related to message forma... | diff --git a/datalad/interface/base.py b/datalad/interface/base.py
--- a/datalad/interface/base.py
+++ b/datalad/interface/base.py
@@ -837,6 +837,7 @@
argspec = getargspec(call)
defaults = argspec.defaults
nargs = len(argspec.args)
+ defaults = defaults or [] # ensure it is a list and not None
a... | 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
@@ -50,6 +50,7 @@
eval_results,
handle_dirty_dataset,
)
+from ..results import get_status_dict
from datalad.interface.base import... | null | null | namanjain12/datalad_final:09879794b4cdfaab37772270d3e5f843733bc2c5 | true | null | 3 | 17 | null | 884 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.204 | 80.53075 | ||
9,009 | r2e_gym::train::4907 | r2e_gym | train | 4,907 | datalad__e89b37688dbaf36ab4376871071004df90b060cd | datalad | datalad/datalad | python | e89b37688dbaf36ab4376871071004df90b060cd | **Title:** Applying `eval_results` Decorator Without Switch Causes TypeError
**Description:**
When using the `@eval_results` decorator without providing a switch mechanism, the decorated function becomes `None`. As a result, calling the decorated function raises a `TypeError`.
**Example Code:**
```python
from datalad... | diff --git a/datalad/interface/utils.py b/datalad/interface/utils.py
--- a/datalad/interface/utils.py
+++ b/datalad/interface/utils.py
@@ -763,17 +763,28 @@
or any(m.startswith(_with_sep(p)) for p in paths_refds))]
return keep
+
import wrapt
-@wrapt.decorator
-def eval_results(wrapped, ... | 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
@@ -320,19 +320,45 @@
from datalad.interface.utils import eval_results
from inspect import getargspec
+ class Switcher(object)... | null | null | namanjain12/datalad_final:e89b37688dbaf36ab4376871071004df90b060cd | true | null | 1 | 27 | null | 683 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.203833 | 80.53025 | ||
9,010 | r2e_gym::train::5293 | r2e_gym | train | 5,293 | aiohttp__92ce18b0a7d677c4fbdfc835198725a24052179c | aiohttp | aio-libs/aiohttp | python | 92ce18b0a7d677c4fbdfc835198725a24052179c | **Title:** WebSocket handshake fails due to incorrect number of return values from `do_handshake`
**Description:**
When performing a WebSocket handshake, the `do_handshake` function is expected to return five values: `status`, `headers`, `parser`, `writer`, and `protocol`. Currently, it only returns four values, leadi... | diff --git a/aiohttp/websocket.py b/aiohttp/websocket.py
--- a/aiohttp/websocket.py
+++ b/aiohttp/websocket.py
@@ -218,7 +218,7 @@
break
else:
raise errors.HttpBadRequest(
- 'Client protocols {} don’t overlap server-known ones {}'
+ 'Client protocols ... | diff --git a/tests/test_websocket.py b/tests/test_websocket.py
--- a/tests/test_websocket.py
+++ b/tests/test_websocket.py
@@ -419,18 +419,54 @@
websocket.do_handshake,
self.message.method, self.message.headers, self.transport)
+ def gen_ws_headers(self, protocols=''):
+ key = base... | null | null | namanjain12/aiohttp_final:92ce18b0a7d677c4fbdfc835198725a24052179c | true | null | 1 | 7 | null | 1,082 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.203667 | 80.52975 | ||
9,011 | r2e_gym::train::4231 | r2e_gym | train | 4,231 | numpy__7175f1c4a9858994607cfb207a0e28468ef544f6 | numpy | numpy/numpy | python | 7175f1c4a9858994607cfb207a0e28468ef544f6 | ### Title
`astype` method fails on MaskedArray with non-trivial structured dtypes
### Description
When attempting to use the `astype` method on a `MaskedArray` with a complex structured dtype, a `ValueError` is raised due to incompatible dtypes. This issue occurs with structured data that includes nested fields.
**Ex... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3191,16 +3191,16 @@
"""
newtype = np.dtype(newtype)
+ newmasktype = make_mask_descr(newtype)
+
output = self._data.astype(newtype).view(type(self))
output._update_from(self)
- ... | 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
@@ -4740,6 +4740,11 @@
y = np.add(x, 1., out=x)
assert_(y is x)
+def test_astype():
+ descr = [('v', int, 3), ('x', [('y', float)])]
+ x = array(([1, 2, 3], (1.0,)... | null | null | namanjain12/numpy_final:7175f1c4a9858994607cfb207a0e28468ef544f6 | true | null | 1 | 14 | null | 942 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.203667 | 80.52975 | ||
9,012 | r2e_gym::train::6270 | r2e_gym | train | 6,270 | pillow__1fd0411ee4c26b800655e545d3fcc4c4e54e3304 | pillow | python-pillow/pillow | python | 1fd0411ee4c26b800655e545d3fcc4c4e54e3304 | **Title:** TypeError When Saving APNG with Duplicate Frames and Varying Durations
**Description:**
When attempting to save an animated PNG (APNG) that includes duplicate frames with different duration times, a `TypeError` is raised. This error occurs because the code tries to add an integer to a list when handling fra... | diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py
--- a/src/PIL/PngImagePlugin.py
+++ b/src/PIL/PngImagePlugin.py
@@ -1117,12 +1117,12 @@
and prev_disposal == encoderinfo.get("disposal")
and prev_blend == encoderinfo.get("blend")
):
- ... | 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
@@ -433,7 +433,9 @@
# test removal of duplicated frames
frame = Image.new("RGBA", (128, 64), (255, 0, 0, 255))
- frame.save(test_file, save_all=True, append_images=[frame], duration=... | null | null | namanjain12/pillow_final:1fd0411ee4c26b800655e545d3fcc4c4e54e3304 | true | null | 1 | 8 | null | 1,061 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2035 | 80.52925 | ||
9,013 | r2e_gym::train::5243 | r2e_gym | train | 5,243 | pyramid__c15fe7a1298be06fcb25c1377c8ae18f98bce1ff | pyramid | pylons/pyramid | python | c15fe7a1298be06fcb25c1377c8ae18f98bce1ff | **Title:** `add_view_derivation()` Does Not Accept `over` and `under` Parameters, Raising TypeError
**Description:**
After updating the `add_view_derivation()` method to use the more intuitive `over` and `under` parameters instead of `weighs_more_than` and `weighs_less_than`, attempting to use these new parameters res... | diff --git a/pyramid/config/views.py b/pyramid/config/views.py
--- a/pyramid/config/views.py
+++ b/pyramid/config/views.py
@@ -1077,8 +1077,8 @@
@action_method
def add_view_derivation(self, name, factory, default,
- weighs_more_than=None,
- weighs_less_... | diff --git a/pyramid/tests/test_config/test_derivations.py b/pyramid/tests/test_config/test_derivations.py
--- a/pyramid/tests/test_config/test_derivations.py
+++ b/pyramid/tests/test_config/test_derivations.py
@@ -1191,8 +1191,8 @@
return view
self.config.add_view_derivation('deriv1', deriv1, d... | null | null | namanjain12/pyramid_final:c15fe7a1298be06fcb25c1377c8ae18f98bce1ff | true | null | 1 | 14 | null | 937 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.202833 | 80.52725 | ||
9,014 | r2e_gym::train::4091 | r2e_gym | train | 4,091 | coveragepy__c2e35658d8311fd2b5d1460c2cb56762d5fe0ec7 | coveragepy | nedbat/coveragepy | python | c2e35658d8311fd2b5d1460c2cb56762d5fe0ec7 | **Title:** Infinite Recursion When Remapping Non-Existent Relative Paths
**Description:**
When using relative file paths, attempting to map a path that does not exist causes the `PathAliases` class to enter an infinite recursion loop. This infinite recursion leads to a `RecursionError`, preventing the function from co... | diff --git a/coverage/files.py b/coverage/files.py
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -452,15 +452,20 @@
# If we get here, no pattern matched.
if self.relative and not isabs_anywhere(path):
+ # Auto-generate a pattern to implicitly match relative files
parts =... | diff --git a/tests/test_files.py b/tests/test_files.py
--- a/tests/test_files.py
+++ b/tests/test_files.py
@@ -384,6 +384,7 @@
aliases = PathAliases(relative=rel_yn)
aliases.add('/ned/home/*/src', './mysrc')
self.assert_unchanged(aliases, '/ned/home/foo/src/a.py', exists=False)
+ self.... | null | null | namanjain12/coveragepy_final:c2e35658d8311fd2b5d1460c2cb56762d5fe0ec7 | true | null | 1 | 11 | null | 997 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.202833 | 80.52725 | ||
9,015 | r2e_gym::train::4959 | r2e_gym | train | 4,959 | datalad__16c1ffc349df566151db0beb6d355ca27266bb8c | datalad | datalad/datalad | python | 16c1ffc349df566151db0beb6d355ca27266bb8c | **Title:** `result_filter` does not receive `kwargs`, causing assertion failures
**Description:**
When using a custom `result_filter` that expects additional keyword arguments from the API call, the filter does not receive these `kwargs`. This leads to assertion failures or unexpected behavior.
**Example Buggy Code:*... | diff --git a/datalad/interface/utils.py b/datalad/interface/utils.py
--- a/datalad/interface/utils.py
+++ b/datalad/interface/utils.py
@@ -53,6 +53,7 @@
from datalad import cfg as dlcfg
from datalad.dochelpers import exc_str
+from datalad.support.constraints import Constraint
from datalad.support.constraints impor... | 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
@@ -420,3 +420,15 @@
4,
result_filter=filt)[-1],
{'path': 'some', 'status': 'ok', 'somekey': 2... | null | null | namanjain12/datalad_final:16c1ffc349df566151db0beb6d355ca27266bb8c | true | null | 1 | 21 | null | 797 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.202833 | 80.52725 | ||
9,016 | r2e_gym::train::5906 | r2e_gym | train | 5,906 | tornado__b20ca363c7df16d8bd7c21b9db4c639ebae543c5 | tornado | tornadoweb/tornado | python | b20ca363c7df16d8bd7c21b9db4c639ebae543c5 | **Title:** HTTP Client Fails to Handle Non-Future Yieldables in `body_producer`, Causing Incomplete Requests
**Description:**
When using a `body_producer` that returns yieldables other than futures, the HTTP client does not process them correctly. This results in incomplete request bodies being sent and mismatches wi... | diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py
--- a/tornado/simple_httpclient.py
+++ b/tornado/simple_httpclient.py
@@ -1,8 +1,8 @@
#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
-from tornado.concurrent import is_future
from tornad... | diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py
--- a/tornado/test/simple_httpclient_test.py
+++ b/tornado/test/simple_httpclient_test.py
@@ -22,7 +22,7 @@
from tornado.test.httpclient_test import ChunkHandler, CountdownHandler, HelloWorldHandler, RedirectHandler
from torn... | null | null | namanjain12/tornado_final:b20ca363c7df16d8bd7c21b9db4c639ebae543c5 | true | null | 1 | 6 | null | 1,095 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2025 | 80.52625 | ||
9,017 | r2e_gym::train::4815 | r2e_gym | train | 4,815 | numpy__ea9775606c8303a3fd65fdf21a4a02846cef971e | numpy | numpy/numpy | python | ea9775606c8303a3fd65fdf21a4a02846cef971e | **Title:** Incorrect 'midpoint' Interpolation in `np.percentile` Results in Unexpected Percentile Values
**Description:**
When using the `'midpoint'` interpolation method with `np.percentile`, the function returns incorrect percentile values for certain datasets and percentile inputs. This leads to discrepancies betw... | 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
@@ -32,8 +32,13 @@
``MaskedArray`` takes view of data **and** mask when slicing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+XXX
-XXX
+
+``np.percentile``... | 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
@@ -2066,7 +2066,7 @@
assert_array_equal(res[i], desired[i])
-class TestScoreatpercentile(TestCase):
+class TestPercentile(TestC... | null | null | namanjain12/numpy_final:ea9775606c8303a3fd65fdf21a4a02846cef971e | true | null | 2 | 9 | null | 1,035 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2025 | 80.52625 | ||
9,018 | r2e_gym::train::6346 | r2e_gym | train | 6,346 | pillow__5721577e4e6f5d64a5c50ab8732eea9e5a437120 | pillow | python-pillow/pillow | python | 5721577e4e6f5d64a5c50ab8732eea9e5a437120 | **Title:** EPS Image Parsing Continues Beyond EOF Marker, Causing UnidentifiedImageError
**Description:**
When an EPS file contains additional data after the `%%EOF` marker, attempting to open the image results in an error. The parser does not correctly stop reading at the end-of-file marker, leading to a failure in i... | diff --git a/src/PIL/EpsImagePlugin.py b/src/PIL/EpsImagePlugin.py
--- a/src/PIL/EpsImagePlugin.py
+++ b/src/PIL/EpsImagePlugin.py
@@ -356,14 +356,10 @@
self._size = columns, rows
return
+ elif bytes_mv[:5] == b"%%EOF":
+ break
elif trailer_reac... | diff --git a/Tests/test_file_eps.py b/Tests/test_file_eps.py
--- a/Tests/test_file_eps.py
+++ b/Tests/test_file_eps.py
@@ -436,3 +436,11 @@
with pytest.raises(OSError):
with Image.open("Tests/images/zero_bb_eof_before_boundingbox.eps"):
pass
+
+
+def test_invalid_data_after_eof() -> None:
+ ... | null | null | namanjain12/pillow_final:5721577e4e6f5d64a5c50ab8732eea9e5a437120 | true | null | 1 | 8 | null | 1,054 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.202333 | 80.52575 | ||
9,019 | r2e_gym::train::5076 | r2e_gym | train | 5,076 | pyramid__e81e76ae9e0fd1c45ddb61a873d67cd6e2d9f643 | pyramid | pylons/pyramid | python | e81e76ae9e0fd1c45ddb61a873d67cd6e2d9f643 | **Title:** Passing `options` to `get_appsettings` Raises TypeError
**Description:**
When attempting to provide an `options` dictionary to the `get_appsettings` function for configuration interpolation, a `TypeError` is raised. This issue prevents the use of dynamic settings within the configuration files.
**Example B... | diff --git a/docs/api/paster.rst b/docs/api/paster.rst
--- a/docs/api/paster.rst
+++ b/docs/api/paster.rst
@@ -9,6 +9,6 @@
.. autofunction:: get_app(config_uri, name=None, options=None)
- .. autofunction:: get_appsettings(config_uri, name=None)
+ .. autofunction:: get_appsettings(config_uri, name=None, o... | diff --git a/pyramid/tests/test_paster.py b/pyramid/tests/test_paster.py
--- a/pyramid/tests/test_paster.py
+++ b/pyramid/tests/test_paster.py
@@ -56,14 +56,15 @@
self.assertEqual(result, app)
class Test_get_appsettings(unittest.TestCase):
- def _callFUT(self, config_file, section_name, appconfig):
+ ... | null | null | namanjain12/pyramid_final:e81e76ae9e0fd1c45ddb61a873d67cd6e2d9f643 | true | null | 2 | 16 | null | 893 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.202167 | 80.52525 | ||
9,020 | r2e_gym::train::5934 | r2e_gym | train | 5,934 | tornado__4e9de2e43f50ae8a5317d4287d592904cf39a9e5 | tornado | tornadoweb/tornado | python | 4e9de2e43f50ae8a5317d4287d592904cf39a9e5 | **Title:** `IOLoop.spawn_callback` Method Missing Causes AttributeError
**Description:**
When attempting to use the `spawn_callback` method on an `IOLoop` instance, an `AttributeError` is raised because the method does not exist. This prevents developers from running fire-and-forget callbacks without associating them ... | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -485,6 +485,19 @@
that was interrupted by the signal.
"""
raise NotImplementedError()
+
+ def spawn_callback(self, callback, *args, **kwargs):
+ """Calls the given callback on the n... | 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
@@ -273,6 +273,19 @@
with ExpectLog(app_log, "Exception in callback"):
self.wait()
+ def test_spawn_callback(self):
+ # An added callback r... | null | null | namanjain12/tornado_final:4e9de2e43f50ae8a5317d4287d592904cf39a9e5 | true | null | 1 | 13 | null | 952 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.202 | 80.52475 | ||
9,021 | r2e_gym::train::4892 | r2e_gym | train | 4,892 | numpy__a2b9c2d5b6637b040917c0a2ef393dae83f09ee3 | numpy | numpy/numpy | python | a2b9c2d5b6637b040917c0a2ef393dae83f09ee3 | **Title**: `np.i0` Does Not Raise Error on Complex Input
**Description**:
When using the `np.i0` function with complex numbers, it does not raise an error as expected. This behavior allows complex inputs to be processed, which may lead to incorrect results since `np.i0` is intended for real-valued inputs only.
**Exam... | 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
@@ -3193,24 +3193,17 @@
"""
Modified Bessel function of the first kind, order 0.
- Usually denoted :math:`I_0`. This function does broadcast, but will *not*
- "up-cas... | 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
@@ -2111,8 +2111,9 @@
i0(0.5),
np.array(1.0634833707413234))
- A = np.array([0.49842636, 0.6969809, 0.2201... | null | null | namanjain12/numpy_final:a2b9c2d5b6637b040917c0a2ef393dae83f09ee3 | true | null | 1 | 23 | null | 751 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201833 | 80.52425 | ||
9,022 | r2e_gym::train::4886 | r2e_gym | train | 4,886 | numpy__5db1c6a48c9bf626ad171caab6085eec5b7408ea | numpy | numpy/numpy | python | 5db1c6a48c9bf626ad171caab6085eec5b7408ea | **Title:** `np.digitize` Raises ValueError with Large Integer Bins When `edge=True`
**Description:**
When using `numpy.digitize` with very large integer values and setting the `edge` parameter to `True`, a `ValueError` is unexpectedly raised. This issue prevents the function from correctly binning large integer inputs... | 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
@@ -4845,15 +4845,17 @@
if edge:
# if cannot make round trip, cannot use eps
- if np.issubdtype(bins.dtype, _nx.int64):
- if (bins != bins.astype(_nx.f... | 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
@@ -1743,7 +1743,7 @@
# gh-11022
x = 2**54 # loses precision in a float
assert_equal(np.digitize(x, [x - 1, x + 1... | null | null | namanjain12/numpy_final:5db1c6a48c9bf626ad171caab6085eec5b7408ea | true | null | 1 | 18 | null | 851 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201833 | 80.52425 | ||
9,023 | r2e_gym::train::4050 | r2e_gym | train | 4,050 | coveragepy__d723b46460dc7ffb4abf54806087ffd614b81331 | coveragepy | nedbat/coveragepy | python | d723b46460dc7ffb4abf54806087ffd614b81331 | **Title:** Coverage.py Raises AttributeError When Tracing Decorator Lines in Python 3.11
**Description:**
When using Coverage.py with Python 3.11, attempting to trace decorator lines results in an `AttributeError`. This prevents Coverage.py from accurately reporting coverage for decorated functions and classes.
**Exa... | diff --git a/coverage/env.py b/coverage/env.py
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -100,6 +100,10 @@
# Some words are keywords in some places, identifiers in other places.
soft_keywords = (PYVERSION >= (3, 10))
+ # CPython 3.11 now jumps to the decorator line again while executing
+ # the d... | diff --git a/tests/test_arcs.py b/tests/test_arcs.py
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1664,6 +1664,13 @@
"""Tests of arcs with decorators."""
def test_function_decorator(self):
+ arcz = (
+ ".1 16 67 7A AE EF F. " # main line
+ ".2 24 4. -23 3-2 " ... | null | null | namanjain12/coveragepy_final:d723b46460dc7ffb4abf54806087ffd614b81331 | true | null | 2 | 14 | null | 928 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201333 | 80.52275 | ||
9,024 | r2e_gym::train::4873 | r2e_gym | train | 4,873 | numpy__09d4d35bb979dd0d5d0781946f59f362765eca66 | numpy | numpy/numpy | python | 09d4d35bb979dd0d5d0781946f59f362765eca66 | **Title:** `np.cross` Raises Generic `ValueError` for Out-of-Bounds Axis Indices
**Description:**
When using `np.cross`, providing an axis index that is out of the valid range results in a generic `ValueError`. This makes it unclear which specific axis argument (`axisa`, `axisb`, or `axisc`) is causing the issue, comp... | diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -1752,11 +1752,9 @@
a = asarray(a)
b = asarray(b)
# Check axisa and axisb are within bounds
- axis_msg = "'axis{0}' out of bounds"
- if axisa < -a.ndim or axisa >= a.ndim:
- ... | diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -2517,13 +2517,13 @@
u = np.ones((10, 3, 5))
v = np.ones((2, 5))
assert_equal(np.cross(u, v, axisa=1, axisb=0).shape, (10, 5, 3))
-... | null | null | namanjain12/numpy_final:09d4d35bb979dd0d5d0781946f59f362765eca66 | true | null | 1 | 11 | null | 987 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201167 | 80.52225 | ||
9,025 | r2e_gym::train::4196 | r2e_gym | train | 4,196 | numpy__b3a087ca99506cf7d0b6f88c130efb8718d9d926 | numpy | numpy/numpy | python | b3a087ca99506cf7d0b6f88c130efb8718d9d926 | **Title:** gfortran Version Parsing Fails When Warning Messages Are Present
**Description:**
When parsing gfortran version strings that include warning messages, the version detection fails and raises an error. This issue occurs because the parser does not properly handle and strip out warning lines before attempting ... | diff --git a/numpy/distutils/__init__.py b/numpy/distutils/__init__.py
--- a/numpy/distutils/__init__.py
+++ b/numpy/distutils/__init__.py
@@ -13,7 +13,7 @@
from .npy_pkg_config import *
try:
- import __config__
+ from . import __config__
_INSTALLED = True
except ImportError:
... | diff --git a/numpy/distutils/tests/test_fcompiler_gnu.py b/numpy/distutils/tests/test_fcompiler_gnu.py
--- a/numpy/distutils/tests/test_fcompiler_gnu.py
+++ b/numpy/distutils/tests/test_fcompiler_gnu.py
@@ -16,6 +16,11 @@
gfortran_version_strings = [
('4.8.0', '4.8.0'),
('4.0.3-7', '4.0.3'),
+ ("gfortran:... | null | null | namanjain12/numpy_final:b3a087ca99506cf7d0b6f88c130efb8718d9d926 | true | null | 2 | 6 | null | 1,087 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201167 | 80.52225 | ||
9,026 | r2e_gym::train::5250 | r2e_gym | train | 5,250 | pyramid__32714630c4c84a411c1b773e0f736579c142df9c | pyramid | pylons/pyramid | python | 32714630c4c84a411c1b773e0f736579c142df9c | **Title:** ConfigurationConflictError __str__ Fails with Non-Sortable Discriminators
**Description:**
When `ConfigurationConflictError` contains discriminators of different, non-sortable types (e.g., `str` and `None`), generating its string representation raises a `TypeError`. This occurs because the discriminators ar... | diff --git a/src/pyramid/exceptions.py b/src/pyramid/exceptions.py
--- a/src/pyramid/exceptions.py
+++ b/src/pyramid/exceptions.py
@@ -2,8 +2,6 @@
NotFound = HTTPNotFound # bw compat
Forbidden = HTTPForbidden # bw compat
-
-CR = '\n'
class BadCSRFOrigin(HTTPBadRequest):
@@ -92,14 +90,13 @@
def __str__... | diff --git a/tests/test_exceptions.py b/tests/test_exceptions.py
--- a/tests/test_exceptions.py
+++ b/tests/test_exceptions.py
@@ -1,3 +1,4 @@
+from collections import OrderedDict
import unittest
@@ -72,7 +73,9 @@
return ConfigurationConflictError(conflicts)
def test_str(self):
- conflicts =... | null | null | namanjain12/pyramid_final:32714630c4c84a411c1b773e0f736579c142df9c | true | null | 1 | 9 | null | 1,027 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201167 | 80.52225 | ||
9,027 | r2e_gym::train::5891 | r2e_gym | train | 5,891 | tornado__e9b3cee7f505ad53aef870e4ce1df642ed968e6a | tornado | tornadoweb/tornado | python | e9b3cee7f505ad53aef870e4ce1df642ed968e6a | **Title:** Writing to a Closed WebSocket Does Not Raise StreamClosedError
**Description:**
When attempting to send a message after the WebSocket connection has been closed, no exception is raised. This behavior is unexpected because writing to a closed stream should result in a `StreamClosedError`, indicating that the... | diff --git a/tornado/websocket.py b/tornado/websocket.py
--- a/tornado/websocket.py
+++ b/tornado/websocket.py
@@ -764,10 +764,7 @@
data = mask + _websocket_mask(mask, data)
frame += data
self._wire_bytes_out += len(frame)
- try:
- return self.stream.write(frame)
- ... | diff --git a/tornado/test/websocket_test.py b/tornado/test/websocket_test.py
--- a/tornado/test/websocket_test.py
+++ b/tornado/test/websocket_test.py
@@ -7,6 +7,7 @@
from tornado.concurrent import Future
from tornado import gen
from tornado.httpclient import HTTPError, HTTPRequest
+from tornado.iostream import Stre... | null | null | namanjain12/tornado_final:e9b3cee7f505ad53aef870e4ce1df642ed968e6a | true | null | 1 | 15 | null | 906 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.201 | 80.52175 | ||
9,028 | r2e_gym::train::5270 | r2e_gym | train | 5,270 | aiohttp__f53cc26904fa866cef144227572c37222a884ef0 | aiohttp | aio-libs/aiohttp | python | f53cc26904fa866cef144227572c37222a884ef0 | **Title:** Setting a Cookie After Deletion Retains 'Max-Age=0', Preventing Proper Cookie Storage
**Description:**
When a cookie is deleted and then set again, the `Max-Age=0` attribute is still present in the cookie header. This causes the newly set cookie to have a maximum age of zero, effectively deleting it immedia... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -41,3 +41,6 @@
- Streams are optimized for speed and mostly memory in case of a big
HTTP message sizes #496
+
+- Fix a bug for server-side cookies for dropping cookie and setting it
+ again without Max-Age parameter.
diff --git a/aioht... | 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
@@ -396,13 +396,12 @@
'Set-Cookie: name=another_other_value; Max-Age=10; Path=/')
resp.del_cookie('name')
- self.assertEqual(
- str(resp.cookie... | null | null | namanjain12/aiohttp_final:f53cc26904fa866cef144227572c37222a884ef0 | true | null | 2 | 11 | null | 984 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.200667 | 80.52075 | ||
9,029 | r2e_gym::train::4375 | r2e_gym | train | 4,375 | numpy__2c29b138aedb1774e7f984f4a237243455c423ad | numpy | numpy/numpy | python | 2c29b138aedb1774e7f984f4a237243455c423ad | **Title:** Accessing a Single Item from a Masked Object Array Raises AttributeError
**Description:**
When retrieving a single item from a masked object array that includes masked entries, an `AttributeError` is raised. This occurs because the system attempts to modify the `shape` attribute of a `numpy.generic` object,... | diff --git a/doc/release/1.10.0-notes.rst b/doc/release/1.10.0-notes.rst
--- a/doc/release/1.10.0-notes.rst
+++ b/doc/release/1.10.0-notes.rst
@@ -99,6 +99,11 @@
Indexing an ndarray using a byte-string in Python 3 now raises an IndexError
instead of a ValueError.
+Masked arrays containing objects with arrays
+~~~~~... | 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
@@ -684,6 +684,18 @@
assert_equal(repr(mx[0]), "(1, -X-)")
finally:
masked_print_option.set_display(ini_display)
+
+ def test_object_with_array... | null | null | namanjain12/numpy_final:2c29b138aedb1774e7f984f4a237243455c423ad | true | null | 2 | 11 | null | 982 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.200333 | 80.51975 | ||
9,030 | r2e_gym::train::4773 | r2e_gym | train | 4,773 | numpy__e6088dcc6d26e317979fb4b80c5f86f7459e5f7d | numpy | numpy/numpy | python | e6088dcc6d26e317979fb4b80c5f86f7459e5f7d | **Title:** Passing list as shape argument to `numpy.memmap` raises `TypeError`
**Description:**
When initializing a `memmap` with a list of integers as the `shape` parameter, a `TypeError` is raised instead of accepting the shape sequence.
**Example Code:**
```python
import numpy as np
from tempfile import TemporaryF... | diff --git a/doc/release/upcoming_changes/23729.improvement.rst b/doc/release/upcoming_changes/23729.improvement.rst
--- a/doc/release/upcoming_changes/23729.improvement.rst
+++ b/doc/release/upcoming_changes/23729.improvement.rst
@@ -0,0 +1,5 @@
+Integer sequences as the ``shape`` argument for `np.memmap`
+-----------... | diff --git a/numpy/core/tests/test_memmap.py b/numpy/core/tests/test_memmap.py
--- a/numpy/core/tests/test_memmap.py
+++ b/numpy/core/tests/test_memmap.py
@@ -213,3 +213,9 @@
# ok now the file is not empty
memmap(self.tmpfp, shape=(0,4), mode='w+')
+
+ def test_shape_type(self):
+ memm... | null | null | namanjain12/numpy_final:e6088dcc6d26e317979fb4b80c5f86f7459e5f7d | true | null | 2 | 22 | null | 762 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.200333 | 80.51975 | ||
9,031 | r2e_gym::train::6631 | r2e_gym | train | 6,631 | pillow__671f7a392dedfcf36c22556bdd588382cf2f98ff | pillow | python-pillow/pillow | python | 671f7a392dedfcf36c22556bdd588382cf2f98ff | **Title:** `putpixel` Method for 'P' Mode Images Fails with RGBA Tuples
**Description:**
When using the `putpixel` method on images with mode `'P'` (palette-based), providing an RGBA tuple (a tuple with four values) results in a `TypeError`. This issue occurs because the method currently expects only RGB tuples (three... | diff --git a/docs/reference/PixelAccess.rst b/docs/reference/PixelAccess.rst
--- a/docs/reference/PixelAccess.rst
+++ b/docs/reference/PixelAccess.rst
@@ -65,8 +65,8 @@
Modifies the pixel at x,y. The color is given as a single
numerical value for single band images, and a tuple for
- multi-ba... | diff --git a/Tests/test_image_access.py b/Tests/test_image_access.py
--- a/Tests/test_image_access.py
+++ b/Tests/test_image_access.py
@@ -175,10 +175,11 @@
self.check(mode, 2**15+1)
self.check(mode, 2**16-1)
- def test_p_putpixel_rgb(self):
- im = Image.new("P", (1, 1), 0)
- ... | null | null | namanjain12/pillow_final:671f7a392dedfcf36c22556bdd588382cf2f98ff | true | null | 3 | 16 | null | 881 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.200167 | 80.51925 | ||
9,032 | r2e_gym::train::6212 | r2e_gym | train | 6,212 | pillow__e4d6223c944cf44c468cc65a560b94dfcf351a62 | pillow | python-pillow/pillow | python | e4d6223c944cf44c468cc65a560b94dfcf351a62 | **Title:** Saving images in unsupported modes like 'RGBA' as JPEG does not raise an error
**Description:**
When attempting to save an image with the 'RGBA' mode as a JPEG, the operation completes without raising any errors. This is unexpected because 'RGBA' is not a supported mode for the JPEG format. As a result, the... | diff --git a/PIL/JpegImagePlugin.py b/PIL/JpegImagePlugin.py
--- a/PIL/JpegImagePlugin.py
+++ b/PIL/JpegImagePlugin.py
@@ -554,7 +554,6 @@
"1": "L",
"L": "L",
"RGB": "RGB",
- "RGBA": "RGB",
"RGBX": "RGB",
"CMYK": "CMYK;I", # assume adobe conventions
"YCbCr": "YCbCr",
@@ -602,14 +601,6 ... | 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
@@ -476,17 +476,11 @@
img.save(out, "JPEG")
def test_save_wrong_modes(self):
+ # ref https://github.com/python-pillow/Pillow/issues/2005
out = BytesIO()
- ... | null | null | namanjain12/pillow_final:e4d6223c944cf44c468cc65a560b94dfcf351a62 | true | null | 2 | 11 | null | 978 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199667 | 80.51775 | ||
9,033 | r2e_gym::train::237 | r2e_gym | train | 237 | orange3__c60392702b7d206b9f37ba430d3599f3736ddc14 | orange3 | biolab/orange3 | python | c60392702b7d206b9f37ba430d3599f3736ddc14 | **Title:** Randomize widget fails to display data summaries in status bar
**Description:**
The Randomize widget is expected to show summaries of the input and output datasets in the status bar, indicating the number of instances. However, when data is provided or cleared, the status summaries are not updated. This res... | diff --git a/Orange/widgets/data/owrandomize.py b/Orange/widgets/data/owrandomize.py
--- a/Orange/widgets/data/owrandomize.py
+++ b/Orange/widgets/data/owrandomize.py
@@ -67,6 +67,9 @@
box, self, "random_seed", "Replicable shuffling",
callback=self._shuffle_check_changed)
+ self.info.... | diff --git a/Orange/widgets/data/tests/test_owrandomize.py b/Orange/widgets/data/tests/test_owrandomize.py
--- a/Orange/widgets/data/tests/test_owrandomize.py
+++ b/Orange/widgets/data/tests/test_owrandomize.py
@@ -1,6 +1,6 @@
# Test methods with long descriptive names can omit docstrings
-# pylint: disable=missing-do... | null | null | namanjain12/orange3_final:c60392702b7d206b9f37ba430d3599f3736ddc14 | true | null | 1 | 7 | null | 1,058 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199667 | 80.51775 | ||
9,034 | r2e_gym::train::6286 | r2e_gym | train | 6,286 | pillow__3cd1e12974403eb76da5e9e0972d9e8bcd0a95c7 | pillow | python-pillow/pillow | python | 3cd1e12974403eb76da5e9e0972d9e8bcd0a95c7 | **Title:** PPM Image Loader Fails to Raise Error on Incomplete Image Data
**Description:**
When attempting to load a PPM image file that contains insufficient image data, the loader does not raise an error as expected. Instead, it silently fails, which can lead to unexpected behaviors downstream.
**Example Buggy Code... | diff --git a/docs/releasenotes/9.5.0.rst b/docs/releasenotes/9.5.0.rst
--- a/docs/releasenotes/9.5.0.rst
+++ b/docs/releasenotes/9.5.0.rst
@@ -62,10 +62,19 @@
Security
========
-TODO
-^^^^
+Clear PPM half token after use
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-TODO
+Image files that are small on disk are often prevented... | diff --git a/Tests/test_file_ppm.py b/Tests/test_file_ppm.py
--- a/Tests/test_file_ppm.py
+++ b/Tests/test_file_ppm.py
@@ -256,6 +256,16 @@
im.load()
+def test_not_enough_image_data(tmp_path):
+ path = str(tmp_path / "temp.ppm")
+ with open(path, "wb") as f:
+ f.write(b"P2 1 2 255 255")
+
... | null | null | namanjain12/pillow_final:3cd1e12974403eb76da5e9e0972d9e8bcd0a95c7 | true | null | 2 | 16 | null | 878 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199667 | 80.51775 | ||
9,035 | r2e_gym::train::4389 | r2e_gym | train | 4,389 | numpy__ef639359f4862762d97c215990f86a7a622c0f0d | numpy | numpy/numpy | python | ef639359f4862762d97c215990f86a7a622c0f0d | **Title:** `set_printoptions` Accepts Non-Integer `precision` Values Without Error
**Description:**
When configuring print options in NumPy, the `precision` parameter is intended to be an integer that specifies the number of digits of precision for floating-point output. However, providing a non-integer value for `pr... | diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -78,6 +78,7 @@
if legacy not in [None, False, '1.13']:
warnings.warn("legacy printing option can currently only be '1.13' or "
"`False`", stacklevel=3)
+... | diff --git a/numpy/core/tests/test_arrayprint.py b/numpy/core/tests/test_arrayprint.py
--- a/numpy/core/tests/test_arrayprint.py
+++ b/numpy/core/tests/test_arrayprint.py
@@ -923,6 +923,9 @@
assert_raises(TypeError, np.set_printoptions, threshold='1')
assert_raises(TypeError, np.set_printoptions, thre... | null | null | namanjain12/numpy_final:ef639359f4862762d97c215990f86a7a622c0f0d | true | null | 1 | 7 | null | 1,056 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199333 | 80.51675 | ||
9,036 | r2e_gym::train::4404 | r2e_gym | train | 4,404 | numpy__a866fdd2c9481de18241a27778679013042d5349 | numpy | numpy/numpy | python | a866fdd2c9481de18241a27778679013042d5349 | **Title:** `numpy.loadtxt` Raises TypeError When Loading Complex Data in Python 3
**Description:**
When attempting to load complex numbers using `numpy.loadtxt` in Python 3, a `TypeError` is encountered. The function incorrectly passes byte data to the `complex` constructor, which expects a string or a numerical value... | diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -690,7 +690,7 @@
elif issubclass(typ, np.floating):
return floatconv
elif issubclass(typ, np.complex):
- return complex
+ return lambda x: complex(asstr(x))
elif issubclass(typ... | diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -706,6 +706,14 @@
c.seek(0)
res = np.loadtxt(c, dtype=dt)
assert_equal(res, tgt, err_msg="%s" % dt)
+
+ def test_from_complex(self):
+ ... | null | null | namanjain12/numpy_final:a866fdd2c9481de18241a27778679013042d5349 | true | null | 1 | 9 | null | 1,016 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199333 | 80.51675 | ||
9,037 | r2e_gym::train::4183 | r2e_gym | train | 4,183 | numpy__05aa44d53f4f9528847a0c014fe4bda5caa5fd3d | numpy | numpy/numpy | python | 05aa44d53f4f9528847a0c014fe4bda5caa5fd3d | **Title:** `np.ma.median` Raises `IndexError` When Called on Empty `ndarray` Along Certain Axes
**Description:**
When using `np.ma.median` to compute the median of an empty masked array, an `IndexError` is raised instead of returning `NaN`. This behavior is inconsistent with previous versions and the standard `np.medi... | diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -716,6 +716,13 @@
axis = 0
else:
axis = normalize_axis_index(axis, asorted.ndim)
+
+ if asorted.shape[axis] == 0:
+ # for empty axis integer indices fail so use slicing to get same ... | diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -1039,14 +1039,14 @@
# axis 0 and 1
b = np.ma.masked_array(np.array([], dtype=float, ndmin=2))
- assert_equal(np.median(a, axis=0), b)
- ... | null | null | namanjain12/numpy_final:05aa44d53f4f9528847a0c014fe4bda5caa5fd3d | true | null | 1 | 7 | null | 1,056 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199333 | 80.51675 | ||
9,038 | r2e_gym::train::5935 | r2e_gym | train | 5,935 | tornado__63033590b251f7ec5c8d05fdb6ee5de09d9f003f | tornado | tornadoweb/tornado | python | 63033590b251f7ec5c8d05fdb6ee5de09d9f003f | **Canceled timeout callbacks are still being executed after cancellation**
When a timeout is canceled within another callback, the canceled timeout's callback still runs, leading to unexpected behavior.
**Example:**
```python
calls = [False, False]
def t1():
calls[0] = True
io_loop.remove_timeout(t2_handle)... | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -754,17 +754,18 @@
# Do not run anything until we have determined which ones
# are ready, so timeouts that call add_timeout cannot
# schedule anything in this iteratio... | 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
@@ -173,6 +173,25 @@
self.io_loop.add_callback(lambda: self.io_loop.add_callback(self.stop))
self.wait()
+ def test_remove_timeout_from_timeout(self):
+ ... | null | null | namanjain12/tornado_final:63033590b251f7ec5c8d05fdb6ee5de09d9f003f | true | null | 1 | 14 | null | 915 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199167 | 80.51625 | ||
9,039 | r2e_gym::train::6570 | r2e_gym | train | 6,570 | pillow__3bd86b9f518293594b54b4f180c6fc53658bc460 | pillow | python-pillow/pillow | python | 3bd86b9f518293594b54b4f180c6fc53658bc460 | **Title:** ImageFile.Parser.feed Raises UnboundLocalError Instead of TypeError with Invalid Input
**Description:**
When using the `ImageFile.Parser.feed()` method with an invalid input type, such as passing an integer instead of a bytes-like object, the method raises an `UnboundLocalError`. This error occurs because t... | diff --git a/PIL/ImageFile.py b/PIL/ImageFile.py
--- a/PIL/ImageFile.py
+++ b/PIL/ImageFile.py
@@ -380,11 +380,8 @@
# attempt to open this file
try:
- try:
- fp = io.BytesIO(self.data)
+ with io.BytesIO(self.data) as fp:
i... | diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py
--- a/Tests/test_imagefile.py
+++ b/Tests/test_imagefile.py
@@ -95,6 +95,11 @@
def test_raise_ioerror(self):
self.assertRaises(IOError, lambda: ImageFile.raise_ioerror(1))
+ def test_raise_typeerror(self):
+ with self.assertRaises(... | null | null | namanjain12/pillow_final:3bd86b9f518293594b54b4f180c6fc53658bc460 | true | null | 1 | 16 | null | 875 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199167 | 80.51625 | ||
9,040 | r2e_gym::train::196 | r2e_gym | train | 196 | orange3__8fbfa2c6ef85bd3e4b2b044e6ac574f7e133de99 | orange3 | biolab/orange3 | python | 8fbfa2c6ef85bd3e4b2b044e6ac574f7e133de99 | ### Variables with Identical Names from Headerless Files Are Incompatibly Handled
**Description**
When loading multiple data files that lack headers, features sharing the same names are not treated as compatible. This inconsistency causes comparisons between datasets to fail, even when the feature names and properties... | diff --git a/Orange/data/io.py b/Orange/data/io.py
--- a/Orange/data/io.py
+++ b/Orange/data/io.py
@@ -183,12 +183,7 @@
if issubclass(coltype, DiscreteVariable) and valuemap is not None:
coltype_kwargs.update(values=valuemap)
- if existing_var:
- # Use existing variable if available
- v... | diff --git a/Orange/tests/test_tab_reader.py b/Orange/tests/test_tab_reader.py
--- a/Orange/tests/test_tab_reader.py
+++ b/Orange/tests/test_tab_reader.py
@@ -142,6 +142,17 @@
self.assertEqual(len(table.domain), 3)
self.assertTrue(table.domain[0].is_continuous)
self.assertEqual(table.domain[0... | null | null | namanjain12/orange3_final:8fbfa2c6ef85bd3e4b2b044e6ac574f7e133de99 | true | null | 1 | 7 | null | 1,054 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.199 | 80.51575 | ||
9,041 | r2e_gym::train::4800 | r2e_gym | train | 4,800 | numpy__c5b90eb1db7b1318b52f6891fea6a6059c90fe70 | numpy | numpy/numpy | python | c5b90eb1db7b1318b52f6891fea6a6059c90fe70 | ### Title
`numpy.loadtxt` Fails to Parse Float Hex Format Strings
### Description
When using `numpy.loadtxt` to load data containing floats in hexadecimal format, a `ValueError` is raised because the converter cannot handle hex strings.
#### Example Code
```python
import numpy as np
from io import StringIO
# Create ... | diff --git a/doc/release/1.10.0-notes.rst b/doc/release/1.10.0-notes.rst
--- a/doc/release/1.10.0-notes.rst
+++ b/doc/release/1.10.0-notes.rst
@@ -139,6 +139,11 @@
As a result of these improvements, there will be some small changes in
returned values, especially for corner cases.
+*np.loadtxt* support for the strin... | diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -693,6 +693,19 @@
c.seek(0)
res = np.loadtxt(c, dtype=np.int64)
assert_equal(res, tgt)
+
+ def test_from_float_hex(self):
+ # IEEE doubles and fl... | null | null | namanjain12/numpy_final:c5b90eb1db7b1318b52f6891fea6a6059c90fe70 | true | null | 2 | 18 | null | 833 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.198833 | 80.51525 | ||
9,042 | r2e_gym::train::6236 | r2e_gym | train | 6,236 | pillow__066c3ab73bff25d514d01478aa9b64799c6447ed | pillow | python-pillow/pillow | python | 066c3ab73bff25d514d01478aa9b64799c6447ed | **Title:** `WebPImageFile` Missing `getxmp` Method Causes AttributeError When Accessing XMP Metadata
**Description:**
When attempting to retrieve XMP metadata from a WebP image, the `WebPImageFile` class does not have a `getxmp` method. This results in an `AttributeError` when the method is called.
**Example Code:**
... | diff --git a/docs/releasenotes/9.4.0.rst b/docs/releasenotes/9.4.0.rst
--- a/docs/releasenotes/9.4.0.rst
+++ b/docs/releasenotes/9.4.0.rst
@@ -45,6 +45,12 @@
or later. By setting this option to ``True``, the encoder will keep the hidden
RGB values.
+getxmp()
+^^^^^^^^
+
+`XMP data <https://en.wikipedia.org/wiki/Ext... | diff --git a/Tests/test_file_webp_metadata.py b/Tests/test_file_webp_metadata.py
--- a/Tests/test_file_webp_metadata.py
+++ b/Tests/test_file_webp_metadata.py
@@ -10,6 +10,11 @@
skip_unless_feature("webp"),
skip_unless_feature("webp_mux"),
]
+
+try:
+ from defusedxml import ElementTree
+except ImportError... | null | null | namanjain12/pillow_final:066c3ab73bff25d514d01478aa9b64799c6447ed | true | null | 2 | 15 | null | 891 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1985 | 80.51425 | ||
9,043 | r2e_gym::train::5899 | r2e_gym | train | 5,899 | tornado__44ebfc35719774655deb61011f881b7387cde397 | tornado | tornadoweb/tornado | python | 44ebfc35719774655deb61011f881b7387cde397 | **Title:** TypeError When Passing `datetime.timedelta` to `PeriodicCallback`
**Description:**
When initializing a `PeriodicCallback` with a `datetime.timedelta` object for the `callback_time`, a `TypeError` is raised. This occurs because the existing implementation expects a float and attempts to compare the `timedelt... | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -864,12 +864,18 @@
"""
def __init__(
- self, callback: Callable[[], None], callback_time: float, jitter: float = 0
+ self,
+ callback: Callable[[], None],
+ callback_time: Union[... | 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
@@ -688,6 +688,11 @@
with mock.patch("random.random", mock_random):
self.assertEqual(self.simulate_calls(pc, call_durations), expected)
+ def test_timedel... | null | null | namanjain12/tornado_final:44ebfc35719774655deb61011f881b7387cde397 | true | null | 1 | 14 | null | 909 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.198167 | 80.51325 | ||
9,044 | r2e_gym::train::5527 | r2e_gym | train | 5,527 | aiohttp__d2b52d7c32a744379438c466e68ad2cb471deeba | aiohttp | aio-libs/aiohttp | python | d2b52d7c32a744379438c466e68ad2cb471deeba | **Title:** HTTP Parser Fails to Reject Data After `Connection: close` Header
**Description:**
When an HTTP request includes the `Connection: close` header followed by additional data, the HTTP parser does not reject the extra data as expected. Instead of raising a `BadHttpMessage` error indicating that data was receiv... | diff --git a/CHANGES/9018.bugfix.rst b/CHANGES/9018.bugfix.rst
--- a/CHANGES/9018.bugfix.rst
+++ b/CHANGES/9018.bugfix.rst
@@ -0,0 +1 @@
+Updated Python parser to reject messages after a close message, matching C parser behaviour -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/http_parser.py b/aiohttp/http_parser.py
... | diff --git a/tests/test_http_parser.py b/tests/test_http_parser.py
--- a/tests/test_http_parser.py
+++ b/tests/test_http_parser.py
@@ -17,6 +17,7 @@
NO_EXTENSIONS,
DeflateBuffer,
HttpPayloadParser,
+ HttpRequestParser,
HttpRequestParserPy,
HttpResponseParserPy,
HttpVersion,
@@ -826,7 +8... | null | null | namanjain12/aiohttp_final:d2b52d7c32a744379438c466e68ad2cb471deeba | true | null | 2 | 6 | null | 1,068 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.198 | 80.51275 | ||
9,045 | r2e_gym::train::4442 | r2e_gym | train | 4,442 | numpy__019c8c9b2a7c084eb01cf4d8569799a5537d884d | numpy | numpy/numpy | python | 019c8c9b2a7c084eb01cf4d8569799a5537d884d | **Title:** `np.isin` Raises ValueError with Empty Integer Array and `kind="table"`
**Description:**
When using `np.isin` with an empty integer array as the second input and specifying `kind="table"`, a `ValueError` is raised. This occurs even when the input array is empty, which should be a valid case.
**Example Code... | diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -636,6 +636,13 @@
f"Invalid kind: '{kind}'. Please use None, 'sort' or 'table'.")
if integer_arrays and kind in {None, 'table'}:
+
+ if ar2.size == 0:
+ ... | 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
@@ -232,11 +232,29 @@
assert_isin_equal(5, 6)
# empty array-like:
- if kind in {None, "sort"}:
+ if kind != "table"... | null | null | namanjain12/numpy_final:019c8c9b2a7c084eb01cf4d8569799a5537d884d | true | null | 1 | 7 | null | 1,045 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1975 | 80.51125 | ||
9,046 | r2e_gym::train::6343 | r2e_gym | train | 6,343 | pillow__cc3c743c7012f88558e7768e8a4798bbaefbe60c | pillow | python-pillow/pillow | python | cc3c743c7012f88558e7768e8a4798bbaefbe60c | **[ISSUE]**
**Title:** TypeError When Reading from ContainerIO in Binary Mode Due to Mismatched Return Types
**Description:**
When using `ContainerIO` with a file opened in binary mode (`'rb'`), reading operations result in a `TypeError`. This occurs because the methods attempt to concatenate strings and bytes, leadi... | diff --git a/src/PIL/ContainerIO.py b/src/PIL/ContainerIO.py
--- a/src/PIL/ContainerIO.py
+++ b/src/PIL/ContainerIO.py
@@ -82,7 +82,7 @@
else:
n = self.length - self.pos
if not n: # EOF
- return ""
+ return b"" if "b" in self.fh.mode else ""
self.pos = self... | diff --git a/Tests/test_file_container.py b/Tests/test_file_container.py
--- a/Tests/test_file_container.py
+++ b/Tests/test_file_container.py
@@ -20,7 +20,7 @@
def test_seek_mode_0():
# Arrange
mode = 0
- with open(TEST_FILE) as fh:
+ with open(TEST_FILE, "rb") as fh:
container = ContainerIO.... | null | null | namanjain12/pillow_final:cc3c743c7012f88558e7768e8a4798bbaefbe60c | true | null | 1 | 7 | null | 1,045 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1975 | 80.51125 | ||
9,047 | r2e_gym::train::4197 | r2e_gym | train | 4,197 | numpy__c05019eda16477f4be99f47755362c07e1acb5b8 | numpy | numpy/numpy | python | c05019eda16477f4be99f47755362c07e1acb5b8 | **Title:** `setdiff1d` Returns Incorrect `dtype` When First Array Is Empty
**Description:**
When using `numpy.setdiff1d` with an empty first array, the resulting array has an unexpected data type (`bool`) instead of matching the input array's `dtype`.
**Example:**
```python
import numpy as np
a = np.array([], dtype=... | diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -470,11 +470,9 @@
array([1, 2])
"""
- if not assume_unique:
+ if assume_unique:
+ ar1 = np.asarray(ar1).ravel()
+ else:
ar1 = unique(ar1)
ar2 = ... | 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
@@ -5,7 +5,7 @@
import numpy as np
from numpy.testing import (
- run_module_suite, TestCase, assert_array_equal
+ run_module_suite, TestCas... | null | null | namanjain12/numpy_final:c05019eda16477f4be99f47755362c07e1acb5b8 | true | null | 2 | 20 | null | 783 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.197167 | 80.51025 | ||
9,048 | r2e_gym::train::4037 | r2e_gym | train | 4,037 | coveragepy__42a651c6e23b4156c5bc37208d97d0788e09edf7 | coveragepy | nedbat/coveragepy | python | 42a651c6e23b4156c5bc37208d97d0788e09edf7 | **Title:** Setting `run:_crash` Option Raises `CoverageException`
**Description:**
When attempting to configure Coverage with the internal `run:_crash` option, an exception is raised indicating that the option does not exist. This prevents developers from using this option to artificially trigger crashes for testing e... | diff --git a/coverage/config.py b/coverage/config.py
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -195,6 +195,7 @@
self.run_omit = None
self.source = None
self.timid = False
+ self._crash = None
# Defaults for [report]
self.exclude_list = DEFAULT_EXCLUDE[:]
... | diff --git a/tests/test_api.py b/tests/test_api.py
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -676,6 +676,21 @@
with self.assertRaisesRegex(CoverageException, msg):
cov.switch_context("test3")
+ def test_config_crash(self):
+ # The internal '[run] _crash' setting can be used to... | null | null | namanjain12/coveragepy_final:42a651c6e23b4156c5bc37208d97d0788e09edf7 | true | null | 2 | 9 | null | 1,002 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.197 | 80.50975 | ||
9,049 | r2e_gym::train::6142 | r2e_gym | train | 6,142 | pillow__8298fcce733dc090c49e0cbcbfe347f1e286276b | pillow | python-pillow/pillow | python | 8298fcce733dc090c49e0cbcbfe347f1e286276b | **Title:** Accessing GIF Comment Raises KeyError Due to Unsupported Comment Extension
**Description:**
When loading a GIF file that includes a comment extension, attempting to access the comment results in a `KeyError`. This occurs because the comment data is not being correctly parsed and stored within the image info... | diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py
--- a/PIL/GifImagePlugin.py
+++ b/PIL/GifImagePlugin.py
@@ -198,6 +198,11 @@
# correct, but it seems to prevent the last
# frame from looking odd for some animations
self.disposal_method... | 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
@@ -267,6 +267,18 @@
self.assertEqual(reread.info['background'], im.info['background'])
+ def test_comment(self):
+ im = Image.open(TEST_GIF)
+ self.assertEqual(im.info['c... | null | null | namanjain12/pillow_final:8298fcce733dc090c49e0cbcbfe347f1e286276b | true | null | 1 | 19 | null | 801 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.196833 | 80.50925 | ||
9,050 | r2e_gym::train::5631 | r2e_gym | train | 5,631 | scrapy__2dfdde3c79a5be468302a1e825cc5ad77444a8ac | scrapy | scrapy/scrapy | python | 2dfdde3c79a5be468302a1e825cc5ad77444a8ac | **Title:** CsvItemExporter Fails When Exporting Fields with Non-String Values
**Description:**
When exporting items that contain non-string field values, such as lists of integers, the `CsvItemExporter` raises a `TypeError`. This prevents the exporter from handling and writing these fields correctly.
**Example Code:*... | diff --git a/scrapy/exporters.py b/scrapy/exporters.py
--- a/scrapy/exporters.py
+++ b/scrapy/exporters.py
@@ -192,8 +192,15 @@
fields = self._get_serialized_fields(item, default_value='',
include_empty=True)
- values = [to_native_str(x) for _, x in fields... | diff --git a/tests/test_exporters.py b/tests/test_exporters.py
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -236,6 +236,13 @@
include_headers_line=False,
expected='"Mary,Paul",John\r\n',
)
+
+ def test_join_multivalue_not_strings(self):
+ self.a... | null | null | namanjain12/scrapy_final:2dfdde3c79a5be468302a1e825cc5ad77444a8ac | true | null | 1 | 11 | null | 959 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1965 | 80.50825 | ||
9,051 | r2e_gym::train::353 | r2e_gym | train | 353 | orange3__21b6b45f0bfdb5b81810ef0f6e7bc1380e69cf1b | orange3 | biolab/orange3 | python | 21b6b45f0bfdb5b81810ef0f6e7bc1380e69cf1b | **Title:** KeyError When Opening Single-File Zip Archive in owcsvimport
**Description:**
When using the `_open` function to read a single-file zip archive, a `KeyError` is raised indicating that the specified file does not exist in the archive. This occurs even though the archive contains exactly one file.
**Example ... | diff --git a/Orange/widgets/data/owcsvimport.py b/Orange/widgets/data/owcsvimport.py
--- a/Orange/widgets/data/owcsvimport.py
+++ b/Orange/widgets/data/owcsvimport.py
@@ -1101,9 +1101,14 @@
arh = zipfile.ZipFile(path, 'r')
filelist = arh.infolist()
if len(filelist) == 1:
- filename... | diff --git a/Orange/widgets/data/tests/test_owcsvimport.py b/Orange/widgets/data/tests/test_owcsvimport.py
--- a/Orange/widgets/data/tests/test_owcsvimport.py
+++ b/Orange/widgets/data/tests/test_owcsvimport.py
@@ -1,4 +1,4 @@
-# pylint: disable=no-self-use
+# pylint: disable=no-self-use,protected-access
import unitte... | null | null | namanjain12/orange3_final:21b6b45f0bfdb5b81810ef0f6e7bc1380e69cf1b | true | null | 1 | 11 | null | 958 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.196333 | 80.50775 | ||
9,052 | r2e_gym::train::154 | r2e_gym | train | 154 | orange3__dc9d8bebf4c35cae751ff71841ebb80f574255e4 | orange3 | biolab/orange3 | python | dc9d8bebf4c35cae751ff71841ebb80f574255e4 | **Title:** TypeError Occurs When Loading Variable Definitions with Unused Variables
**Description:**
When loading variable definitions that include variables not present in the dataset, the application crashes unexpectedly.
**Example Code:**
```python
widget = OWColor()
try:
widget._parse_var_defs({
"cate... | diff --git a/Orange/widgets/data/owcolor.py b/Orange/widgets/data/owcolor.py
--- a/Orange/widgets/data/owcolor.py
+++ b/Orange/widgets/data/owcolor.py
@@ -647,16 +647,15 @@
return
try:
- f = open(fname)
+ with open(fname) as f:
+ js = json.load(f) #: dict
+ ... | diff --git a/Orange/widgets/data/tests/test_owcolor.py b/Orange/widgets/data/tests/test_owcolor.py
--- a/Orange/widgets/data/tests/test_owcolor.py
+++ b/Orange/widgets/data/tests/test_owcolor.py
@@ -793,6 +793,32 @@
msg_box.reset_mock()
self.widget._parse_var_defs.assert_called_with(js... | null | null | namanjain12/orange3_final:dc9d8bebf4c35cae751ff71841ebb80f574255e4 | true | null | 1 | 25 | null | 675 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.195833 | 80.50625 | ||
9,053 | r2e_gym::train::4211 | r2e_gym | train | 4,211 | numpy__57225485fe72ca059e8c7d9fa17a07c3a31ba009 | numpy | numpy/numpy | python | 57225485fe72ca059e8c7d9fa17a07c3a31ba009 | **Title:** `stack_arrays` Fails When Stacking Arrays with Subdtypes
**Description:**
When using `stack_arrays` to combine structured arrays that include subdtypes, a `ValueError` is raised instead of successfully stacking the arrays.
**Example Code:**
```python
import numpy as np
from numpy.lib.recfunctions import st... | diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -782,10 +782,10 @@
fldnames = [d.names for d in ndtype]
#
dtype_l = ndtype[0]
- newdescr = dtype_l.descr
+ newdescr = get_fieldspec(dtype_l)
names = [_[0] for _... | diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py
--- a/numpy/lib/tests/test_recfunctions.py
+++ b/numpy/lib/tests/test_recfunctions.py
@@ -545,6 +545,35 @@
dtype=bdtype)
assert_equal(test, control)
assert_equal(test.mask, control.mask... | null | null | namanjain12/numpy_final:57225485fe72ca059e8c7d9fa17a07c3a31ba009 | true | null | 1 | 10 | null | 974 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.195667 | 80.50575 | ||
9,054 | r2e_gym::train::4961 | r2e_gym | train | 4,961 | datalad__6096b64e10afc251895b2eabdf126cef2a94c33b | datalad | datalad/datalad | python | 6096b64e10afc251895b2eabdf126cef2a94c33b | **Title:** ProducerConsumer class does not accept `jobs` parameter, causing TypeError
**Description:**
When initializing the `ProducerConsumer` class with the `jobs` keyword argument, a `TypeError` is raised indicating that the `__init__` method does not recognize the `jobs` parameter.
**Example Code:**
```python
con... | diff --git a/datalad/support/parallel.py b/datalad/support/parallel.py
--- a/datalad/support/parallel.py
+++ b/datalad/support/parallel.py
@@ -50,7 +50,7 @@
def __init__(self,
producer, consumer,
- njobs=None,
+ jobs=None,
safe_to_consume=None,
... | diff --git a/datalad/support/tests/test_parallel.py b/datalad/support/tests/test_parallel.py
--- a/datalad/support/tests/test_parallel.py
+++ b/datalad/support/tests/test_parallel.py
@@ -46,12 +46,12 @@
assert_equal(list(ProducerConsumer(
slowprod(10),
slowcons,
- njobs=10,
+ jobs=1... | null | null | namanjain12/datalad_final:6096b64e10afc251895b2eabdf126cef2a94c33b | true | null | 1 | 15 | null | 873 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1955 | 80.50525 | ||
9,055 | r2e_gym::train::5623 | r2e_gym | train | 5,623 | scrapy__5af45689e49bc97bd2c47d60d28333e578e2db4e | scrapy | scrapy/scrapy | python | 5af45689e49bc97bd2c47d60d28333e578e2db4e | **Title:** Unable to Set Custom Attributes When Creating Deprecated Class
**Description:**
When using the `create_deprecated_class` function with a custom `clsdict`, the resulting Deprecated class does not include the specified attributes. This leads to an `AttributeError` when attempting to access these attributes.
... | diff --git a/scrapy/utils/deprecate.py b/scrapy/utils/deprecate.py
--- a/scrapy/utils/deprecate.py
+++ b/scrapy/utils/deprecate.py
@@ -12,7 +12,9 @@
(cname, oldattr, version, cname, newattr), ScrapyDeprecationWarning, stacklevel=3)
-def create_deprecated_class(name, new_class, warn_category=ScrapyDeprecati... | diff --git a/scrapy/tests/test_utils_deprecate.py b/scrapy/tests/test_utils_deprecate.py
--- a/scrapy/tests/test_utils_deprecate.py
+++ b/scrapy/tests/test_utils_deprecate.py
@@ -25,7 +25,8 @@
def test_warning_on_subclassing(self):
with warnings.catch_warnings(record=True) as w:
- Deprecated ... | null | null | namanjain12/scrapy_final:5af45689e49bc97bd2c47d60d28333e578e2db4e | true | null | 1 | 15 | null | 870 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.195 | 80.50375 | ||
9,056 | r2e_gym::train::5060 | r2e_gym | train | 5,060 | datalad__6d7e070c65827f2deb828f58770cfb02350d47f6 | datalad | datalad/datalad | python | 6d7e070c65827f2deb828f58770cfb02350d47f6 | **Title:** `question()` Method Raises TypeError When Disabling Repeated Entry
**Description:**
When attempting to disable repeated entry by passing the `repeat=False` argument to the `question()` method, a `TypeError` is raised. This issue prevents developers from disabling the unnecessary and annoying repeated prompt... | diff --git a/datalad/ui/base.py b/datalad/ui/base.py
--- a/datalad/ui/base.py
+++ b/datalad/ui/base.py
@@ -27,7 +27,8 @@
def question(self, text,
title=None, choices=None,
default=None,
- hidden=False):
+ hidden=False,
+ repeat=Non... | diff --git a/datalad/ui/tests/test_dialog.py b/datalad/ui/tests/test_dialog.py
--- a/datalad/ui/tests/test_dialog.py
+++ b/datalad/ui/tests/test_dialog.py
@@ -102,6 +102,13 @@
eq_(response, 'ab')
gpcm.assert_has_calls([call('?: '), call('? (repeat): ')])
+ # explicitly request no repeats
+ wit... | null | null | namanjain12/datalad_final:6d7e070c65827f2deb828f58770cfb02350d47f6 | true | null | 2 | 10 | null | 969 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.194833 | 80.50325 | ||
9,057 | r2e_gym::train::6063 | r2e_gym | train | 6,063 | pillow__f3451aefc649a77add0232da4011cffd47f2e89f | pillow | python-pillow/pillow | python | f3451aefc649a77add0232da4011cffd47f2e89f | **Title:** RGB Palette Mode Fails to Handle Opaque RGBA Colors Properly
**Description:**
When using a palette in RGB mode, providing an RGBA color tuple with an alpha value of 255 does not convert the color to RGB as expected. Instead, it attempts to allocate the color as a distinct entry, which can quickly exceed the... | diff --git a/src/PIL/ImagePalette.py b/src/PIL/ImagePalette.py
--- a/src/PIL/ImagePalette.py
+++ b/src/PIL/ImagePalette.py
@@ -105,8 +105,12 @@
if self.rawmode:
raise ValueError("palette contains raw palette data")
if isinstance(color, tuple):
- if self.mode == "RGBA" and len(c... | diff --git a/Tests/test_imagepalette.py b/Tests/test_imagepalette.py
--- a/Tests/test_imagepalette.py
+++ b/Tests/test_imagepalette.py
@@ -28,6 +28,8 @@
# Colors can be converted between RGB and RGBA
rgba_palette = ImagePalette.ImagePalette("RGBA")
assert rgba_palette.getcolor((0, 0, 0)) == rgba_palette.... | null | null | namanjain12/pillow_final:f3451aefc649a77add0232da4011cffd47f2e89f | true | null | 1 | 8 | null | 1,007 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1945 | 80.50225 | ||
9,058 | r2e_gym::train::6629 | r2e_gym | train | 6,629 | pillow__669fd6a60086e92fe22621483c755ebd36603413 | pillow | python-pillow/pillow | python | 669fd6a60086e92fe22621483c755ebd36603413 | **Title:** TypeError When Using Generator with `append_images` for WEBP Animated Images
**Description:**
When attempting to save an animated WEBP image using a generator for the `append_images` parameter, a `TypeError` is raised. This prevents the creation of animated WEBP files when `append_images` is provided as a g... | diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py
--- a/PIL/TiffImagePlugin.py
+++ b/PIL/TiffImagePlugin.py
@@ -1784,14 +1784,14 @@
def _save_all(im, fp, filename):
encoderinfo = im.encoderinfo.copy()
encoderconfig = im.encoderconfig
- append_images = encoderinfo.get("append_images", [])
+ a... | diff --git a/Tests/test_file_webp_animated.py b/Tests/test_file_webp_animated.py
--- a/Tests/test_file_webp_animated.py
+++ b/Tests/test_file_webp_animated.py
@@ -65,25 +65,35 @@
are visually similar to the originals.
"""
- temp_file = self.tempfile("temp.webp")
- temp_file2 = self.tem... | null | null | namanjain12/pillow_final:669fd6a60086e92fe22621483c755ebd36603413 | true | null | 2 | 6 | null | 1,047 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1945 | 80.50225 | ||
9,059 | r2e_gym::train::5819 | r2e_gym | train | 5,819 | tornado__149159d19334fe5f7c1b553e8f6c92a8e3f04385 | tornado | tornadoweb/tornado | python | 149159d19334fe5f7c1b553e8f6c92a8e3f04385 | **Title:** `is_valid_ip` Raises `UnicodeError` for Overly Long IP Input Instead of Returning False
**Description:**
When providing a string longer than 63 characters to the `is_valid_ip` function, it unexpectedly raises a `UnicodeError` instead of returning `False`. This behavior occurs because `socket.getaddrinfo` is... | diff --git a/tornado/netutil.py b/tornado/netutil.py
--- a/tornado/netutil.py
+++ b/tornado/netutil.py
@@ -301,6 +301,12 @@
if e.args[0] == socket.EAI_NONAME:
return False
raise
+ except UnicodeError:
+ # `socket.getaddrinfo` will raise a UnicodeError from the
+ # `idna` ... | diff --git a/tornado/test/netutil_test.py b/tornado/test/netutil_test.py
--- a/tornado/test/netutil_test.py
+++ b/tornado/test/netutil_test.py
@@ -204,6 +204,7 @@
self.assertTrue(not is_valid_ip(" "))
self.assertTrue(not is_valid_ip("\n"))
self.assertTrue(not is_valid_ip("\x00"))
+ sel... | null | null | namanjain12/tornado_final:149159d19334fe5f7c1b553e8f6c92a8e3f04385 | true | null | 1 | 6 | null | 1,044 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.194 | 80.50075 | ||
9,060 | r2e_gym::train::6650 | r2e_gym | train | 6,650 | pillow__ccac8540771120bdeb570ec5b7bbfc4e3e9a38dd | pillow | python-pillow/pillow | python | ccac8540771120bdeb570ec5b7bbfc4e3e9a38dd | **Title:** ImageGrab.grabclipboard() Fails on Linux Despite wl-paste Availability
**Description:**
On Linux systems where `wl-paste` is installed, calling `ImageGrab.grabclipboard()` raises a `NotImplementedError`. This prevents users from accessing the clipboard image content on Linux, even when the necessary tool (`... | 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,14 @@
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:ccac8540771120bdeb570ec5b7bbfc4e3e9a38dd | true | null | 1 | 12 | null | 924 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.194 | 80.50075 | ||
9,061 | r2e_gym::train::4105 | r2e_gym | train | 4,105 | coveragepy__5901967e95ae72ec2b5be05bc08e1924e08a604b | coveragepy | nedbat/coveragepy | python | 5901967e95ae72ec2b5be05bc08e1924e08a604b | **Title:** Configuration `paths` Do Not Expand `~` and User Variables, Causing Incorrect Path Resolution
**Description:**
When defining file paths in the configuration using `~` to represent the user's home directory, the paths are not being properly expanded to their absolute forms. This results in the application us... | diff --git a/coverage/config.py b/coverage/config.py
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -534,5 +534,6 @@
config.data_file = os.path.expanduser(config.data_file)
config.html_dir = os.path.expanduser(config.html_dir)
config.xml_output = os.path.expanduser(config.xml_output)
+ config.pa... | diff --git a/tests/test_config.py b/tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -275,6 +275,11 @@
exclude_lines =
~/data.file
~joe/html_dir
+
+ [paths]
+ mapping =
+ ~/src
+ ~joe/source
... | null | null | namanjain12/coveragepy_final:5901967e95ae72ec2b5be05bc08e1924e08a604b | true | null | 2 | 6 | null | 1,043 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.193833 | 80.50025 | ||
9,062 | r2e_gym::train::4039 | r2e_gym | train | 4,039 | coveragepy__2a0e7bc17f932e33ef9c437760ae2f9f60b46390 | coveragepy | nedbat/coveragepy | python | 2a0e7bc17f932e33ef9c437760ae2f9f60b46390 | **Title:** `exclude_also` option not appending patterns to `exclude_list`
**Description:**
When configuring coverage with the `exclude_also` option, the specified patterns are not being added to the `exclude_list`. This causes the additional patterns intended for exclusion to be ignored in the coverage report.
**Exam... | diff --git a/coverage/config.py b/coverage/config.py
--- a/coverage/config.py
+++ b/coverage/config.py
@@ -215,6 +215,7 @@
# Defaults for [report]
self.exclude_list = DEFAULT_EXCLUDE[:]
+ self.exclude_also: List[str] = []
self.fail_under = 0.0
self.format: Optional[str] = No... | diff --git a/tests/test_config.py b/tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -449,6 +449,15 @@
with pytest.raises(ConfigError, match="No option 'foo' in section: 'xyzzy'"):
config.get("xyzzy", "foo")
+ def test_exclude_also(self) -> None:
+ self.mak... | null | null | namanjain12/coveragepy_final:2a0e7bc17f932e33ef9c437760ae2f9f60b46390 | true | null | 3 | 21 | null | 739 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.193167 | 80.49825 | ||
9,063 | r2e_gym::train::4097 | r2e_gym | train | 4,097 | coveragepy__25311c6caabed2f13da991dae52352c3c896a3e9 | coveragepy | nedbat/coveragepy | python | 25311c6caabed2f13da991dae52352c3c896a3e9 | **Title:** TOML Configuration Fails to Parse Environment Variables in Settings
**Description:**
When environment variables are used within a TOML configuration file, parsing fails with an error indicating an invalid literal. For example, setting a configuration value like `branch = $BRANCH` with the environment variab... | diff --git a/coverage/tomlconfig.py b/coverage/tomlconfig.py
--- a/coverage/tomlconfig.py
+++ b/coverage/tomlconfig.py
@@ -8,7 +8,7 @@
import re
from coverage import env
-from coverage.backward import configparser, path_types, string_class, toml
+from coverage.backward import configparser, path_types, toml
from co... | diff --git a/tests/test_config.py b/tests/test_config.py
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -229,7 +229,7 @@
self.make_file("pyproject.toml", """\
[tool.coverage.run]
data_file = "$DATA_FILE.fooey"
- branch = true
+ branch = $BRANCH
... | null | null | namanjain12/coveragepy_final:25311c6caabed2f13da991dae52352c3c896a3e9 | true | null | 1 | 11 | null | 939 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.193167 | 80.49825 | ||
9,064 | r2e_gym::train::5779 | r2e_gym | train | 5,779 | tornado__d63cb6a7cb80758dad7f99688824ea8768f650db | tornado | tornadoweb/tornado | python | d63cb6a7cb80758dad7f99688824ea8768f650db | **Title:** Converting HTTPHeaders to string and parsing back raises ValueError
**Description:**
When attempting to convert an `HTTPHeaders` instance to a string and then parsing it back, a `ValueError` is raised due to incorrect string formatting.
**Example Code:**
```python
headers = HTTPHeaders()
headers.add("Foo",... | diff --git a/tornado/httputil.py b/tornado/httputil.py
--- a/tornado/httputil.py
+++ b/tornado/httputil.py
@@ -233,6 +233,14 @@
# This makes shallow copies one level deeper, but preserves
# the appearance that HTTPHeaders is a single container.
__copy__ = copy
+
+ def __str__(self):
+ lines = [... | diff --git a/tornado/test/httputil_test.py b/tornado/test/httputil_test.py
--- a/tornado/test/httputil_test.py
+++ b/tornado/test/httputil_test.py
@@ -318,6 +318,14 @@
self.assertEqual(headers['quux'], 'xyzzy')
self.assertEqual(sorted(headers.get_all()), [('Foo', 'bar'), ('Quux', 'xyzzy')])
+ def... | null | null | namanjain12/tornado_final:d63cb6a7cb80758dad7f99688824ea8768f650db | true | null | 1 | 8 | null | 998 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.193 | 80.49775 | ||
9,065 | r2e_gym::train::5296 | r2e_gym | train | 5,296 | aiohttp__aaa889312e9ba8ec7a812adc31e3d61c8cad4a49 | aiohttp | aio-libs/aiohttp | python | aaa889312e9ba8ec7a812adc31e3d61c8cad4a49 | **Title:** Accessing `content_length` on Request object raises AttributeError
**Description:**
When creating a request with the `Content-Length` header and attempting to access the `content_length` property, an `AttributeError` is raised because the `Request` object does not have a `content_length` attribute.
**Examp... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -54,6 +54,14 @@
if self._content_type is None:
self.content_type # calculates _content_dict also
return self._content_dict.get('charset', 'utf-8')
+
+ @property
+ def content_length(self):
+ ... | diff --git a/tests/test_web_request.py b/tests/test_web_request.py
--- a/tests/test_web_request.py
+++ b/tests/test_web_request.py
@@ -61,3 +61,8 @@
def test_non_ascii_path(self):
req = self.make_request('GET', '/путь')
self.assertEqual('/путь', req.path)
+
+ def test_content_length(self):
+ ... | null | null | namanjain12/aiohttp_final:aaa889312e9ba8ec7a812adc31e3d61c8cad4a49 | true | null | 1 | 15 | null | 857 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.192833 | 80.49725 | ||
9,066 | r2e_gym::train::5207 | r2e_gym | train | 5,207 | pyramid__1281a5ccffdbf5a5f22da1a38c4c82075ff0505c | pyramid | pylons/pyramid | python | 1281a5ccffdbf5a5f22da1a38c4c82075ff0505c | **Title:** `get_renderer()` Raises TypeError When `registry` Argument is Provided
**Description:**
When attempting to retrieve a renderer by supplying a `registry`, the `get_renderer` function does not recognize the `registry` argument, resulting in a `TypeError`.
**Example Code:**
```python
from pyramid.renderers im... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -331,3 +331,4 @@
- Kuzma Leshakov, 2018/09/07
+- Colin Dunklau, 2018/09/19
diff --git a/pyramid/renderers.py b/pyramid/renderers.py
--- a/pyramid/renderers.py
+++ b/pyramid/renderers.py
@@ -147,7 +147,7 @@
retu... | 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
@@ -624,6 +624,12 @@
result = self._callFUT('abc/def.pt', package=pyramid.tests)
self.assertEqual(result, renderer)
+ def test_it_with_registr... | null | null | namanjain12/pyramid_final:1281a5ccffdbf5a5f22da1a38c4c82075ff0505c | true | null | 2 | 11 | null | 936 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.192667 | 80.49675 | ||
9,067 | r2e_gym::train::6423 | r2e_gym | train | 6,423 | pillow__66f5ad0eae90b6f4b07df1a3154f996c6fe00069 | pillow | python-pillow/pillow | python | 66f5ad0eae90b6f4b07df1a3154f996c6fe00069 | **Title:** Saving WebP Images with Non-Opaque Background as GIF Raises ValueError
**Description:**
When attempting to save a WebP image that has a non-opaque (transparent) background as a GIF, the process fails with a `ValueError`. This occurs because the non-opaque RGBA color cannot be added to the RGB palette requir... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -886,20 +886,23 @@
def _get_background(im, info_background):
background = 0
if info_background:
- background = info_background
- if isinstance(background, tuple)... | 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
@@ -859,13 +859,22 @@
im.info["background"] = 1
im.save(out)
with Image.open(out) as reread:
-
assert reread.info["background"] == im.info["background"]
+
+def test_webp_backg... | null | null | namanjain12/pillow_final:66f5ad0eae90b6f4b07df1a3154f996c6fe00069 | true | null | 1 | 15 | null | 856 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.192667 | 80.49675 | ||
9,068 | r2e_gym::train::6406 | r2e_gym | train | 6,406 | pillow__d2e73b0304d9d0bea55619cf92ddc38eaa0fb6b1 | pillow | python-pillow/pillow | python | d2e73b0304d9d0bea55619cf92ddc38eaa0fb6b1 | **Title:** Resizing Images with Special Modes Fails Due to Incorrect Default Resampling Filter
**Description:**
When attempting to resize images that use special modes with specified bit depths (e.g., "I;16"), the operation fails with a `ValueError`. This issue occurs because the default resampling filter is set to BI... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1849,7 +1849,7 @@
min(self.size[1], math.ceil(box[3] + support_y)),
)
- def resize(self, size, resample=BICUBIC, box=None, reducing_gap=None):
+ def resize(self, size, resample=None, box=None... | diff --git a/Tests/test_image_resize.py b/Tests/test_image_resize.py
--- a/Tests/test_image_resize.py
+++ b/Tests/test_image_resize.py
@@ -250,3 +250,7 @@
for mode in "1", "P":
im = hopper(mode)
assert im.resize((20, 20), Image.NEAREST) == im.resize((20, 20))
+
+ for mode in "I... | null | null | namanjain12/pillow_final:d2e73b0304d9d0bea55619cf92ddc38eaa0fb6b1 | true | null | 1 | 15 | null | 853 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.192167 | 80.49525 | ||
9,069 | r2e_gym::train::6469 | r2e_gym | train | 6,469 | pillow__3f5fad3a27cbc7d0a5be1bfb2a0ca03c18c1279c | pillow | python-pillow/pillow | python | 3f5fad3a27cbc7d0a5be1bfb2a0ca03c18c1279c | **Title:** Unable to Save BUFR, GRIB, and HDF5 Images Despite Registered Handlers
**Description**
When attempting to save images using the BUFR, GRIB, or HDF5 stub plugins with a registered handler, an `OSError` is raised indicating that the save handler is not installed. This occurs even though a valid handler has be... | diff --git a/src/PIL/BufrStubImagePlugin.py b/src/PIL/BufrStubImagePlugin.py
--- a/src/PIL/BufrStubImagePlugin.py
+++ b/src/PIL/BufrStubImagePlugin.py
@@ -59,7 +59,7 @@
def _save(im, fp, filename):
- if _handler is None or not hasattr("_handler", "save"):
+ if _handler is None or not hasattr(_handler, "save"... | diff --git a/Tests/test_file_bufrstub.py b/Tests/test_file_bufrstub.py
--- a/Tests/test_file_bufrstub.py
+++ b/Tests/test_file_bufrstub.py
@@ -45,3 +45,35 @@
# Act / Assert: stub cannot save without an implemented handler
with pytest.raises(OSError):
im.save(tmpfile)
+
+
+def test_handler(tmp_path):
... | null | null | namanjain12/pillow_final:3f5fad3a27cbc7d0a5be1bfb2a0ca03c18c1279c | true | null | 3 | 6 | null | 1,032 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.192 | 80.49475 | ||
9,070 | r2e_gym::train::6050 | r2e_gym | train | 6,050 | pillow__f6cb5efa1522b7eadde2fcb75af2673f1f3f3002 | pillow | python-pillow/pillow | python | f6cb5efa1522b7eadde2fcb75af2673f1f3f3002 | **Title:** `Image.show` Raises TypeError After Deprecating `_showxv`
**Description:**
After deprecating the `_showxv` method in the `PIL.Image` module, calling `Image.show` results in a `TypeError`. This issue prevents images from being displayed as expected.
**Example Code:**
```python
from PIL import Image
# Creat... | diff --git a/docs/deprecations.rst b/docs/deprecations.rst
--- a/docs/deprecations.rst
+++ b/docs/deprecations.rst
@@ -19,6 +19,15 @@
The ``command`` parameter was deprecated and will be removed in a future release.
Use a subclass of ``ImageShow.Viewer`` instead.
+
+Image._showxv
+~~~~~~~~~~~~~
+
+.. deprecated:: 7... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -5,7 +5,7 @@
import PIL
import pytest
-from PIL import Image, ImageDraw, ImagePalette, UnidentifiedImageError
+from PIL import Image, ImageDraw, ImagePalette, ImageShow, UnidentifiedImageError
from .help... | null | null | namanjain12/pillow_final:f6cb5efa1522b7eadde2fcb75af2673f1f3f3002 | true | null | 3 | 25 | null | 649 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1915 | 80.49325 | ||
9,071 | r2e_gym::train::5976 | r2e_gym | train | 5,976 | tornado__f57fd525f9d765b9578a025ae65919a4e79efeeb | tornado | tornadoweb/tornado | python | f57fd525f9d765b9578a025ae65919a4e79efeeb | **Title:** `OptionParser` Missing `as_dict()` Method Causes AttributeError
**Description:**
When attempting to retrieve all defined options as a dictionary using the `as_dict()` method, an `AttributeError` is raised because the method does not exist. This prevents users from easily accessing all option names and their... | diff --git a/tornado/options.py b/tornado/options.py
--- a/tornado/options.py
+++ b/tornado/options.py
@@ -115,11 +115,8 @@
"""The set of option-groups created by ``define``."""
return set(opt.group_name for opt in self._options.values())
- def group_dict(self, group=None):
- """A dict of ... | diff --git a/tornado/test/options_test.py b/tornado/test/options_test.py
--- a/tornado/test/options_test.py
+++ b/tornado/test/options_test.py
@@ -135,6 +135,11 @@
actual = sorted(options.items())
self.assertEqual(expected, actual)
+ def test_as_dict(self):
+ options = self._sample_options... | null | null | namanjain12/tornado_final:f57fd525f9d765b9578a025ae65919a4e79efeeb | true | null | 1 | 12 | null | 906 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.191 | 80.49175 | ||
9,072 | r2e_gym::train::6193 | r2e_gym | train | 6,193 | pillow__a7eb2ea9ccdf4f55ae97c0c65cb353af033cebfb | pillow | python-pillow/pillow | python | a7eb2ea9ccdf4f55ae97c0c65cb353af033cebfb | **Title:** Saving GIF with Tuple Background Color Causes TypeError
**Description:**
When attempting to save a GIF image with a tuple representing the background color, the save operation fails with a `TypeError`. This occurs because the code does not properly convert the tuple to a global color table index, leading to... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -711,10 +711,17 @@
if im.info.get("version") == b"89a":
version = b"89a"
+ background = 0
+ if "background" in info:
+ background = info["background"... | 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
@@ -3,6 +3,12 @@
from PIL import Image, ImagePalette, GifImagePlugin
from io import BytesIO
+
+try:
+ from PIL import _webp
+ HAVE_WEBP = True
+except ImportError:
+ HAVE_WEBP = False
c... | null | null | namanjain12/pillow_final:a7eb2ea9ccdf4f55ae97c0c65cb353af033cebfb | true | null | 1 | 11 | null | 926 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.191 | 80.49175 | ||
9,073 | r2e_gym::train::4977 | r2e_gym | train | 4,977 | datalad__32d46b6b7d1fea1653836adfa33a61c653ff6bc7 | datalad | datalad/datalad | python | 32d46b6b7d1fea1653836adfa33a61c653ff6bc7 | **Title:** Renaming `poll_period` to `poll_latency` Causes Multiple Values for `path` Argument
**Description:**
After renaming the `poll_period` parameter to `poll_latency` in the `run` method of `WitlessRunner`, certain function calls are resulting in a `TypeError`. Specifically, when attempting to pass `poll_latency... | diff --git a/datalad/cmd.py b/datalad/cmd.py
--- a/datalad/cmd.py
+++ b/datalad/cmd.py
@@ -144,7 +144,7 @@
self.env['PWD'] = self.cwd
def run(self, cmd, proc_stdout=None, proc_stderr=None, stdin=None,
- poll_period=0.1):
+ poll_latency=0.1):
"""Execute a command and co... | diff --git a/datalad/tests/test_witless_runner.py b/datalad/tests/test_witless_runner.py
--- a/datalad/tests/test_witless_runner.py
+++ b/datalad/tests/test_witless_runner.py
@@ -169,7 +169,7 @@
# report that to the runner
proc_stdout=outproc,
# make sure the runner polls faster t... | null | null | namanjain12/datalad_final:32d46b6b7d1fea1653836adfa33a61c653ff6bc7 | true | null | 1 | 11 | null | 925 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.190833 | 80.49125 | ||
9,074 | r2e_gym::train::5310 | r2e_gym | train | 5,310 | aiohttp__d2fbdefd269d4d79e54c703d636269bf52505bfb | aiohttp | aio-libs/aiohttp | python | d2fbdefd269d4d79e54c703d636269bf52505bfb | **Title:** Request Constructor Fails with TypeError Due to Missing `keep_alive_timeout` Parameter
**Description:**
After recent changes, initializing a `Request` object without the `keep_alive_timeout` parameter results in a `TypeError`. The constructor no longer expects `keep_alive_timeout`, but existing code attempt... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -139,8 +139,7 @@
class Request(HeadersMixin):
- def __init__(self, app, message, payload, transport, reader, writer,
- keep_alive_timeout):
+ def __init__(self, app, message, payload, transport, reader, ... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -28,7 +28,7 @@
self.reader = mock.Mock()
self.writer = mock.Mock()
req = Request(self.app, message, self.payload,
- self.transport, self.r... | null | null | namanjain12/aiohttp_final:d2fbdefd269d4d79e54c703d636269bf52505bfb | true | null | 1 | 8 | null | 983 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1905 | 80.49025 | ||
9,075 | r2e_gym::train::5958 | r2e_gym | train | 5,958 | tornado__86a2cab2910bf5d0e9862492b28be2337d9a7de0 | tornado | tornadoweb/tornado | python | 86a2cab2910bf5d0e9862492b28be2337d9a7de0 | **Title:** `Lock.acquire()` Method Does Not Accept `timeout` Parameter
**Description:**
When attempting to acquire a lock using the `timeout` parameter, a `TypeError` is raised because the method only recognizes the `deadline` parameter. This inconsistency prevents developers from specifying a maximum wait time using ... | diff --git a/tornado/locks.py b/tornado/locks.py
--- a/tornado/locks.py
+++ b/tornado/locks.py
@@ -95,12 +95,12 @@
io_loop = ioloop.IOLoop.current()
# Wait up to 1 second for a notification.
- yield condition.wait(deadline=io_loop.time() + 1)
-
- ...or a `datetime.timedelta` for a deadline... | diff --git a/tornado/test/locks_test.py b/tornado/test/locks_test.py
--- a/tornado/test/locks_test.py
+++ b/tornado/test/locks_test.py
@@ -448,7 +448,7 @@
lock = locks.Lock()
lock.acquire()
with self.assertRaises(gen.TimeoutError):
- yield lock.acquire(deadline=timedelta(seconds=0.... | null | null | namanjain12/tornado_final:86a2cab2910bf5d0e9862492b28be2337d9a7de0 | true | null | 1 | 12 | null | 902 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.190333 | 80.48975 | ||
9,076 | r2e_gym::train::97 | r2e_gym | train | 97 | orange3__a8d53f3c625bd2b6698ddd210a2ef790825d993a | orange3 | biolab/orange3 | python | a8d53f3c625bd2b6698ddd210a2ef790825d993a | **Title:** `BasketReader` Missing `_read_file` Method Causes AttributeError
**Description:**
When using the `BasketReader` class to process files, calling the `_read_file` method results in an `AttributeError` because the method is not defined within the class.
**Example Code:**
```python
import io
from Orange.data.i... | diff --git a/Orange/data/io.py b/Orange/data/io.py
--- a/Orange/data/io.py
+++ b/Orange/data/io.py
@@ -177,12 +177,12 @@
class BasketReader():
re_name = re.compile("([^,=\\n]+)(=((\d+\.?)|(\d*\.\d+)))?")
- def prescan_file(self, filename):
+ def prescan_file(self, file):
"""Return a list of attri... | diff --git a/Orange/tests/test_basket_reader.py b/Orange/tests/test_basket_reader.py
--- a/Orange/tests/test_basket_reader.py
+++ b/Orange/tests/test_basket_reader.py
@@ -0,0 +1,63 @@
+import io
+import unittest
+
+import numpy as np
+
+from Orange.data.io import BasketReader
+
+class TestBasketReader(unittest.TestCase... | null | null | namanjain12/orange3_final:a8d53f3c625bd2b6698ddd210a2ef790825d993a | true | null | 1 | 14 | null | 862 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.190333 | 80.48975 | ||
9,077 | r2e_gym::train::5605 | r2e_gym | train | 5,605 | scrapy__061c63592a3678e059fdeb964e6878663698237b | scrapy | scrapy/scrapy | python | 061c63592a3678e059fdeb964e6878663698237b | **Title:** MailSender.send Method Does Not Accept 'charset' Parameter, Causing TypeError
**Description:**
When attempting to send an email with a specific charset, passing the `charset` argument to the `MailSender.send` method results in a `TypeError`. This prevents the proper encoding of email content with non-ASCII... | diff --git a/scrapy/mail.py b/scrapy/mail.py
--- a/scrapy/mail.py
+++ b/scrapy/mail.py
@@ -43,7 +43,7 @@
settings['MAIL_PASS'], settings.getint('MAIL_PORT'),
settings.getbool('MAIL_TLS'), settings.getbool('MAIL_SSL'))
- def send(self, to, subject, body, cc=None, attachs=(), mimetype='text... | 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:061c63592a3678e059fdeb964e6878663698237b | true | null | 1 | 7 | null | 1,002 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.190333 | 80.48975 | ||
9,078 | r2e_gym::train::4865 | r2e_gym | train | 4,865 | numpy__8b1b7f12a53f1a45f5572de3d704d894a60fa1c4 | numpy | numpy/numpy | python | 8b1b7f12a53f1a45f5572de3d704d894a60fa1c4 | **Title:** Masked singleton allows modification of read-only attributes
**Description:**
Attempting to modify attributes of the masked singleton should not be permitted, as it is intended to remain immutable. However, currently, setting attributes like `shape` and `dtype` on `np.ma.masked` does not raise an error, whi... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -6309,6 +6309,18 @@
# precedent for this with `np.bool_` scalars.
return self
+ def __setattr__(self, attr, value):
+ if not self.__has_singleton():
+ # allow the singleton to be in... | 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
@@ -4981,6 +4981,10 @@
assert_(a is not np.ma.masked)
assert_not_equal(repr(a), 'masked')
+ def test_attributes_readonly(self):
+ assert_raises(Attribu... | null | null | namanjain12/numpy_final:8b1b7f12a53f1a45f5572de3d704d894a60fa1c4 | true | null | 1 | 12 | null | 900 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.19 | 80.48875 | ||
9,079 | r2e_gym::train::4390 | r2e_gym | train | 4,390 | numpy__3b03c2ab12368561574a46f59c7e0992a36b896b | numpy | numpy/numpy | python | 3b03c2ab12368561574a46f59c7e0992a36b896b | **Title:** `numpy.delete` Raises `IndexError` When Using Object Dtype Array as Index for Single Item Deletion
**Description:**
When attempting to delete a single element from a NumPy array using an index provided as an object dtype array, `numpy.delete` raises an `IndexError`. This behavior is inconsistent with other ... | 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
@@ -5094,6 +5094,18 @@
return new
if isinstance(obj, (int, integer)) and not isinstance(obj, bool):
+ single_value = True
+ else:
+ single_value = F... | 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
@@ -889,6 +889,19 @@
np.delete([0, 1, 2], np.array([1.0, 2.0]))
with pytest.raises(IndexError):
np.delete(... | null | null | namanjain12/numpy_final:3b03c2ab12368561574a46f59c7e0992a36b896b | true | null | 1 | 17 | null | 798 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.189667 | 80.48775 | ||
9,080 | r2e_gym::train::5176 | r2e_gym | train | 5,176 | pyramid__30c443fc3b02857d89408668eeca63b7762578b2 | pyramid | pylons/pyramid | python | 30c443fc3b02857d89408668eeca63b7762578b2 | **Title:** Registry object missing `package_name` attribute causes initialization failures
**Description:**
When initializing a `Registry` with a package name, accessing the `package_name` attribute results in an `AttributeError`. This prevents proper retrieval of the package name and causes related tests to fail.
**... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -234,3 +234,5 @@
- Fenton Travers, 2014/05/06
- Randall Leeds, 2014/11/11
+
+- Hugo Branquinho, 2014/11/25
diff --git a/docs/api/registry.rst b/docs/api/registry.rst
--- a/docs/api/registry.rst
+++ b/docs/api/registry.... | diff --git a/pyramid/tests/test_registry.py b/pyramid/tests/test_registry.py
--- a/pyramid/tests/test_registry.py
+++ b/pyramid/tests/test_registry.py
@@ -11,6 +11,11 @@
def test___nonzero__(self):
registry = self._makeOne()
self.assertEqual(registry.__nonzero__(), True)
+
+ def test_package_n... | null | null | namanjain12/pyramid_final:30c443fc3b02857d89408668eeca63b7762578b2 | true | null | 3 | 19 | null | 757 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1895 | 80.48725 | ||
9,081 | r2e_gym::train::6338 | r2e_gym | train | 6,338 | pillow__2c5e5049db72b4f6f2c1dbf28237b9fa4f565d1d | pillow | python-pillow/pillow | python | 2c5e5049db72b4f6f2c1dbf28237b9fa4f565d1d | **Title:** Saving BMP Images with Compression Raises AttributeError
**Description:**
When attempting to save a BMP image with a compression value derived from the BMP info dictionary, an `AttributeError` is raised. This issue occurs because the compression value is an integer from the BMP info, which the current imple... | diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py
--- a/src/PIL/TiffImagePlugin.py
+++ b/src/PIL/TiffImagePlugin.py
@@ -1568,7 +1568,13 @@
encoderinfo = im.encoderinfo
encoderconfig = im.encoderconfig
- compression = encoderinfo.get("compression", im.info.get("compression"))
+ try:
... | 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
@@ -690,6 +690,13 @@
with Image.open(outfile) as reloaded:
assert reloaded.info["icc_profile"] == icc_profile
+ def test_save_bmp_compression(self, tmp_path):
+ wi... | null | null | namanjain12/pillow_final:2c5e5049db72b4f6f2c1dbf28237b9fa4f565d1d | true | null | 1 | 8 | null | 977 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1895 | 80.48725 | ||
9,082 | r2e_gym::train::4079 | r2e_gym | train | 4,079 | coveragepy__378c321ba035400b6091505446844e552d8808d5 | coveragepy | nedbat/coveragepy | python | 378c321ba035400b6091505446844e552d8808d5 | ### Incorrect Exit Counts with Nested Context Managers
When using nested `with` statements, the coverage parser incorrectly counts the exits, leading to inaccurate branch coverage reports.
**Example Code:**
```python
from contextlib import suppress
a = 1
with suppress(ValueError):
with suppress(ValueError):
... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -23,10 +23,15 @@
Unreleased
----------
+- Fix: nested context managers could incorrectly be analyzed to flag a missing
+ branch on the last context manager, as described in `issue 1876`_. This is
+ now fixed.
+
- Fix: the missing bran... | diff --git a/tests/test_parser.py b/tests/test_parser.py
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -150,6 +150,24 @@
assert expected_statements == parser.statements
assert expected_arcs == parser.arcs()
assert expected_exits == parser.exit_counts()
+
+ def test_nested_contex... | null | null | namanjain12/coveragepy_final:378c321ba035400b6091505446844e552d8808d5 | true | null | 2 | 19 | null | 757 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1895 | 80.48725 | ||
9,083 | r2e_gym::train::4273 | r2e_gym | train | 4,273 | numpy__f9e0771632428e7594ad3106019cc6cb96498b64 | numpy | numpy/numpy | python | f9e0771632428e7594ad3106019cc6cb96498b64 | **Title:** AttributeError when accessing single items with MaskedArray.flat
**Description:**
When accessing single items using the `flat` attribute of a `MaskedArray`, an `AttributeError` is raised. This issue prevents retrieving individual elements, especially masked ones, as expected.
**Example Code:**
```python
i... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2470,7 +2470,6 @@
return result
-
class MaskedIterator(object):
"""
Flat iterator object to iterate over masked arrays.
@@ -2534,8 +2533,12 @@
result = self.dataiter.__getitem__(indx).view... | 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
@@ -1305,17 +1305,50 @@
assert_equal(a.mask, nomask)
def test_flat(self):
+ # test simple access
+ test = masked_array(np.matrix([[1, 2, 3]]), mask=[0,... | null | null | namanjain12/numpy_final:f9e0771632428e7594ad3106019cc6cb96498b64 | true | null | 1 | 17 | null | 795 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.189167 | 80.48625 | ||
9,084 | r2e_gym::train::5660 | r2e_gym | train | 5,660 | scrapy__2f2c2e809652debe155d82be6429441e0fad1cbe | scrapy | scrapy/scrapy | python | 2f2c2e809652debe155d82be6429441e0fad1cbe | **Title:** `NameError: name 'unicode' is not defined` when processing XML responses in Python 3
**Description:**
When processing XML responses, the `_StreamReader` class raises a `NameError` because it references `unicode`, which is not defined in Python 3.
**Example Code:**
```python
class _StreamReader(object):
... | diff --git a/scrapy/utils/iterators.py b/scrapy/utils/iterators.py
--- a/scrapy/utils/iterators.py
+++ b/scrapy/utils/iterators.py
@@ -1,12 +1,11 @@
import re
import csv
import logging
-
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
-
+from io import StringIO
... | diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txt
--- a/tests/py3-ignores.txt
+++ b/tests/py3-ignores.txt
@@ -16,7 +16,6 @@
tests/test_pipeline_images.py
tests/test_proxy_connect.py
tests/test_spidermiddleware_httperror.py
-tests/test_utils_iterators.py
tests/test_utils_template.py
tests/test_webclient.py... | null | null | namanjain12/scrapy_final:2f2c2e809652debe155d82be6429441e0fad1cbe | true | null | 1 | 11 | null | 913 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.188833 | 80.48525 | ||
9,085 | r2e_gym::train::6285 | r2e_gym | train | 6,285 | pillow__331595926c5957cc5612b1778b6b60c184e09b13 | pillow | python-pillow/pillow | python | 331595926c5957cc5612b1778b6b60c184e09b13 | **Title:** Deprecate function raises ValueError instead of RuntimeError for current major versions
**Description:**
When using the `deprecate` function to mark a feature as deprecated with a version number that is less than or equal to the current major version, it unexpectedly raises a `ValueError` instead of the int... | diff --git a/src/PIL/_deprecate.py b/src/PIL/_deprecate.py
--- a/src/PIL/_deprecate.py
+++ b/src/PIL/_deprecate.py
@@ -1,6 +1,8 @@
from __future__ import annotations
import warnings
+
+from . import __version__
def deprecate(
@@ -38,10 +40,12 @@
is_ = "are" if plural else "is"
- if when == 10:
+ ... | diff --git a/Tests/test_deprecate.py b/Tests/test_deprecate.py
--- a/Tests/test_deprecate.py
+++ b/Tests/test_deprecate.py
@@ -27,6 +27,27 @@
expected = r"Unknown removal version, update PIL\._deprecate\?"
with pytest.raises(ValueError, match=expected):
_deprecate.deprecate("Old thing", 12345, "new t... | null | null | namanjain12/pillow_final:331595926c5957cc5612b1778b6b60c184e09b13 | true | null | 1 | 10 | null | 932 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.188667 | 80.48475 | ||
9,086 | r2e_gym::train::4625 | r2e_gym | train | 4,625 | numpy__53facf327c7b2949a5f31c308fd66b0b1f24b615 | numpy | numpy/numpy | python | 53facf327c7b2949a5f31c308fd66b0b1f24b615 | **Title:** Indexing `numpy.ma.mvoid` with Multi-Dimensional Fields Raises ValueError
**Description:**
When indexing a masked array's `mvoid` with a multi-dimensional field, it results in a non-scalar mask, leading to a `ValueError`. This issue arises when the field has multiple dimensions but a size of 1, causing unex... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5869,6 +5869,18 @@
"""
m = self._mask
+ if isinstance(m[indx], ndarray):
+ # Can happen when indx is a multi-dimensional field:
+ # A = ma.masked_array(data=[([0,1],)], mas... | 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
@@ -711,6 +711,14 @@
self.assertTrue(f[0] is masked)
self.assertTrue(f['a'] is masked)
assert_equal(f[1], 4)
+
+ # exotic dtype
+ A = masked... | null | null | namanjain12/numpy_final:53facf327c7b2949a5f31c308fd66b0b1f24b615 | true | null | 1 | 12 | null | 891 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.1885 | 80.48425 | ||
9,087 | r2e_gym::train::4799 | r2e_gym | train | 4,799 | numpy__0091499ec28cd9ceb30cd94c0e40191570b6fec6 | numpy | numpy/numpy | python | 0091499ec28cd9ceb30cd94c0e40191570b6fec6 | **Title:** `genfromtxt()` Raises `TypeError` When Using `nrows` Keyword
**Description:**
When attempting to limit the number of rows read using the `nrows` keyword in `numpy.genfromtxt`, a `TypeError` is raised indicating that `nrows` is an unexpected keyword argument.
**Example Code:**
```python
import numpy as np
f... | diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1204,7 +1204,8 @@
usecols=None, names=None,
excludelist=None, deletechars=None, replace_space='_',
autostrip=False, case_sensitive=True, defaultfmt="f%i",
- ... | diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -1641,6 +1641,32 @@
self.assertTrue(isinstance(test, np.recarray))
assert_equal(test, control)
+ def test_nrows(self):
+ #
+ data = '1 1\n2 2\n0 ... | null | null | namanjain12/numpy_final:0091499ec28cd9ceb30cd94c0e40191570b6fec6 | true | null | 1 | 21 | null | 708 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.188 | 80.48275 | ||
9,088 | r2e_gym::train::4142 | r2e_gym | train | 4,142 | numpy__66365a57ff9b68a191fd232dc823cc2cf69d267f | numpy | numpy/numpy | python | 66365a57ff9b68a191fd232dc823cc2cf69d267f | **Title:** TypeError when generating string for polynomials with non-numeric coefficients
**Description:**
When creating a polynomial with object coefficients that are non-numeric, such as strings or complex numbers, generating its string representation raises a `TypeError`.
**Example Buggy Code:**
```python
from num... | diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py
--- a/numpy/polynomial/_polybase.py
+++ b/numpy/polynomial/_polybase.py
@@ -347,10 +347,16 @@
out += " "
power = str(i + 1)
# Polynomial coefficient
- if coef >= 0:
+ try:
+ ... | diff --git a/numpy/polynomial/tests/test_printing.py b/numpy/polynomial/tests/test_printing.py
--- a/numpy/polynomial/tests/test_printing.py
+++ b/numpy/polynomial/tests/test_printing.py
@@ -1,7 +1,11 @@
import pytest
-from numpy.core import arange, printoptions
+from numpy.core import array, arange, printoptions
imp... | null | null | namanjain12/numpy_final:66365a57ff9b68a191fd232dc823cc2cf69d267f | true | null | 1 | 12 | null | 887 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.187833 | 80.48225 | ||
9,089 | r2e_gym::train::5730 | r2e_gym | train | 5,730 | scrapy__471281d29e5c7b8e293f59ac3c3330ecda687d19 | scrapy | scrapy/scrapy | python | 471281d29e5c7b8e293f59ac3c3330ecda687d19 | **Title:** NameError: 'SupportsReadClose' is not defined in `xmliter_lxml` function
**Description:**
When using the `xmliter_lxml` function with a `Response` object, a `NameError` is raised indicating that `'SupportsReadClose'` is not defined. This prevents the function from parsing XML responses as expected.
**Examp... | diff --git a/scrapy/utils/iterators.py b/scrapy/utils/iterators.py
--- a/scrapy/utils/iterators.py
+++ b/scrapy/utils/iterators.py
@@ -1,5 +1,3 @@
-from __future__ import annotations
-
import csv
import logging
import re
@@ -78,7 +76,7 @@
def xmliter_lxml(
- obj: Union[TextResponse, str, bytes],
+ obj: Un... | diff --git a/tests/test_utils_iterators.py b/tests/test_utils_iterators.py
--- a/tests/test_utils_iterators.py
+++ b/tests/test_utils_iterators.py
@@ -1,18 +1,13 @@
-from typing import Callable, Iterable, Union
-
from pytest import mark
from twisted.trial import unittest
-from scrapy import Selector
from scrapy.ht... | null | null | namanjain12/scrapy_final:471281d29e5c7b8e293f59ac3c3330ecda687d19 | true | null | 1 | 11 | null | 907 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.187833 | 80.48225 | ||
9,090 | r2e_gym::train::4509 | r2e_gym | train | 4,509 | numpy__d2d1dd5accbd6bbd5a2d8f3fac0dbfc6fb9b4e18 | numpy | numpy/numpy | python | d2d1dd5accbd6bbd5a2d8f3fac0dbfc6fb9b4e18 | **Title:** `np.float16` Not Recognized by `np.common_type` Causes TypeError
**Description:**
When using `np.common_type` with an array of type `np.float16`, it raises a `TypeError` instead of returning the expected common type. This issue prevents `np.float16` from being correctly identified and handled by the `np.com... | 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
@@ -532,14 +532,15 @@
#-----------------------------------------------------------------------------
#determine the "minimum common type" for a group of arrays.
-array_type = [[_nx.single, _nx.... | 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
@@ -18,11 +18,13 @@
class TestCommonType(TestCase):
def test_basic(self):
ai32 = np.array([[1, 2], [3, 4]], dtype=np.int32)
+ af16 ... | null | null | namanjain12/numpy_final:d2d1dd5accbd6bbd5a2d8f3fac0dbfc6fb9b4e18 | true | null | 1 | 19 | null | 744 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.187333 | 80.48075 | ||
9,091 | r2e_gym::train::6096 | r2e_gym | train | 6,096 | pillow__04f28b691e961bff44b269652421f447add04c5c | pillow | python-pillow/pillow | python | 04f28b691e961bff44b269652421f447add04c5c | **Title:** TypeError When Applying Negate Operation: List Indices Must Be Integers, Not Str
**Description:**
When using the negate operation in `ImageMorph`, a `TypeError` is raised indicating that list indices must be integers, not strings. This error occurs because the code attempts to use a string as an index for a... | diff --git a/PIL/ImageMorph.py b/PIL/ImageMorph.py
--- a/PIL/ImageMorph.py
+++ b/PIL/ImageMorph.py
@@ -123,7 +123,7 @@
.replace('0', 'Z')
.replace('1', '0')
.replace('Z', '1'))
- res = '%d' % (1-int(res))
+ ... | diff --git a/Tests/test_imagemorph.py b/Tests/test_imagemorph.py
--- a/Tests/test_imagemorph.py
+++ b/Tests/test_imagemorph.py
@@ -184,10 +184,26 @@
self.assertEqual(count, 7)
self.assert_img_equal_img_string(Aout,
"""
-
- ... | null | null | namanjain12/pillow_final:04f28b691e961bff44b269652421f447add04c5c | true | null | 1 | 6 | null | 1,004 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.187333 | 80.48075 | ||
9,092 | r2e_gym::train::5200 | r2e_gym | train | 5,200 | pyramid__a56564945ae07da87e5ccbca9c137095c250ced3 | pyramid | pylons/pyramid | python | a56564945ae07da87e5ccbca9c137095c250ced3 | **Title:** Creating Configurator Without `package` in `paster pshell` Causes KeyError
**Description:**
When initializing a `Configurator` within a `paster pshell` session without providing the `package` argument, a `KeyError` is raised. This error originates from the `pyramid.path.caller_module` function, which expect... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -47,6 +47,12 @@
Bug Fixes
---------
+
+- When creating a Configurator from within a ``paster pshell`` session, you
+ were required to pass a ``package`` argument although ``package`` is not
+ actually required. If you didn't pass ``pac... | diff --git a/pyramid/tests/test_path.py b/pyramid/tests/test_path.py
--- a/pyramid/tests/test_path.py
+++ b/pyramid/tests/test_path.py
@@ -36,9 +36,9 @@
self.assertEqual(test_path.__abspath__, here)
class TestCallerModule(unittest.TestCase):
- def _callFUT(self, level=2):
+ def _callFUT(self, *arg, **... | null | null | namanjain12/pyramid_final:a56564945ae07da87e5ccbca9c137095c250ced3 | true | null | 2 | 10 | null | 922 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.187 | 80.47975 | ||
9,093 | r2e_gym::train::4716 | r2e_gym | train | 4,716 | numpy__642f7e841d2f9900b3793c9b140f8c1adc56b899 | numpy | numpy/numpy | python | 642f7e841d2f9900b3793c9b140f8c1adc56b899 | **Title:** `np.block` Accepts Tuple Inputs, Causing Ambiguous Behavior
**Description:**
**Problem:**
The `np.block` function currently allows tuples as inputs, which leads to multiple ways to achieve the same result and can cause confusing behavior by treating tuples similarly to lists or ndarrays.
**Example Buggy C... | 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
@@ -456,7 +456,7 @@
Parameters
----------
- arrays : nested list of ndarrays or scalars
+ arrays : nested list of array_like or scalars (but not tuples)
If passed a s... | 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
@@ -341,9 +341,6 @@
[1, 1, 2, 2]])
result = block([a_2d, b_2d])
assert_equal(desired, result)
- ... | null | null | namanjain12/numpy_final:642f7e841d2f9900b3793c9b140f8c1adc56b899 | true | null | 1 | 15 | null | 820 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186667 | 80.47875 | ||
9,094 | r2e_gym::train::6360 | r2e_gym | train | 6,360 | pillow__cf275737ee6abbd656fd352cfbe9618af35e8c5c | pillow | python-pillow/pillow | python | cf275737ee6abbd656fd352cfbe9618af35e8c5c | **Title:** TypeError When Capturing Warnings with `None` in Test Cases
**Description:**
When attempting to capture warnings by passing `None` as the expected warning, a `TypeError` is raised. This occurs in test scenarios where warnings are expected to be captured without specifying a particular warning type.
**Examp... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -396,15 +396,7 @@
if isinstance(palette, (bytes, bytearray, list)):
source_palette = bytearray(palette[:768])
if isinstance(palette, ImagePalette.ImagePale... | 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
@@ -833,7 +833,7 @@
with Image.open(out) as reloaded:
im.putpalette(palette)
- assert_image_equal(reloaded, im)
+ assert_image_equal(reloaded.convert("RGB"), im.convert("R... | null | null | namanjain12/pillow_final:cf275737ee6abbd656fd352cfbe9618af35e8c5c | true | null | 1 | 10 | null | 920 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186667 | 80.47875 | ||
9,095 | r2e_gym::train::4654 | r2e_gym | train | 4,654 | numpy__0136d65c84bd21c2cb492e58b71a091ec1e875e6 | numpy | numpy/numpy | python | 0136d65c84bd21c2cb492e58b71a091ec1e875e6 | **Title:** Unable to Pickle Ufuncs Defined in Nested Modules
**Description:**
When attempting to pickle a universal function (ufunc) that is defined within a nested module, an `AttributeError` is raised. This issue occurs because the pickling process cannot locate the ufunc in the expected module hierarchy.
**Example... | diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py
--- a/numpy/core/__init__.py
+++ b/numpy/core/__init__.py
@@ -52,7 +52,11 @@
# The name numpy.core._ufunc_reconstruct must be
# available for unpickling to work.
def _ufunc_reconstruct(module, name):
- mod = __import__(module)
+ # The `fromlist` kw... | diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py
--- a/numpy/core/tests/test_ufunc.py
+++ b/numpy/core/tests/test_ufunc.py
@@ -13,6 +13,10 @@
def test_pickle(self):
import pickle
assert pickle.loads(pickle.dumps(np.sin)) is np.sin
+
+ # Check that ufunc not defi... | null | null | namanjain12/numpy_final:0136d65c84bd21c2cb492e58b71a091ec1e875e6 | true | null | 1 | 6 | null | 1,000 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186667 | 80.47875 | ||
9,096 | r2e_gym::train::4609 | r2e_gym | train | 4,609 | numpy__619422b493eaf88c42373af1725ac0aa2297fa91 | numpy | numpy/numpy | python | 619422b493eaf88c42373af1725ac0aa2297fa91 | **Title:** AttributeError when accessing nested object in MaskedArray
**Description:**
When creating a masked array with a nested object dtype, accessing the nested object results in an `AttributeError`. This occurs because the `_fill_value` attribute is expected to be an `ndarray`, but it is instead a string, leading... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -3297,6 +3297,10 @@
if self._fill_value is not None:
dout._fill_value = self._fill_value[indx]
+ # Something like gh-15895 has happened if this check fails.
+ ... | diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -63,6 +63,28 @@
test = masked_all((1, 1), dtype=dt)
control = array([[(1, (1, 1))]], mask=[[(1, (1, 1))]], dtype=dt)
assert_equal(test, control... | null | null | namanjain12/numpy_final:619422b493eaf88c42373af1725ac0aa2297fa91 | true | null | 1 | 11 | null | 900 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186667 | 80.47875 | ||
9,097 | r2e_gym::train::4661 | r2e_gym | train | 4,661 | numpy__9a23f16b67958205468f7f5c4e0966f393558d9a | numpy | numpy/numpy | python | 9a23f16b67958205468f7f5c4e0966f393558d9a | **Title:** `numpy.percentile` and `numpy.quantile` Fail with Fraction Inputs
**Description:**
Using `Fraction` objects as inputs to `numpy.percentile` and `numpy.quantile` results in errors, preventing accurate percentile and quantile calculations with precise rational types.
**Example Code:**
```python
from fraction... | diff --git a/doc/release/1.17.0-notes.rst b/doc/release/1.17.0-notes.rst
--- a/doc/release/1.17.0-notes.rst
+++ b/doc/release/1.17.0-notes.rst
@@ -231,6 +231,11 @@
methods when called on object arrays, making them compatible with
`decimal.Decimal` and `fractions.Fraction` objects.
+`quantile` now works on `fraction... | 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
@@ -5,6 +5,7 @@
import sys
import decimal
import types
+from fractions import Fraction
import pytest
import numpy as np
@@ -2508,6 +25... | null | null | namanjain12/numpy_final:9a23f16b67958205468f7f5c4e0966f393558d9a | true | null | 2 | 10 | null | 918 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186333 | 80.47775 | ||
9,098 | r2e_gym::train::4076 | r2e_gym | train | 4,076 | coveragepy__3703bae58b53efec3314bc07b9de157049ad8b70 | coveragepy | nedbat/coveragepy | python | 3703bae58b53efec3314bc07b9de157049ad8b70 | **Title:** Parsing Invalid Input Caches Failed Parse, Causing TypeError on Subsequent Parses
**Description:**
When attempting to parse invalid Python code, such as a standalone closing bracket `"]"`, the parser incorrectly caches the failed parse result. This leads to a `TypeError` when trying to parse the same invali... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,7 +20,10 @@
Unreleased
----------
-Nothing yet.
+- Fix an internal problem with caching of invalid Python parsing. Found by
+ OSS-Fuzz, fixing `bug 50381`_
+
+.. _bug 50381: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50381... | diff --git a/tests/test_parser.py b/tests/test_parser.py
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -246,6 +246,15 @@
assert expected_statements == parser.statements
assert expected_arcs == parser.arcs()
assert expected_exits == parser.exit_counts()
+
+ def test_fuzzed_double... | null | null | namanjain12/coveragepy_final:3703bae58b53efec3314bc07b9de157049ad8b70 | true | null | 2 | 11 | null | 897 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186167 | 80.47725 | ||
9,099 | r2e_gym::train::4295 | r2e_gym | train | 4,295 | numpy__54224f4e88036a8cd02c1306f2c1a5f655e41e3a | numpy | numpy/numpy | python | 54224f4e88036a8cd02c1306f2c1a5f655e41e3a | **Title:** `np.put` and `np.place` Do Not Enforce `numpy.ndarray` as First Argument
**Description:**
When using `np.put` or `np.place`, passing a non-`numpy.ndarray` object as the first argument results in an unexpected `AttributeError`. These functions are intended to operate on `numpy.ndarray` objects, and using oth... | diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -445,7 +445,13 @@
array([ 0, 1, 2, 3, -5])
"""
- return a.put(ind, v, mode)
+ try:
+ put = a.put
+ except AttributeError:
+ raise TypeError("argumen... | diff --git a/numpy/core/tests/test_fromnumeric.py b/numpy/core/tests/test_fromnumeric.py
--- a/numpy/core/tests/test_fromnumeric.py
+++ b/numpy/core/tests/test_fromnumeric.py
@@ -0,0 +1,17 @@
+from __future__ import division, absolute_import, print_function
+
+from numpy import put
+from numpy.testing import TestCase, ... | null | null | namanjain12/numpy_final:54224f4e88036a8cd02c1306f2c1a5f655e41e3a | true | null | 2 | 14 | null | 836 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.186 | 80.47675 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.