selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,900 | r2e_gym::train::4154 | r2e_gym | train | 4,154 | numpy__65e1e0e4ba0909a45f410a24360e97568e2bb66a | numpy | numpy/numpy | python | 65e1e0e4ba0909a45f410a24360e97568e2bb66a | **Title:** ValueError Occurs When Printing Arrays with `precision=0`
**Description:**
When setting NumPy's print options with `precision=0`, attempting to print certain arrays results in a `ValueError`. This issue arises specifically when values that round to zero are formatted, leading to unsupported format character... | diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py
--- a/numpy/core/arrayprint.py
+++ b/numpy/core/arrayprint.py
@@ -626,9 +626,12 @@
def _digits(x, precision, format):
- s = format % x
- z = s.rstrip('0')
- return precision - len(s) + len(z)
+ if precision > 0:
+ s = format % x
+ ... | 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
@@ -129,6 +129,16 @@
np.set_printoptions(precision=4)
assert_equal(repr(x), "array([ 1.5 , 0. , 1.2346])")
+ def test_p... | null | null | namanjain12/numpy_final:65e1e0e4ba0909a45f410a24360e97568e2bb66a | true | null | 1 | 9 | null | 1,147 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.221167 | 80.58225 | ||
8,901 | r2e_gym::train::4134 | r2e_gym | train | 4,134 | numpy__aeb23741b1186e6ae525c4dd7f46ce9e1378e670 | numpy | numpy/numpy | python | aeb23741b1186e6ae525c4dd7f46ce9e1378e670 | **Title:** `np.info` incorrectly displays "Methods:" heading when no public methods are present
**Description:**
When using `np.info` on a class that only contains private or magic methods (methods starting with `_`), the output unnecessarily includes an empty "Methods:" heading. This can be misleading as it suggests ... | diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -587,11 +587,11 @@
print(inspect.getdoc(object), file=output)
methods = pydoc.allmethods(object)
- if methods != []:
+
+ public_methods = [meth for meth in methods if meth[0] !... | diff --git a/numpy/lib/tests/test_utils.py b/numpy/lib/tests/test_utils.py
--- a/numpy/lib/tests/test_utils.py
+++ b/numpy/lib/tests/test_utils.py
@@ -140,3 +140,22 @@
def test_assert_raises_regex_context_manager():
with assert_raises_regex(ValueError, 'no deprecation warning'):
raise ValueError('no depr... | null | null | namanjain12/numpy_final:aeb23741b1186e6ae525c4dd7f46ce9e1378e670 | true | null | 1 | 8 | null | 1,167 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.221167 | 80.58225 | ||
8,902 | r2e_gym::train::4219 | r2e_gym | train | 4,219 | numpy__28fdcf3f19d2986a6760f96a53afa694abc737da | numpy | numpy/numpy | python | 28fdcf3f19d2986a6760f96a53afa694abc737da | **Title:** `np.nanpercentile` Fails with Multiple Percentiles on All-NaN Slices
**Description:**
When using `np.nanpercentile` to compute multiple percentiles on arrays that include slices composed entirely of `NaN` values, the function raises an error or returns results with unexpected shapes.
**Example Code:**
```p... | diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py
--- a/numpy/lib/nanfunctions.py
+++ b/numpy/lib/nanfunctions.py
@@ -975,7 +975,11 @@
else:
result = np.apply_along_axis(_nanpercentile1d, axis, a, q,
overwrite_input, interpolation)
-
+ # apply_... | diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py
--- a/numpy/lib/tests/test_nanfunctions.py
+++ b/numpy/lib/tests/test_nanfunctions.py
@@ -655,7 +655,8 @@
tgt = [np.percentile(d, 28) for d in _rdat]
res = np.nanpercentile(_ndat, 28, axis=1)
assert_almos... | null | null | namanjain12/numpy_final:28fdcf3f19d2986a6760f96a53afa694abc737da | true | null | 1 | 11 | null | 1,104 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.220667 | 80.58075 | ||
8,903 | r2e_gym::train::5699 | r2e_gym | train | 5,699 | scrapy__b6a023ce987a064b222b1aa2de03a50991f387fe | scrapy | scrapy/scrapy | python | b6a023ce987a064b222b1aa2de03a50991f387fe | **Title:** `build_component_list` Raises TypeError with Backwards-Compatible Arguments
**Description:**
When using the `build_component_list` function with both `base` and `custom` dictionaries along with the `convert` parameter, a `TypeError` is raised because the function receives multiple values for the `convert` a... | diff --git a/scrapy/utils/conf.py b/scrapy/utils/conf.py
--- a/scrapy/utils/conf.py
+++ b/scrapy/utils/conf.py
@@ -10,7 +10,7 @@
from scrapy.utils.python import without_none_values
-def build_component_list(compdict, convert=update_classpath):
+def build_component_list(compdict, custom=None, convert=update_classpa... | diff --git a/tests/test_utils_conf.py b/tests/test_utils_conf.py
--- a/tests/test_utils_conf.py
+++ b/tests/test_utils_conf.py
@@ -8,46 +8,59 @@
def test_build_dict(self):
d = {'one': 1, 'two': None, 'three': 8, 'four': 4}
- self.assertEqual(build_component_list(d, lambda x: x),
+ self.ass... | null | null | namanjain12/scrapy_final:b6a023ce987a064b222b1aa2de03a50991f387fe | true | null | 1 | 14 | null | 1,044 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.220667 | 80.58075 | ||
8,904 | r2e_gym::train::5227 | r2e_gym | train | 5,227 | pyramid__cf026e2cd8704a679dd83760907d8847deabb18e | pyramid | pylons/pyramid | python | cf026e2cd8704a679dd83760907d8847deabb18e | **Title:** Incorrect Signature Verification with Latin-1 Encoded Secrets
**Description:**
When using secrets encoded with `latin-1`, the serialization and deserialization processes fail due to signature mismatches. This issue arises when the secret contains characters that are specifically encoded with `latin-1`, lead... | diff --git a/pyramid/session.py b/pyramid/session.py
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -57,7 +57,12 @@
response.set_cookie('signed_cookie', cookieval)
"""
pickled = pickle.dumps(data, pickle.HIGHEST_PROTOCOL)
- sig = hmac.new(bytes_(secret, 'utf-8'), pickled, hashlib.sha1).hexdig... | diff --git a/pyramid/tests/test_session.py b/pyramid/tests/test_session.py
--- a/pyramid/tests/test_session.py
+++ b/pyramid/tests/test_session.py
@@ -533,9 +533,15 @@
self.assertEqual(result, expected)
def test_it_with_highorder_secret(self):
- secret = b'La Pe\xc3\xb1a'.decode('utf-8')
+ ... | null | null | namanjain12/pyramid_final:cf026e2cd8704a679dd83760907d8847deabb18e | true | null | 1 | 16 | null | 1,004 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.220667 | 80.58075 | ||
8,905 | swe_bench::test::1455 | swe_bench | test | 1,455 | pytest-dev__pytest-7749 | pytest-dev/pytest | pytest-dev/pytest | python | 634cde9506eb1f48dec3ec77974ee8dc952207c6 | Crash with NameError through decorator during collection
pytest crashes when trying to collect the following file:
```python
@deco
def test():
pass
```
```
platform linux -- Python 3.8.0a2+, pytest-4.3.2.dev108+gaff72776.d20190322, py-1.8.1.dev3+g60f50bdc.d20190322, pluggy-0.9.0
rootdir: …/Vcs/pytest, inifile: to... | Note this also happens when e.g. trying to define a fixture but forgetting to import `pytest`:
```python
@pytest.fixture
def myvalue():
return 42
def test_myvalue(myvalue):
assert myvalue == 42
``` | diff --git a/src/_pytest/assertion/rewrite.py b/src/_pytest/assertion/rewrite.py
--- a/src/_pytest/assertion/rewrite.py
+++ b/src/_pytest/assertion/rewrite.py
@@ -687,13 +687,18 @@ def run(self, mod: ast.Module) -> None:
return
expect_docstring = False
elif (
- ... | diff --git a/testing/test_collection.py b/testing/test_collection.py
--- a/testing/test_collection.py
+++ b/testing/test_collection.py
@@ -1393,3 +1393,17 @@ def test_modules_not_importable_as_side_effect(self, testdir):
"* 1 failed in *",
]
)
+
+
+def test_does_not_crash_on_error... | ["testing/test_collection.py::test_does_not_crash_on_error_from_decorated_function"] | ["testing/test_collection.py::TestCollector::test_collect_versus_item", "testing/test_collection.py::test_fscollector_from_parent", "testing/test_collection.py::TestCollector::test_check_equality", "testing/test_collection.py::TestCollector::test_getparent", "testing/test_collection.py::TestCollector::test_getcustomfil... | null | true | 2020-09-12T20:08:56Z | 1 | 13 | 1 | 6,146 | 0 | 0.8 | 1 | 0.5 | 1 | 0.543333 | 80.58 | |
8,906 | r2e_gym::train::5479 | r2e_gym | train | 5,479 | aiohttp__43f3e23b1c66ad8303fd1333ccb86c2301d07d15 | aiohttp | aio-libs/aiohttp | python | 43f3e23b1c66ad8303fd1333ccb86c2301d07d15 | **Title:** `ClientSession` Accepts Invalid `timeout` Types Without Raising Errors
**Description:**
When initializing a `ClientSession`, providing a `timeout` parameter with an incorrect type does not trigger any validation or errors. This allows the creation of a session with an improperly configured timeout, which c... | diff --git a/CHANGES/8021.bugfix b/CHANGES/8021.bugfix
--- a/CHANGES/8021.bugfix
+++ b/CHANGES/8021.bugfix
@@ -0,0 +1 @@
+Add runtime type check for ``ClientSession`` ``timeout`` parameter.
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -149,6 +149,7 @@
Hugo van Kemen... | diff --git a/tests/test_client_session.py b/tests/test_client_session.py
--- a/tests/test_client_session.py
+++ b/tests/test_client_session.py
@@ -779,12 +779,6 @@
await session1.close()
-async def test_client_session_timeout_argument() -> None:
- session = ClientSession(timeout=500)
- assert session.tim... | null | null | namanjain12/aiohttp_final:43f3e23b1c66ad8303fd1333ccb86c2301d07d15 | true | null | 3 | 12 | null | 1,082 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.220333 | 80.57975 | ||
8,907 | r2e_gym::train::6417 | r2e_gym | train | 6,417 | pillow__a5a6ca150c90f0e875fc2a817eaeafb3c533a5cd | pillow | python-pillow/pillow | python | a5a6ca150c90f0e875fc2a817eaeafb3c533a5cd | **Title:** `frombytes()` Raises ValueError for Images with Zero Dimensions
**Description:**
When creating an image with zero width or height using the `frombytes()` method, a `ValueError` is raised unexpectedly.
**Example Code:**
```python
from PIL import Image
# Attempt to create an image with zero width
Image.from... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -790,6 +790,9 @@
This method is similar to the :py:func:`~PIL.Image.frombytes` function,
but loads data into this image instead of creating a new image object.
"""
+
+ if self.width == 0 o... | diff --git a/Tests/test_image.py b/Tests/test_image.py
--- a/Tests/test_image.py
+++ b/Tests/test_image.py
@@ -906,6 +906,13 @@
im = Image.new("RGB", size)
assert im.tobytes() == b""
+ @pytest.mark.parametrize("size", ((1, 0), (0, 1), (0, 0)))
+ def test_zero_frombytes(self, size):
+ Im... | null | null | namanjain12/pillow_final:a5a6ca150c90f0e875fc2a817eaeafb3c533a5cd | true | null | 1 | 20 | null | 917 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2195 | 80.57725 | ||
8,908 | r2e_gym::train::5723 | r2e_gym | train | 5,723 | scrapy__407349865279795387b9ff84afb9011e2303bb9d | scrapy | scrapy/scrapy | python | 407349865279795387b9ff84afb9011e2303bb9d | **Title:** `isbinarytext` Raises AssertionError When Passing Bytes Instead of String
**Description:**
The `isbinarytext` function is intended to determine whether a given text is binary. However, when a bytes object is passed to this function, it raises an `AssertionError` instead of performing the binary check.
**Ex... | diff --git a/scrapy/utils/python.py b/scrapy/utils/python.py
--- a/scrapy/utils/python.py
+++ b/scrapy/utils/python.py
@@ -142,11 +142,14 @@
yield (text[offset:], offset)
yield (text, 0)
- pattern = re.compile(pattern) if isinstance(pattern, basestring) else pattern
+ if isinstance(pattern... | diff --git a/tests/test_utils_python.py b/tests/test_utils_python.py
--- a/tests/test_utils_python.py
+++ b/tests/test_utils_python.py
@@ -2,6 +2,7 @@
import operator
import unittest
from itertools import count
+import six
from scrapy.utils.python import (
memoizemethod_noargs, isbinarytext, equal_attributes... | null | null | namanjain12/scrapy_final:407349865279795387b9ff84afb9011e2303bb9d | true | null | 1 | 24 | null | 837 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2195 | 80.57725 | ||
8,909 | r2e_gym::train::5187 | r2e_gym | train | 5,187 | pyramid__a9289d95036eb23e973815e529d3db3fea235046 | pyramid | pylons/pyramid | python | a9289d95036eb23e973815e529d3db3fea235046 | **Title:** TypeError When Registering Multiple Views with `accept` Predicate in Python 3
**Description:**
When registering multiple views with an `accept` predicate in a Pyramid application running under Python 3, a `TypeError` is raised during the sorting of views. This occurs because the sorting mechanism attempts t... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -36,6 +36,11 @@
objects implementing ``__call__`` which dont have ``__name__`` and
``__doc__`` attributes. See https://github.com/Pylons/pyramid/issues/621
and https://github.com/Pylons/pyramid/pull/647.
+
+- Forward-port from 1.3 b... | diff --git a/pyramid/tests/test_config/test_views.py b/pyramid/tests/test_config/test_views.py
--- a/pyramid/tests/test_config/test_views.py
+++ b/pyramid/tests/test_config/test_views.py
@@ -2140,11 +2140,28 @@
def test_add_with_phash_override_accept(self):
mv = self._makeOne()
- mv.add('view2', ... | null | null | namanjain12/pyramid_final:a9289d95036eb23e973815e529d3db3fea235046 | true | null | 2 | 7 | null | 1,177 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2195 | 80.57725 | ||
8,910 | r2e_gym::train::4504 | r2e_gym | train | 4,504 | numpy__e1ff6268a2e256bdb6cf6c06457456c7c4bd495d | numpy | numpy/numpy | python | e1ff6268a2e256bdb6cf6c06457456c7c4bd495d | **Title:** NameValidator Fails to Raise ValueError for Invalid `case_sensitive` Values
**Description:**
When using the `NameValidator` with an unrecognized value for the `case_sensitive` parameter, it does not raise a `ValueError` as expected. This allows invalid configurations to pass silently, potentially leading to... | diff --git a/numpy/lib/_iotools.py b/numpy/lib/_iotools.py
--- a/numpy/lib/_iotools.py
+++ b/numpy/lib/_iotools.py
@@ -320,12 +320,13 @@
# Process the case option .....
if (case_sensitive is None) or (case_sensitive is True):
self.case_converter = lambda x: x
- elif (case_sensitive... | diff --git a/numpy/lib/tests/test__iotools.py b/numpy/lib/tests/test__iotools.py
--- a/numpy/lib/tests/test__iotools.py
+++ b/numpy/lib/tests/test__iotools.py
@@ -7,7 +7,8 @@
import numpy as np
from numpy.compat import asbytes, asbytes_nested
from numpy.testing import (
- run_module_suite, TestCase, assert_, asse... | null | null | namanjain12/numpy_final:e1ff6268a2e256bdb6cf6c06457456c7c4bd495d | true | null | 2 | 13 | null | 1,057 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2195 | 80.57725 | ||
8,911 | r2e_gym::train::5118 | r2e_gym | train | 5,118 | pyramid__462af266b61e0b8aad87775926b49e8758f564e7 | pyramid | pylons/pyramid | python | 462af266b61e0b8aad87775926b49e8758f564e7 | **Title:** `reify` Decorator Fails to Preserve Wrapped Function Attributes
**Description:**
When using the `reify` decorator, attributes of the wrapped function such as `__name__`, `__doc__`, and `__module__` are not preserved. This leads to issues where accessing these attributes on the decorated function results in ... | diff --git a/pyramid/decorator.py b/pyramid/decorator.py
--- a/pyramid/decorator.py
+++ b/pyramid/decorator.py
@@ -1,3 +1,6 @@
+import functools
+
+
class reify(object):
""" Use as a class method decorator. It operates almost exactly like the
Python ``@property`` decorator, but it puts the result of the met... | diff --git a/pyramid/tests/test_decorator.py b/pyramid/tests/test_decorator.py
--- a/pyramid/tests/test_decorator.py
+++ b/pyramid/tests/test_decorator.py
@@ -15,15 +15,19 @@
self.assertEqual(inst.__dict__['wrapped'], 'a')
def test___get__noinst(self):
- decorator = self._makeOne(None)
+ d... | null | null | namanjain12/pyramid_final:462af266b61e0b8aad87775926b49e8758f564e7 | true | null | 1 | 8 | null | 1,155 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.219167 | 80.57625 | ||
8,912 | r2e_gym::train::5399 | r2e_gym | train | 5,399 | aiohttp__871fedcb014c0e568f4eed3ef5c74ae94c59c936 | aiohttp | aio-libs/aiohttp | python | 871fedcb014c0e568f4eed3ef5c74ae94c59c936 | **Title:** Server Still Listens on TCP `localhost:8080` When Only Unix Socket Path Is Specified
**Description:**
When launching the aiohttp server using only the `--path` option to specify a Unix socket, the server unexpectedly continues to listen on the default TCP address `localhost:8080`. This behavior persists des... | diff --git a/CHANGES/9033.misc.rst b/CHANGES/9033.misc.rst
--- a/CHANGES/9033.misc.rst
+++ b/CHANGES/9033.misc.rst
@@ -0,0 +1 @@
+Changed web entry point to not listen on TCP when only a Unix path is passed -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.... | diff --git a/tests/test_web_cli.py b/tests/test_web_cli.py
--- a/tests/test_web_cli.py
+++ b/tests/test_web_cli.py
@@ -1,3 +1,7 @@
+import sys
+from typing import Any
+from unittest import mock
+
import pytest
from aiohttp import web
@@ -80,7 +84,33 @@
)
-def test_path_when_unsupported(mocker, monkeypatch)... | null | null | namanjain12/aiohttp_final:871fedcb014c0e568f4eed3ef5c74ae94c59c936 | true | null | 3 | 23 | null | 853 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.218833 | 80.57525 | ||
8,913 | r2e_gym::train::5543 | r2e_gym | train | 5,543 | aiohttp__6d3d1fcf2583eb7b8330b194c00356ce169b2ebd | aiohttp | aio-libs/aiohttp | python | 6d3d1fcf2583eb7b8330b194c00356ce169b2ebd | **Title:** HTTP parser raises TransferEncodingError when chunk separators are split across data chunks
**Description:**
When processing chunked HTTP responses, if the chunk separator (`\r\n`) is split between multiple received data chunks, the HTTP payload parser raises an error instead of correctly parsing the paylo... | diff --git a/CHANGES/8720.bugfix.rst b/CHANGES/8720.bugfix.rst
--- a/CHANGES/8720.bugfix.rst
+++ b/CHANGES/8720.bugfix.rst
@@ -0,0 +1 @@
+Fixed an edge case in the Python parser when chunk separators happen to align with network chunks -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/http_parser.py b/aiohttp/http_pars... | 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
@@ -1461,6 +1461,29 @@
assert b"second" == b"".join(d for d in payload._buffer)
+async def test_parse_chunked_payload_split_chunks(response: HttpResponseParser) -> None:
+ netwo... | null | null | namanjain12/aiohttp_final:6d3d1fcf2583eb7b8330b194c00356ce169b2ebd | true | null | 2 | 11 | null | 1,092 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.218667 | 80.57475 | ||
8,914 | r2e_gym::train::6384 | r2e_gym | train | 6,384 | pillow__567fbaf782740e110ce30e88ce1915d0e9ea8da0 | pillow | python-pillow/pillow | python | 567fbaf782740e110ce30e88ce1915d0e9ea8da0 | **Title:** TypeError When Using Tuple Border with ImageOps.expand on Palette Images
**Description:**
When attempting to expand a palette-based image (`mode="P"`) using `ImageOps.expand` with a tuple border, a `TypeError` is raised. This occurs because the function expects an integer value for the border width but rece... | diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py
--- a/src/PIL/ImageOps.py
+++ b/src/PIL/ImageOps.py
@@ -21,7 +21,7 @@
import operator
import re
-from . import Image, ImageDraw
+from . import Image
#
# helpers
@@ -395,15 +395,16 @@
height = top + image.size[1] + bottom
color = _color(fill, image... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -156,23 +156,31 @@
assert newimg.size == (25, 25)
-def test_expand_palette():
- im = Image.open("Tests/images/p_16.tga")
- im_expanded = ImageOps.expand(im, 10, (255, 0, 0))
-
- px... | null | null | namanjain12/pillow_final:567fbaf782740e110ce30e88ce1915d0e9ea8da0 | true | null | 1 | 21 | null | 892 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.218667 | 80.57475 | ||
8,915 | r2e_gym::train::4156 | r2e_gym | train | 4,156 | numpy__6967f50dd1eb922cfa0e28956baa5a0bdc85331a | numpy | numpy/numpy | python | 6967f50dd1eb922cfa0e28956baa5a0bdc85331a | **Title:** BUG: `put` incorrectly updates mask on `MaskedArray` with no initial mask
**Description:**
When using the `put` method on a `MaskedArray` that initially has no mask (`nomask`), the mask is incorrectly updated based on the mask of the input values. This results in some elements being masked unintentionally.
... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -4399,7 +4399,6 @@
[7 -- 30]]
"""
- m = self._mask
# Hard mask: Get rid of the values/indices that fall on masked data
if self._hardmask and self._mask is not nomask:
... | 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
@@ -2671,6 +2671,20 @@
assert_array_equal(x, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ])
assert_equal(x.mask, [1, 0, 0, 0, 1, 1, 0, 0, 0, 0])
+ def test_put_nomask(self... | null | null | namanjain12/numpy_final:6967f50dd1eb922cfa0e28956baa5a0bdc85331a | true | null | 1 | 20 | null | 910 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.218333 | 80.57375 | ||
8,916 | r2e_gym::train::428 | r2e_gym | train | 428 | orange3__41413add942f1754ceb73b28618bc61441ceb3fc | orange3 | biolab/orange3 | python | 41413add942f1754ceb73b28618bc61441ceb3fc | **Title:** Deepcopy Fails for Discrete Contingency Objects Due to Missing Attributes
**Description:**
When attempting to create a deep copy of a `Discrete` contingency object, an `AttributeError` is raised because the copied object lacks the `col_unknowns` attribute. This prevents proper duplication of contingency tab... | diff --git a/Orange/statistics/contingency.py b/Orange/statistics/contingency.py
--- a/Orange/statistics/contingency.py
+++ b/Orange/statistics/contingency.py
@@ -179,8 +179,19 @@
return (
_create_discrete,
(Discrete, np.copy(self), self.col_variable, self.row_variable,
- ... | diff --git a/Orange/tests/test_contingency.py b/Orange/tests/test_contingency.py
--- a/Orange/tests/test_contingency.py
+++ b/Orange/tests/test_contingency.py
@@ -1,6 +1,6 @@
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
-
+import copy
import unittest
from unitte... | null | null | namanjain12/orange3_final:41413add942f1754ceb73b28618bc61441ceb3fc | true | null | 1 | 13 | null | 1,047 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.217833 | 80.57225 | ||
8,917 | r2e_gym::train::4036 | r2e_gym | train | 4,036 | coveragepy__e6df5b39be55c44205ea67811bb812e085599d5e | coveragepy | nedbat/coveragepy | python | e6df5b39be55c44205ea67811bb812e085599d5e | **Title:** Unintended Creation of Data File When Attempting to Read Existing Data
**Description:**
When attempting to read existing coverage data without modifying it, the system unexpectedly creates a new data file. This behavior causes inconsistencies, especially in scenarios where the presence of the data file is u... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -41,6 +41,10 @@
- A new debug option ``debug=sqldata`` adds more detail to ``debug=sql``,
logging all the data being written to the database.
+- Previously, running ``coverage report`` (or any of the reporting commands) in
+ an empty d... | diff --git a/tests/test_data.py b/tests/test_data.py
--- a/tests/test_data.py
+++ b/tests/test_data.py
@@ -118,6 +118,13 @@
def test_empty_data_is_false(self):
covdata = DebugCoverageData()
assert not covdata
+ self.assert_doesnt_exist(".coverage")
+
+ def test_empty_data_is_false_when_... | null | null | namanjain12/coveragepy_final:e6df5b39be55c44205ea67811bb812e085599d5e | true | null | 2 | 10 | null | 1,104 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.217333 | 80.57075 | ||
8,918 | r2e_gym::train::6163 | r2e_gym | train | 6,163 | pillow__838e0fb1a5742f0c08391285c424280b62140050 | pillow | python-pillow/pillow | python | 838e0fb1a5742f0c08391285c424280b62140050 | **Title:** Incorrect Transparency Handling in 'P' Mode APNG Images Leads to Wrong RGBA Pixels
**Description:**
When processing APNG images in palette (`'P'`) mode with transparency information, converting them to RGBA results in incorrect pixel values. Specifically, the transparency data is not properly applied, leadi... | diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py
--- a/src/PIL/PngImagePlugin.py
+++ b/src/PIL/PngImagePlugin.py
@@ -1063,6 +1063,12 @@
"RGBA", self.info["transparency"]
)
else:
+ if self.im.mode == "P" and "transparency... | 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
@@ -258,8 +258,8 @@
assert im.mode == "P"
im.seek(im.n_frames - 1)
im = im.convert("RGBA")
- assert im.getpixel((0, 0)) == (255, 0, 0, 0)
- assert im.getpix... | null | null | namanjain12/pillow_final:838e0fb1a5742f0c08391285c424280b62140050 | true | null | 1 | 6 | null | 1,183 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.217167 | 80.57025 | ||
8,919 | r2e_gym::train::84 | r2e_gym | train | 84 | orange3__2a6f878a820b39fb58a57d023999d8246a982074 | orange3 | biolab/orange3 | python | 2a6f878a820b39fb58a57d023999d8246a982074 | **Title:** AttributeError when selecting more than 20 clusters in Hierarchical Clustering widget
**Description:**
When configuring the Hierarchical Clustering widget to select more than 20 clusters, an AttributeError occurs because the `Warning` object does not have a `many_clusters` attribute. This issue prevents the... | diff --git a/Orange/widgets/unsupervised/owhierarchicalclustering.py b/Orange/widgets/unsupervised/owhierarchicalclustering.py
--- a/Orange/widgets/unsupervised/owhierarchicalclustering.py
+++ b/Orange/widgets/unsupervised/owhierarchicalclustering.py
@@ -240,6 +240,9 @@
Msg("Subset data refers to a differe... | diff --git a/Orange/widgets/unsupervised/tests/test_owhierarchicalclustering.py b/Orange/widgets/unsupervised/tests/test_owhierarchicalclustering.py
--- a/Orange/widgets/unsupervised/tests/test_owhierarchicalclustering.py
+++ b/Orange/widgets/unsupervised/tests/test_owhierarchicalclustering.py
@@ -207,3 +207,22 @@
... | null | null | namanjain12/orange3_final:2a6f878a820b39fb58a57d023999d8246a982074 | true | null | 1 | 8 | null | 1,143 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.217167 | 80.57025 | ||
8,920 | r2e_gym::train::445 | r2e_gym | train | 445 | orange3__cc2c259d738828a09996a3e7df520b39e6d979af | orange3 | biolab/orange3 | python | cc2c259d738828a09996a3e7df520b39e6d979af | **Title:** "All Languages" Selection Resets to Default on Reload
**Description:**
When users select "All Languages" in the datasets widget and reload the application, the selection does not persist and instead resets to the default language.
**Steps to Reproduce:**
1. Open the datasets widget.
2. Change the language ... | diff --git a/Orange/widgets/data/owdatasets.py b/Orange/widgets/data/owdatasets.py
--- a/Orange/widgets/data/owdatasets.py
+++ b/Orange/widgets/data/owdatasets.py
@@ -278,7 +278,10 @@
if self.language is not None and self.language not in languages:
languages.insert(1, self.language)
lang_... | diff --git a/Orange/widgets/data/tests/test_owdatasets.py b/Orange/widgets/data/tests/test_owdatasets.py
--- a/Orange/widgets/data/tests/test_owdatasets.py
+++ b/Orange/widgets/data/tests/test_owdatasets.py
@@ -184,6 +184,22 @@
self.assertEqual(w2.language_combo.currentText(), "Klingon")
@patch("Orange.... | null | null | namanjain12/orange3_final:cc2c259d738828a09996a3e7df520b39e6d979af | true | null | 1 | 7 | null | 1,163 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.217167 | 80.57025 | ||
8,921 | swe_bench::test::0 | swe_bench | test | 0 | astropy__astropy-11693 | astropy/astropy | astropy/astropy | python | 3832210580d516365ddae1a62071001faf94d416 | 'WCS.all_world2pix' failed to converge when plotting WCS with non linear distortions
### Description
When trying to plot an image with a WCS as projection that contains non linear Distortions it fails with a `NoConvergence` error.
### Expected behavior
When I add `quiet=True` as parameter to the call
```pixel = self.... | Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the [guidelines for submitting issues](https://github.com/astropy/astropy/blob/master/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested de... | diff --git a/astropy/wcs/wcsapi/fitswcs.py b/astropy/wcs/wcsapi/fitswcs.py
--- a/astropy/wcs/wcsapi/fitswcs.py
+++ b/astropy/wcs/wcsapi/fitswcs.py
@@ -323,7 +323,17 @@ def pixel_to_world_values(self, *pixel_arrays):
return world[0] if self.world_n_dim == 1 else tuple(world)
def world_to_pixel_values(sel... | diff --git a/astropy/wcs/wcsapi/tests/test_fitswcs.py b/astropy/wcs/wcsapi/tests/test_fitswcs.py
--- a/astropy/wcs/wcsapi/tests/test_fitswcs.py
+++ b/astropy/wcs/wcsapi/tests/test_fitswcs.py
@@ -19,7 +19,7 @@
from astropy.io.fits.verify import VerifyWarning
from astropy.units.core import UnitsWarning
from astropy.ut... | ["astropy/wcs/wcsapi/tests/test_fitswcs.py::test_non_convergence_warning"] | ["astropy/wcs/wcsapi/tests/test_fitswcs.py::test_empty", "astropy/wcs/wcsapi/tests/test_fitswcs.py::test_simple_celestial", "astropy/wcs/wcsapi/tests/test_fitswcs.py::test_time_1d_values[tai]", "astropy/wcs/wcsapi/tests/test_fitswcs.py::test_time_1d_values[tcb]", "astropy/wcs/wcsapi/tests/test_fitswcs.py::test_time_1d_... | null | true | 2021-05-04T10:05:33Z | 1 | 12 | 1 | 10,087 | 0.142857 | 0.8 | 1 | 0.8 | 1 | 0.54 | 80.57 | |
8,922 | r2e_gym::train::6272 | r2e_gym | train | 6,272 | pillow__4126f6cdf7881c91e41abf5fd604f70f7d90d2e3 | pillow | python-pillow/pillow | python | 4126f6cdf7881c91e41abf5fd604f70f7d90d2e3 | **Title:** `im.draft()` Raises TypeError When Attempting to Unpack Return Values
**Description:**
When using the `draft()` method on a JPEG image, attempting to unpack its return value into `mode` and `box` results in a `TypeError`. This occurs because the method returns a `JpegImageFile` object instead of the expecte... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -1190,6 +1190,9 @@
JPEG to greyscale while loading it, or to extract a 128x192
version from a PCD file.
+ If any changes are made, returns a tuple with the chosen `mode` and
+ `box` with c... | diff --git a/Tests/test_image_draft.py b/Tests/test_image_draft.py
--- a/Tests/test_image_draft.py
+++ b/Tests/test_image_draft.py
@@ -13,7 +13,11 @@
im = Image.new(in_mode, in_size)
data = tostring(im, "JPEG")
im = fromstring(data)
- im.draft(req_mode, req_size)
+ mode, box = i... | null | null | namanjain12/pillow_final:4126f6cdf7881c91e41abf5fd604f70f7d90d2e3 | true | null | 2 | 8 | null | 1,141 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.216833 | 80.56925 | ||
8,923 | r2e_gym::train::6207 | r2e_gym | train | 6,207 | pillow__d3ae7a1c4645c8754d00e59aab9dfc740e8c8fd6 | pillow | python-pillow/pillow | python | d3ae7a1c4645c8754d00e59aab9dfc740e8c8fd6 | **Title:** ImageOps.fit Raises ValueError: box offset can't be negative When Aspect Ratios Match
**Description:**
When using `ImageOps.fit` on an image whose aspect ratio already matches the target size, the function still attempts to calculate crop dimensions. This unnecessary calculation introduces floating-point pr... | diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py
--- a/src/PIL/ImageOps.py
+++ b/src/PIL/ImageOps.py
@@ -426,7 +426,11 @@
output_ratio = float(size[0]) / size[1]
# figure out if the sides or top/bottom will be cropped off
- if live_size_ratio >= output_ratio:
+ if live_size_ratio == output_ratio... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -80,6 +80,16 @@
newimg = ImageOps.fit(hopper("RGB").resize((100, 1)), (35, 35))
self.assertEqual(newimg.size, (35, 35))
+
+ def test_fit_same_ratio(self):
+ # The ratio... | null | null | namanjain12/pillow_final:d3ae7a1c4645c8754d00e59aab9dfc740e8c8fd6 | true | null | 1 | 6 | null | 1,179 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2165 | 80.56825 | ||
8,924 | r2e_gym::train::6143 | r2e_gym | train | 6,143 | pillow__a70ea82eb5c2cd073e1fe7cab0dca32b93fdcb9f | pillow | python-pillow/pillow | python | a70ea82eb5c2cd073e1fe7cab0dca32b93fdcb9f | **Title:** NameError When Saving 'P' Mode Images with Transparency to PDF
**Description:**
When attempting to save an image in 'P' (paletted) mode with transparency to a PDF file, a `NameError` is raised due to an undefined variable.
**Example Code:**
```python
from PIL import Image
def save_p_image_with_transparenc... | diff --git a/src/PIL/PdfImagePlugin.py b/src/PIL/PdfImagePlugin.py
--- a/src/PIL/PdfImagePlugin.py
+++ b/src/PIL/PdfImagePlugin.py
@@ -100,6 +100,13 @@
PdfParser.PdfBinary(palette),
]
procset = "ImageI" # indexed color
+
+ if "transparency" in im.info:
+ smask = im.conv... | diff --git a/Tests/test_file_pdf.py b/Tests/test_file_pdf.py
--- a/Tests/test_file_pdf.py
+++ b/Tests/test_file_pdf.py
@@ -46,6 +46,22 @@
@pytest.mark.parametrize("mode", ("LA", "RGBA"))
def test_save_alpha(tmp_path, mode):
helper_save_as_pdf(tmp_path, mode)
+
+
+def test_p_alpha(tmp_path):
+ # Arrange
+ o... | null | null | namanjain12/pillow_final:a70ea82eb5c2cd073e1fe7cab0dca32b93fdcb9f | true | null | 1 | 21 | null | 877 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.216167 | 80.56725 | ||
8,925 | r2e_gym::train::4024 | r2e_gym | train | 4,024 | coveragepy__16ef35f9be4f7b225750fac576e0f6245a100752 | coveragepy | nedbat/coveragepy | python | 16ef35f9be4f7b225750fac576e0f6245a100752 | **Title:** Missing Warning When Multiple Components Change Dynamic Context Simultaneously
**Description:**
When multiple components attempt to switch the dynamic context without proper coordination, no warning is issued about the conflicting changes. This absence of a warning makes it difficult to identify and debug i... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -30,7 +30,11 @@
information about the config files read now shows absolute paths to the
files.
+- A new warning ("dynamic-conflict") is issued if two mechanisms are trying to
+ change the dynamic context. Closes `issue 901`_.
+
.. ... | diff --git a/tests/test_api.py b/tests/test_api.py
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -672,6 +672,19 @@
data.set_query_context("mysuite|multiply_zero")
self.assertEqual([2, 5], sorted(data.lines(suite_filename)))
+ def test_dynamic_context_conflict(self):
+ cov = coverage.C... | null | null | namanjain12/coveragepy_final:16ef35f9be4f7b225750fac576e0f6245a100752 | true | null | 3 | 14 | null | 1,016 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.216 | 80.56675 | ||
8,926 | swe_bench::test::1029 | swe_bench | test | 1,029 | matplotlib__matplotlib-23987 | matplotlib/matplotlib | matplotlib/matplotlib | python | e98d8d085e8f53ec0467422b326f7738a2dd695e | [Bug]: Constrained layout UserWarning even when False
### Bug summary
When using layout settings such as `plt.subplots_adjust` or `bbox_inches='tight`, a UserWarning is produced due to incompatibility with constrained_layout, even if constrained_layout = False. This was not the case in previous versions.
### Code for... | Yup, that is indeed a bug https://github.com/matplotlib/matplotlib/blob/e98d8d085e8f53ec0467422b326f7738a2dd695e/lib/matplotlib/figure.py#L2428-L2431
PR on the way.
@VanWieren Did you mean to close this? We normally keep bugs open until the PR to fix it is actually merged.
> @VanWieren Did you mean to close this? ... | diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -2426,9 +2426,12 @@ def __init__(self,
if isinstance(tight_layout, dict):
self.get_layout_engine().set(**tight_layout)
elif constrained_layout is not N... | diff --git a/lib/matplotlib/tests/test_constrainedlayout.py b/lib/matplotlib/tests/test_constrainedlayout.py
--- a/lib/matplotlib/tests/test_constrainedlayout.py
+++ b/lib/matplotlib/tests/test_constrainedlayout.py
@@ -656,3 +656,14 @@ def test_compressed1():
pos = axs[1, 2].get_position()
np.testing.assert_a... | ["lib/matplotlib/tests/test_constrainedlayout.py::test_set_constrained_layout[False-False]"] | ["lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout1[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout2[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout3[png]", "lib/matplotlib/tests/test_constrainedlayout.py::test_constrained_layout4[pn... | null | true | 2022-09-22T21:39:02Z | 1 | 5 | 1 | 1,233 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.222167 | 80.5665 | |
8,927 | r2e_gym::train::336 | r2e_gym | train | 336 | orange3__7b40090a9ccd235bd84fa3eda1feed0e259621ab | orange3 | biolab/orange3 | python | 7b40090a9ccd235bd84fa3eda1feed0e259621ab | **Title:** Error When Converting Timezone-Aware Datetime to Epoch
**Description:**
When attempting to convert datetime objects that include timezone information to epoch values, a `TypeError` is raised. This issue arises because the subtraction operation fails when the datetime index has a timezone, but the initial ti... | diff --git a/Orange/widgets/data/oweditdomain.py b/Orange/widgets/data/oweditdomain.py
--- a/Orange/widgets/data/oweditdomain.py
+++ b/Orange/widgets/data/oweditdomain.py
@@ -2828,7 +2828,15 @@
def datetime_to_epoch(dti: pd.DatetimeIndex, only_time) -> np.ndarray:
"""Convert datetime to epoch"""
- delta = dt... | diff --git a/Orange/widgets/data/tests/test_oweditdomain.py b/Orange/widgets/data/tests/test_oweditdomain.py
--- a/Orange/widgets/data/tests/test_oweditdomain.py
+++ b/Orange/widgets/data/tests/test_oweditdomain.py
@@ -921,13 +921,18 @@
times = (
["07.02.2022", "18.04.2021"], # date only
... | null | null | namanjain12/orange3_final:7b40090a9ccd235bd84fa3eda1feed0e259621ab | true | null | 1 | 10 | null | 1,095 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.215833 | 80.56625 | ||
8,928 | r2e_gym::train::5591 | r2e_gym | train | 5,591 | scrapy__bcad8947e8192448ab3bd59489444efb567f8793 | scrapy | scrapy/scrapy | python | bcad8947e8192448ab3bd59489444efb567f8793 | **Title:** Unable to Serialize Requests with Inherited Private Callback Methods
**Description:**
When using a callback that is an inherited private method from a mixin class, serializing the request fails because the method name cannot be correctly resolved on the spider object.
**Example Code:**
```python
class Test... | diff --git a/scrapy/utils/reqser.py b/scrapy/utils/reqser.py
--- a/scrapy/utils/reqser.py
+++ b/scrapy/utils/reqser.py
@@ -81,8 +81,13 @@
if func_self is obj:
name = six.get_method_function(func).__name__
if _is_private_method(name):
- classname = obj.__... | diff --git a/tests/test_utils_reqser.py b/tests/test_utils_reqser.py
--- a/tests/test_utils_reqser.py
+++ b/tests/test_utils_reqser.py
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import unittest
+import sys
from scrapy.http import Request, FormRequest
from scrapy.spiders import Spider
@@ -74,6 +75,14 @@
... | null | null | namanjain12/scrapy_final:bcad8947e8192448ab3bd59489444efb567f8793 | true | null | 1 | 9 | null | 1,114 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.215667 | 80.56575 | ||
8,929 | r2e_gym::train::3 | r2e_gym | train | 3 | orange3__ef8363b650134f6415704b064573707a6d304ca3 | orange3 | biolab/orange3 | python | ef8363b650134f6415704b064573707a6d304ca3 | **Title:** Incorrect Year Formatting in Time Bins for Extended Date Ranges
**Description:**
When generating time bins over extended date ranges, the bin labels are incorrectly formatted using two-digit years instead of four-digit years. This results in mismatched labels that can cause confusion and failures in applica... | diff --git a/Orange/preprocess/discretize.py b/Orange/preprocess/discretize.py
--- a/Orange/preprocess/discretize.py
+++ b/Orange/preprocess/discretize.py
@@ -358,16 +358,15 @@
def _time_binnings(mn, mx, min_pts, max_pts):
- yfmt = "%y " if mn.tm_year >= 1950 else "%Y "
bins = []
for place, step, fmt,... | diff --git a/Orange/preprocess/tests/test_discretize.py b/Orange/preprocess/tests/test_discretize.py
--- a/Orange/preprocess/tests/test_discretize.py
+++ b/Orange/preprocess/tests/test_discretize.py
@@ -32,18 +32,19 @@
self.assertEqual(
testbin((1975, 4, 2), (1989, 3, 1)),
[('10 years... | null | null | namanjain12/orange3_final:ef8363b650134f6415704b064573707a6d304ca3 | true | null | 1 | 17 | null | 953 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2155 | 80.56525 | ||
8,930 | r2e_gym::train::6145 | r2e_gym | train | 6,145 | pillow__5076d347759ce1768ce106feccfdaa4c3575b3db | pillow | python-pillow/pillow | python | 5076d347759ce1768ce106feccfdaa4c3575b3db | **Title:** Saving IM Images with Small Palettes Fails to Pad Palette to 768 Bytes
**Description:**
When attempting to save an image with a small palette using the IM format, the palette is not correctly padded to 768 bytes. This results in the saved image file being invalid and unable to be opened, causing an `Unident... | diff --git a/src/PIL/ImImagePlugin.py b/src/PIL/ImImagePlugin.py
--- a/src/PIL/ImImagePlugin.py
+++ b/src/PIL/ImImagePlugin.py
@@ -352,7 +352,13 @@
fp.write(b"Lut: 1\r\n")
fp.write(b"\000" * (511 - fp.tell()) + b"\032")
if im.mode in ["P", "PA"]:
- fp.write(im.im.getpalette("RGB", "RGB;L")) #... | diff --git a/Tests/test_file_im.py b/Tests/test_file_im.py
--- a/Tests/test_file_im.py
+++ b/Tests/test_file_im.py
@@ -86,6 +86,18 @@
assert_image_equal_tofile(im, out)
+def test_small_palette(tmp_path):
+ im = Image.new("P", (1, 1))
+ colors = [0, 1, 2]
+ im.putpalette(colors)
+
+ out = str(tmp_pa... | null | null | namanjain12/pillow_final:5076d347759ce1768ce106feccfdaa4c3575b3db | true | null | 1 | 8 | null | 1,132 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.215333 | 80.56475 | ||
8,931 | r2e_gym::train::210 | r2e_gym | train | 210 | orange3__8186dd6c28e8d76d48e12940e9efda574cceabb2 | orange3 | biolab/orange3 | python | 8186dd6c28e8d76d48e12940e9efda574cceabb2 | **Title:** Creating Table from NumPy Array with Infinities Raises ValueError
**Description:**
When initializing a `Table` with a NumPy array that contains infinite (`inf`) values, a `ValueError` is raised instead of handling the infinities appropriately. This behavior prevents the seamless integration of datasets that... | diff --git a/Orange/data/table.py b/Orange/data/table.py
--- a/Orange/data/table.py
+++ b/Orange/data/table.py
@@ -785,18 +785,18 @@
raise ValueError("Invalid number of values")
else:
col_idx, values = [col_idx], [value]
- for value, col_idx in zip(values, c... | diff --git a/Orange/tests/test_table.py b/Orange/tests/test_table.py
--- a/Orange/tests/test_table.py
+++ b/Orange/tests/test_table.py
@@ -283,9 +283,6 @@
with warnings.catch_warnings():
warnings.simplefilter("ignore")
d = data.Table("test2")
-
- vara = d.domain["a"]
- ... | null | null | namanjain12/orange3_final:8186dd6c28e8d76d48e12940e9efda574cceabb2 | true | null | 1 | 15 | null | 990 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.215 | 80.56375 | ||
8,932 | r2e_gym::train::4978 | r2e_gym | train | 4,978 | datalad__5415ce96451190819e66d8664c7acf33f2076151 | datalad | datalad/datalad | python | 5415ce96451190819e66d8664c7acf33f2076151 | **Title:** Datasets Processed in Unstable Order Causing Subdatasets to Be Created Before Parent Datasets
**Description:**
When adding URLs, the datasets are processed in an unpredictable order. This leads to subdatasets being created before their parent datasets, which can cause hierarchy and dependency issues.
**Exa... | diff --git a/datalad/plugin/addurls.py b/datalad/plugin/addurls.py
--- a/datalad/plugin/addurls.py
+++ b/datalad/plugin/addurls.py
@@ -373,6 +373,24 @@
"Finished requesting file names")
+def sort_paths(paths):
+ """Sort `paths` by directory level and then alphabetically.
+
+ Paramete... | diff --git a/datalad/plugin/tests/test_addurls.py b/datalad/plugin/tests/test_addurls.py
--- a/datalad/plugin/tests/test_addurls.py
+++ b/datalad/plugin/tests/test_addurls.py
@@ -136,6 +136,18 @@
eq_(au.get_subpaths(fname), expect)
+def test_sort_paths():
+ paths = [op.join("x", "a", "b"),
+ ... | null | null | namanjain12/datalad_final:5415ce96451190819e66d8664c7acf33f2076151 | true | null | 1 | 20 | null | 887 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2145 | 80.56225 | ||
8,933 | r2e_gym::train::6534 | r2e_gym | train | 6,534 | pillow__5c05fe4d9b98e3c11b186c407d462249e85999bc | pillow | python-pillow/pillow | python | 5c05fe4d9b98e3c11b186c407d462249e85999bc | **Title:** Incorrect OSError Raised When Reading Truncated BMP Files with Large Sizes
**Description:**
When attempting to read a truncated BMP image file where the requested read size exceeds the predefined `SAFEBLOCK`, an unexpected `OSError` is raised. Instead of indicating that the file read was incomplete, the err... | diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py
--- a/src/PIL/ImageFile.py
+++ b/src/PIL/ImageFile.py
@@ -545,12 +545,13 @@
raise OSError("Truncated File Read")
return data
data = []
- while size > 0:
- block = fp.read(min(size, SAFEBLOCK))
+ remaining_size = size
+ w... | diff --git a/Tests/test_imagefile.py b/Tests/test_imagefile.py
--- a/Tests/test_imagefile.py
+++ b/Tests/test_imagefile.py
@@ -2,7 +2,7 @@
import pytest
-from PIL import EpsImagePlugin, Image, ImageFile, features
+from PIL import BmpImagePlugin, EpsImagePlugin, Image, ImageFile, _binary, features
from .helper i... | null | null | namanjain12/pillow_final:5c05fe4d9b98e3c11b186c407d462249e85999bc | true | null | 1 | 7 | null | 1,147 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2145 | 80.56225 | ||
8,934 | r2e_gym::train::6375 | r2e_gym | train | 6,375 | pillow__ec6f2d41f8b1c33a6246fea1aa557a83a6340791 | pillow | python-pillow/pillow | python | ec6f2d41f8b1c33a6246fea1aa557a83a6340791 | **Title:** `autocontrast` Raises TypeError When Using Tuple for `cutoff` Parameter
**Description:**
When using the `autocontrast` function from the PIL library, providing a tuple for the `cutoff` parameter results in a TypeError. The function is expected to handle both single integers and tuples to specify different c... | diff --git a/src/PIL/ImageOps.py b/src/PIL/ImageOps.py
--- a/src/PIL/ImageOps.py
+++ b/src/PIL/ImageOps.py
@@ -70,7 +70,9 @@
becomes white (255).
:param image: The image to process.
- :param cutoff: How many percent to cut off from the histogram.
+ :param cutoff: The percent to cut off from the histog... | diff --git a/Tests/test_imageops.py b/Tests/test_imageops.py
--- a/Tests/test_imageops.py
+++ b/Tests/test_imageops.py
@@ -300,3 +300,14 @@
"Tests/images/hopper_orientation_" + str(i) + ext
) as orientation_im:
check(orientation_im)
+
+
+def test_autocontrast_c... | null | null | namanjain12/pillow_final:ec6f2d41f8b1c33a6246fea1aa557a83a6340791 | true | null | 1 | 12 | null | 1,046 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.214333 | 80.56175 | ||
8,935 | r2e_gym::train::4440 | r2e_gym | train | 4,440 | numpy__e25f7c9e314e79de6be5f17dc4c2c2be8ee9b753 | numpy | numpy/numpy | python | e25f7c9e314e79de6be5f17dc4c2c2be8ee9b753 | ### Title
`polyvalfromroots` does not raise `ValueError` when `x.ndim` is not less than `r.ndim` with `tensor=False`
### Description
When using `polyvalfromroots` with `tensor=False`, the function is expected to raise a `ValueError` if the number of dimensions of the evaluation points array (`x`) is not less than the ... | diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -856,15 +856,16 @@
>>> polyvalfromroots(b, r, tensor=False)
array([-0., 0.])
"""
- r = np.array(r, ndmin=1, copy=0) + 0.0
- if r.size == 0:
- ... | diff --git a/numpy/polynomial/tests/test_polynomial.py b/numpy/polynomial/tests/test_polynomial.py
--- a/numpy/polynomial/tests/test_polynomial.py
+++ b/numpy/polynomial/tests/test_polynomial.py
@@ -137,19 +137,24 @@
assert_equal(poly.polyval(x, [1, 0, 0]).shape, dims)
def test_polyvalfromroots(self... | null | null | namanjain12/numpy_final:e25f7c9e314e79de6be5f17dc4c2c2be8ee9b753 | true | null | 1 | 19 | null | 905 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.214167 | 80.56125 | ||
8,936 | r2e_gym::train::6020 | r2e_gym | train | 6,020 | tornado__2237a72af711c49b020922c0f33a3fe63f6f8ee8 | tornado | tornadoweb/tornado | python | 2237a72af711c49b020922c0f33a3fe63f6f8ee8 | **Title:** Exceptions in Native Coroutines Added as Callbacks Are Not Logged, Causing IOLoop to Hang
**Description:**
When a native coroutine is added as a callback to the IOLoop and it raises an exception, the exception is not properly handled or logged. This results in the IOLoop hanging indefinitely, leading to tim... | diff --git a/tornado/ioloop.py b/tornado/ioloop.py
--- a/tornado/ioloop.py
+++ b/tornado/ioloop.py
@@ -598,12 +598,21 @@
"""
try:
ret = callback()
- if ret is not None and is_future(ret):
+ if ret is not None:
+ from tornado import gen
... | 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
@@ -363,6 +363,18 @@
with ExpectLog(app_log, "Exception in callback"):
self.wait()
+ @skipBefore35
+ def test_exception_logging_native_coro(sel... | null | null | namanjain12/tornado_final:2237a72af711c49b020922c0f33a3fe63f6f8ee8 | true | null | 1 | 13 | null | 1,025 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.214167 | 80.56125 | ||
8,937 | r2e_gym::train::4776 | r2e_gym | train | 4,776 | numpy__7a2ded1522305cfbab4e34a18198f3cbcae7755c | numpy | numpy/numpy | python | 7a2ded1522305cfbab4e34a18198f3cbcae7755c | **Title:** AttributeError When Using `vectorize` Decorator with Positional Arguments
**Description:**
Using the `@vectorize` decorator with positional arguments leads to an `AttributeError` because the function is not correctly assigned.
**Example Code:**
```python
import numpy as np
@np.vectorize(['float64'], "retu... | 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
@@ -2286,6 +2286,25 @@
"""
def __init__(self, pyfunc=np._NoValue, otypes=None, doc=None,
excluded=None, cache=False, signature=None):
+
+ if not calla... | 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
@@ -1816,6 +1816,17 @@
assert_equal(r.dtype, np.dtype('float64'))
assert_array_equal(r, [1, 2, 3])
assert f.__name... | null | null | namanjain12/numpy_final:7a2ded1522305cfbab4e34a18198f3cbcae7755c | true | null | 1 | 19 | null | 904 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.214 | 80.56075 | ||
8,938 | r2e_gym::train::4732 | r2e_gym | train | 4,732 | numpy__42a5bddc937ef02175d52a3ab3b3da6229e1ecb2 | numpy | numpy/numpy | python | 42a5bddc937ef02175d52a3ab3b3da6229e1ecb2 | **Title:** `array_function_dispatch` Raises `TypeError` When Using `module` Keyword Argument
**Description**
When applying the `array_function_dispatch` decorator with the `module` keyword argument, a `TypeError` is raised indicating that the decorator does not accept the `module` parameter. This prevents specifying t... | diff --git a/numpy/core/overrides.py b/numpy/core/overrides.py
--- a/numpy/core/overrides.py
+++ b/numpy/core/overrides.py
@@ -105,9 +105,10 @@
if result is not NotImplemented:
return result
- raise TypeError('no implementation found for {} on types that implement '
+ func_name = '{}.{}'.f... | diff --git a/numpy/core/tests/test_overrides.py b/numpy/core/tests/test_overrides.py
--- a/numpy/core/tests/test_overrides.py
+++ b/numpy/core/tests/test_overrides.py
@@ -296,12 +296,13 @@
def test_not_implemented(self):
MyArray, implements = _new_duck_type_and_implements()
- @array_function_disp... | null | null | namanjain12/numpy_final:42a5bddc937ef02175d52a3ab3b3da6229e1ecb2 | true | null | 1 | 11 | null | 1,064 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.214 | 80.56075 | ||
8,939 | r2e_gym::train::6269 | r2e_gym | train | 6,269 | pillow__0a28840bc4ba8f9f40be4b63a9e7754dd6a697fb | pillow | python-pillow/pillow | python | 0a28840bc4ba8f9f40be4b63a9e7754dd6a697fb | **Title:** Saving JPEG with Large ICC Profile Causes Encoder Error
**Description:**
When saving a JPEG image with a large ICC profile using the `progressive` and `optimize` options, an `OSError` is raised indicating a buffer size issue. This occurs because the buffer is insufficient to handle the combined size of the ... | diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py
--- a/src/PIL/JpegImagePlugin.py
+++ b/src/PIL/JpegImagePlugin.py
@@ -797,10 +797,14 @@
bufsize = 2 * im.size[0] * im.size[1]
else:
bufsize = im.size[0] * im.size[1]
-
- # The EXIF info needs to be written as one ... | 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
@@ -214,12 +214,19 @@
# Should not raise OSError for image with icc larger than image size.
im.save(
f,
- format="JPEG",
p... | null | null | namanjain12/pillow_final:0a28840bc4ba8f9f40be4b63a9e7754dd6a697fb | true | null | 1 | 12 | null | 1,043 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.213833 | 80.56025 | ||
8,940 | r2e_gym::train::82 | r2e_gym | train | 82 | orange3__9ed8ee7fd5434c69295e6ba0c2b69abe27366b04 | orange3 | biolab/orange3 | python | 9ed8ee7fd5434c69295e6ba0c2b69abe27366b04 | **Title:** Feature Statistics Widget Fails to Output All Statistics When No Features Are Selected
**Description:**
When using the Feature Statistics widget without selecting any specific features, the widget is expected to output statistics for all available variables. However, currently, it does not send any statisti... | diff --git a/Orange/widgets/data/owfeaturestatistics.py b/Orange/widgets/data/owfeaturestatistics.py
--- a/Orange/widgets/data/owfeaturestatistics.py
+++ b/Orange/widgets/data/owfeaturestatistics.py
@@ -851,16 +851,17 @@
def commit(self):
if not self.selected_vars:
self.Outputs.reduced_data.s... | diff --git a/Orange/widgets/data/tests/test_owfeaturestatistics.py b/Orange/widgets/data/tests/test_owfeaturestatistics.py
--- a/Orange/widgets/data/tests/test_owfeaturestatistics.py
+++ b/Orange/widgets/data/tests/test_owfeaturestatistics.py
@@ -325,7 +325,7 @@
self.send_signal(self.widget.Inputs.data, self.d... | null | null | namanjain12/orange3_final:9ed8ee7fd5434c69295e6ba0c2b69abe27366b04 | true | null | 2 | 15 | null | 983 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.213833 | 80.56025 | ||
8,941 | swe_bench::test::1448 | swe_bench | test | 1,448 | pytest-dev__pytest-7500 | pytest-dev/pytest | pytest-dev/pytest | python | 358150c30ee77c4b38dd63125d42d071304baf48 | Cleaning up temporary directories occasionally raises PermissionError
On Windows, I'm finding that *pytest* occasionally raises an exception starting with `PermissionError: [WinError 5] Access is denied` while cleaning up its temporary directories. Below is an example of the output of a test session in which the excep... | Hi @stanwest,
The order should not really matter in that situation, what might be happening is that by first cleaning up the `garbage-*` directories, this is giving more time for whatever is holding the locked directories to release that lock (say a background process), and then it might appear to solve the problem.... | diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py
--- a/src/_pytest/pathlib.py
+++ b/src/_pytest/pathlib.py
@@ -286,12 +286,17 @@ def maybe_delete_a_numbered_dir(path: Path) -> None:
def ensure_deletable(path: Path, consider_lock_dead_if_created_before: float) -> bool:
- """checks if a lock exists an... | diff --git a/testing/test_pathlib.py b/testing/test_pathlib.py
--- a/testing/test_pathlib.py
+++ b/testing/test_pathlib.py
@@ -358,17 +358,25 @@ def test_get_extended_length_path_str():
def test_suppress_error_removing_lock(tmp_path):
- """ensure_deletable should not raise an exception if the lock file cannot b... | ["testing/test_pathlib.py::test_suppress_error_removing_lock"] | ["testing/test_pathlib.py::TestFNMatcherPort::test_matching[pathlib-*.py-foo.py]", "testing/test_pathlib.py::TestFNMatcherPort::test_matching[pathlib-*.py-bar/foo.py]", "testing/test_pathlib.py::TestFNMatcherPort::test_matching[pathlib-test_*.py-foo/test_foo.py]", "testing/test_pathlib.py::TestFNMatcherPort::test_match... | null | true | 2020-07-14T23:09:45Z | 1 | 11 | 1 | 6,984 | 0 | 0.8 | 1 | 0.5 | 1 | 0.536667 | 80.56 | |
8,942 | r2e_gym::train::5945 | r2e_gym | train | 5,945 | tornado__24677828d2ce10b3f85ec9c18d38d54c1ab0c382 | tornado | tornadoweb/tornado | python | 24677828d2ce10b3f85ec9c18d38d54c1ab0c382 | **Title:** `Subprocess.wait_for_exit()` Method Missing Causes AttributeError
**Description:**
When attempting to use the `wait_for_exit()` method on a `Subprocess` instance, an `AttributeError` is raised because the method does not exist.
**Example Code:**
```python
from tornado.process import Subprocess
import sys
... | diff --git a/tornado/process.py b/tornado/process.py
--- a/tornado/process.py
+++ b/tornado/process.py
@@ -29,6 +29,7 @@
from binascii import hexlify
+from tornado.concurrent import Future
from tornado import ioloop
from tornado.iostream import PipeIOStream
from tornado.log import gen_log
@@ -258,6 +259,22 @@
... | diff --git a/tornado/test/process_test.py b/tornado/test/process_test.py
--- a/tornado/test/process_test.py
+++ b/tornado/test/process_test.py
@@ -13,7 +13,7 @@
from tornado.log import gen_log
from tornado.process import fork_processes, task_id, Subprocess
from tornado.simple_httpclient import SimpleAsyncHTTPClient
... | null | null | namanjain12/tornado_final:24677828d2ce10b3f85ec9c18d38d54c1ab0c382 | true | null | 1 | 17 | null | 940 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.213333 | 80.55875 | ||
8,943 | r2e_gym::train::5380 | r2e_gym | train | 5,380 | aiohttp__8a6c703415addca5b5aaa011476bd7f2df324a28 | aiohttp | aio-libs/aiohttp | python | 8a6c703415addca5b5aaa011476bd7f2df324a28 | **Title:** Incorrect Initialization Arguments in `HTTPFound` and `HTTPMethodNotAllowed` Classes Cause Errors
**Description:**
When initializing the `HTTPFound` and `HTTPMethodNotAllowed` classes, providing certain arguments leads to unexpected errors.
**Example Buggy Code:**
```python
req = make_request()
resp = web.... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -648,10 +648,9 @@
class _HTTPMove(HTTPRedirection):
def __init__(self, request, location, *, headers=None, reason=None):
- if location is None:
+ if not location:
raise ValueError("HTTP redirect... | diff --git a/tests/test_web_exceptions.py b/tests/test_web_exceptions.py
--- a/tests/test_web_exceptions.py
+++ b/tests/test_web_exceptions.py
@@ -73,3 +73,41 @@
codes = collections.Counter(cls.status_code for cls in terminals)
self.assertNotIn(None, codes)
self.assertEqual(1, codes.most_comm... | null | null | namanjain12/aiohttp_final:8a6c703415addca5b5aaa011476bd7f2df324a28 | true | null | 1 | 7 | null | 1,138 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.213 | 80.55775 | ||
8,944 | r2e_gym::train::5349 | r2e_gym | train | 5,349 | aiohttp__e36c5f0ffeeea0076736c5756d63f5933c91eb8d | aiohttp | aio-libs/aiohttp | python | e36c5f0ffeeea0076736c5756d63f5933c91eb8d | **Title:** Unable to Set Custom `writer_limit` on WebSocketResponse
**Description:**
When attempting to initialize a `WebSocketResponse` with a custom `writer_limit`, a `TypeError` is raised indicating that the `__init__()` method received an unexpected keyword argument.
**Example Code:**
```python
ws = web.WebSocket... | diff --git a/CHANGES/9572.feature.rst b/CHANGES/9572.feature.rst
--- a/CHANGES/9572.feature.rst
+++ b/CHANGES/9572.feature.rst
@@ -0,0 +1 @@
+Added ``writer_limit`` to the :py:class:`~aiohttp.web.WebSocketResponse` to be able to adjust the limit before the writer forces the buffer to be drained -- by :user:`bdraco`.
di... | diff --git a/tests/test_web_websocket.py b/tests/test_web_websocket.py
--- a/tests/test_web_websocket.py
+++ b/tests/test_web_websocket.py
@@ -237,6 +237,18 @@
assert ws.close_code is None
+async def test_raise_writer_limit(make_request: _RequestMaker) -> None:
+ """Test the writer limit can be adjusted."""... | null | null | namanjain12/aiohttp_final:e36c5f0ffeeea0076736c5756d63f5933c91eb8d | true | null | 3 | 19 | null | 897 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.212833 | 80.55725 | ||
8,945 | r2e_gym::train::5485 | r2e_gym | train | 5,485 | aiohttp__4592d03194ebd42638834519cdc65feb484a0f30 | aiohttp | aio-libs/aiohttp | python | 4592d03194ebd42638834519cdc65feb484a0f30 | **Title:** Unable to Set Custom Writer Limit in WebSocketResponse
**Description:**
When initializing a `WebSocketResponse` with a custom `writer_limit`, a `TypeError` is raised because the `writer_limit` parameter is not recognized. This prevents developers from adjusting the WebSocket writer's limit as needed for the... | diff --git a/CHANGES/9572.feature.rst b/CHANGES/9572.feature.rst
--- a/CHANGES/9572.feature.rst
+++ b/CHANGES/9572.feature.rst
@@ -0,0 +1 @@
+Added ``writer_limit`` to the :py:class:`~aiohttp.web.WebSocketResponse` to be able to adjust the limit before the writer forces the buffer to be drained -- by :user:`bdraco`.
di... | diff --git a/tests/test_web_websocket.py b/tests/test_web_websocket.py
--- a/tests/test_web_websocket.py
+++ b/tests/test_web_websocket.py
@@ -247,6 +247,18 @@
ws = WebSocketResponse()
assert not ws.closed
assert ws.close_code is None
+
+
+async def test_raise_writer_limit(make_request) -> None:
+ """... | null | null | namanjain12/aiohttp_final:4592d03194ebd42638834519cdc65feb484a0f30 | true | null | 3 | 18 | null | 917 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.212833 | 80.55725 | ||
8,946 | r2e_gym::train::5051 | r2e_gym | train | 5,051 | datalad__b3c3916449e13b8e3de4ecf4e0aee59b7fbc28f8 | datalad | datalad/datalad | python | b3c3916449e13b8e3de4ecf4e0aee59b7fbc28f8 | **Title:** Environment Variable `DATALAD_CONFIG_OVERRIDES` Not Applied, Causing Configuration Key Error
**Description:**
When setting the `DATALAD_CONFIG_OVERRIDES` environment variable with JSON-formatted overrides, the configuration does not apply these overrides correctly. As a result, accessing certain configurati... | diff --git a/datalad/config.py b/datalad/config.py
--- a/datalad/config.py
+++ b/datalad/config.py
@@ -125,11 +125,11 @@
overrides = {}
dct = {}
for k in os.environ:
- if k == "DATALAD_CONFIG_OVERRIDES":
+ if k == "DATALAD_CONFIG_OVERRIDES_JSON":
try:
overrides... | diff --git a/datalad/interface/tests/test_run_procedure.py b/datalad/interface/tests/test_run_procedure.py
--- a/datalad/interface/tests/test_run_procedure.py
+++ b/datalad/interface/tests/test_run_procedure.py
@@ -409,9 +409,9 @@
with assert_raises(ValueError):
ds.run_procedure(spec=["print_args"... | null | null | namanjain12/datalad_final:b3c3916449e13b8e3de4ecf4e0aee59b7fbc28f8 | true | null | 2 | 6 | null | 1,156 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.212667 | 80.55675 | ||
8,947 | r2e_gym::train::5807 | r2e_gym | train | 5,807 | tornado__940fd87fe9145d1154c8457221f86d56ea063c65 | tornado | tornadoweb/tornado | python | 940fd87fe9145d1154c8457221f86d56ea063c65 | **'Set-Cookie' Header Missing When Configuring XSRF Cookie Expiration**
**Description**
When setting up XSRF cookies with a specified expiration day via settings, the server fails to include the `'Set-Cookie'` header in the response. This prevents the XSRF token from being properly set in the client's browser.
For e... | diff --git a/tornado/web.py b/tornado/web.py
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -1418,13 +1418,9 @@
else:
raise ValueError("unknown xsrf cookie version %d", output_version)
if version is None:
- expires_days = 30 if self.current_user else None
- ... | diff --git a/tornado/test/web_test.py b/tornado/test/web_test.py
--- a/tornado/test/web_test.py
+++ b/tornado/test/web_test.py
@@ -2902,11 +2902,23 @@
self.write(self.xsrf_token)
def get_app_kwargs(self):
- return dict(xsrf_cookies=True, xsrf_cookie_kwargs=dict(httponly=True))
+ return... | null | null | namanjain12/tornado_final:940fd87fe9145d1154c8457221f86d56ea063c65 | true | null | 1 | 10 | null | 1,074 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.212333 | 80.55575 | ||
8,948 | r2e_gym::train::4754 | r2e_gym | train | 4,754 | numpy__175cc57245a78e4037f80835e63dbbe077d43cae | numpy | numpy/numpy | python | 175cc57245a78e4037f80835e63dbbe077d43cae | **Title:** `np.ma.count` Does Not Preserve Dimensions with `keepdims=True` and `axis=None`
**Description:**
When using `np.ma.count` with `keepdims=True` and `axis=None`, the function fails to maintain the original number of dimensions of the input array. Instead of returning an array with the same number of dimension... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -25,6 +25,11 @@
import sys
import warnings
from functools import reduce
+
+if sys.version_info[0] >= 3:
+ import builtins
+else:
+ import __builtin__ as builtins
import numpy as np
import numpy.core.umath as u... | 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
@@ -4364,6 +4364,7 @@
assert_equal(count(a, axis=1), 3*ones((2,4)))
assert_equal(count(a, axis=(0,1)), 6*ones((4,)))
assert_equal(count(a, keepdims=True),... | null | null | namanjain12/numpy_final:175cc57245a78e4037f80835e63dbbe077d43cae | true | null | 1 | 12 | null | 1,034 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.212333 | 80.55575 | ||
8,949 | r2e_gym::train::5125 | r2e_gym | train | 5,125 | pyramid__24c63558d04dc9ad2a1ee2243a63ace0d355ffe5 | pyramid | pylons/pyramid | python | 24c63558d04dc9ad2a1ee2243a63ace0d355ffe5 | **Title:** Unable to Specify Custom Package Name with `pcreate` Command
**Description:**
When using the `pcreate` command to scaffold a new package, there is no option to specify a custom package name. The package name is automatically derived from the output directory's base folder, which causes issues when you want ... | diff --git a/pyramid/scripts/pcreate.py b/pyramid/scripts/pcreate.py
--- a/pyramid/scripts/pcreate.py
+++ b/pyramid/scripts/pcreate.py
@@ -45,6 +45,13 @@
action='store_true',
help=("A backwards compatibility alias for -l/--list. "
"List all ava... | diff --git a/pyramid/tests/test_scripts/test_pcreate.py b/pyramid/tests/test_scripts/test_pcreate.py
--- a/pyramid/tests/test_scripts/test_pcreate.py
+++ b/pyramid/tests/test_scripts/test_pcreate.py
@@ -80,6 +80,27 @@
{'project': 'Distro', 'egg': 'Distro', 'package': 'distro',
'pyramid_versio... | null | null | namanjain12/pyramid_final:24c63558d04dc9ad2a1ee2243a63ace0d355ffe5 | true | null | 1 | 17 | null | 933 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.212167 | 80.55525 | ||
8,950 | swe_bench::test::1480 | swe_bench | test | 1,480 | pytest-dev__pytest-9249 | pytest-dev/pytest | pytest-dev/pytest | python | 1824349f74298112722396be6f84a121bc9d6d63 | test ids with `/`s cannot be selected with `-k`
By default pytest 6.2.2 parametrize does user arguments to generate IDs, but some of these ids cannot be used with `-k` option because you endup with errors like `unexpected character "/"` when trying to do so.
The solution for this bug is to assure that auto-generated ... | The test ids are not invalid, keyword expressions are simply not able to express slashes
It's not clear to me if that should be added
I am not sure either, but I wanted to underline the issue, hoping that we can find a way to improve the UX. The idea is what what we display should also be easily used to run a test or... | diff --git a/src/_pytest/mark/expression.py b/src/_pytest/mark/expression.py
--- a/src/_pytest/mark/expression.py
+++ b/src/_pytest/mark/expression.py
@@ -6,7 +6,7 @@
expr: and_expr ('or' and_expr)*
and_expr: not_expr ('and' not_expr)*
not_expr: 'not' not_expr | '(' expr ')' | ident
-ident: (\w|:|\+|-... | diff --git a/testing/test_mark.py b/testing/test_mark.py
--- a/testing/test_mark.py
+++ b/testing/test_mark.py
@@ -1111,7 +1111,7 @@ def test_pytest_param_id_allows_none_or_string(s) -> None:
assert pytest.param(id=s)
-@pytest.mark.parametrize("expr", ("NOT internal_err", "NOT (internal_err)", "bogus/"))
+@pyt... | ["testing/test_mark_expression.py::test_valid_idents[a/b]"] | ["testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[mark]", "testing/test_mark.py::TestMark::test_pytest_exists_in_namespace_all[param]", "testing/test_mark.py::TestMark::test_pytest_mark_notcallable", "testing/test_mark.py::TestMark::test_mark_with_param", "testing/test_mark.py::TestMark::test_pytest... | null | true | 2021-10-29T13:58:57Z | 1 | 4 | 1 | 1,229 | 0 | 0.8 | 1 | 0.7 | 0.8 | 0.218167 | 80.5545 | |
8,951 | r2e_gym::train::4777 | r2e_gym | train | 4,777 | numpy__4b82e29a18cd2c17b258bab0e2d937ab2157377b | numpy | numpy/numpy | python | 4b82e29a18cd2c17b258bab0e2d937ab2157377b | **Title:** Using `@np.vectorize` Decorator Without Keyword Arguments Raises TypeError
**Description:**
After the recent update, applying the `@np.vectorize` decorator without specifying keyword arguments results in a `TypeError`. Previously, it was possible to use positional arguments when decorating a function, but t... | 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
@@ -2287,23 +2287,12 @@
def __init__(self, pyfunc=np._NoValue, otypes=None, doc=None,
excluded=None, cache=False, signature=None):
- if not callable(pyfu... | 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
@@ -1817,16 +1817,15 @@
assert_array_equal(r, [1, 2, 3])
assert f.__name__ == 'f'
- def test_decorator_positional_args... | null | null | namanjain12/numpy_final:4b82e29a18cd2c17b258bab0e2d937ab2157377b | true | null | 1 | 23 | null | 810 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.211667 | 80.55375 | ||
8,952 | r2e_gym::train::4089 | r2e_gym | train | 4,089 | coveragepy__9209c555c7612b4a649edca5db97a04177ee5a9a | coveragepy | nedbat/coveragepy | python | 9209c555c7612b4a649edca5db97a04177ee5a9a | **Title:** Excluded Branches Incorrectly Reported as Missing in Coverage Results
**Description:**
When specifying branches to exclude from coverage analysis, these branches are still being reported as missing. This leads to inaccurate coverage reports, showing excluded branches as not covered.
**Example Code:**
```py... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -22,8 +22,13 @@
Unreleased
----------
+- Fix: Complex conditionals over excluded lines could have incorrectly reported
+ a missing branch (`issue 1271`_). This is now fixed.
+
- Fix: Removed another vestige of jQuery from the source tar... | diff --git a/tests/test_coverage.py b/tests/test_coverage.py
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -1492,7 +1492,7 @@
""",
[1,2,3,7,8], "", excludes=['#pragma: NO COVER'],
arcz=".1 12 23 37 45 58 78 8.",
- arcz_missing="45 58",
+ arcz_m... | null | null | namanjain12/coveragepy_final:9209c555c7612b4a649edca5db97a04177ee5a9a | true | null | 2 | 8 | null | 1,109 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2115 | 80.55325 | ||
8,953 | r2e_gym::train::5156 | r2e_gym | train | 5,156 | pyramid__75d871ce118456eeaa2fac7136faf0ff4478dd89 | pyramid | pylons/pyramid | python | 75d871ce118456eeaa2fac7136faf0ff4478dd89 | **Title:** `wsgiapp` and `wsgiapp2` Do Not Raise `ValueError` When `wrapped` Is `None`
**Description:**
When the `wrapped` parameter is set to `None` in the `wsgiapp` or `wsgiapp2` functions, no exception is raised. This oversight can lead to unexpected behaviors and makes it harder to debug issues related to improper... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,8 @@
introspectable but not when passed for registration. This would mean that
add_route_predicate for example can not take a string and turn it into the
actual callable function.
+- p.wsgi.wsgiapp and p.wsgi.wsgiapp2 now r... | diff --git a/pyramid/tests/test_wsgi.py b/pyramid/tests/test_wsgi.py
--- a/pyramid/tests/test_wsgi.py
+++ b/pyramid/tests/test_wsgi.py
@@ -4,6 +4,17 @@
def _callFUT(self, app):
from pyramid.wsgi import wsgiapp
return wsgiapp(app)
+
+ def test_wsgiapp_none(self):
+ self.assertRaises(Valu... | null | null | namanjain12/pyramid_final:75d871ce118456eeaa2fac7136faf0ff4478dd89 | true | null | 2 | 9 | null | 1,089 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2115 | 80.55325 | ||
8,954 | r2e_gym::train::6446 | r2e_gym | train | 6,446 | pillow__0e10a5cc7be0c5c17f1c0fd95c74cd2934c19632 | pillow | python-pillow/pillow | python | 0e10a5cc7be0c5c17f1c0fd95c74cd2934c19632 | **Title:** RGBA Images Saved as GIFs Do Not Preserve Transparency Correctly
**Description:**
When attempting to save an RGBA image with transparency as a GIF, the transparency information is not correctly preserved. Specifically, transparent pixels are being saved as fully opaque, resulting in the loss of intended tra... | diff --git a/src/PIL/GifImagePlugin.py b/src/PIL/GifImagePlugin.py
--- a/src/PIL/GifImagePlugin.py
+++ b/src/PIL/GifImagePlugin.py
@@ -425,7 +425,13 @@
palette_size = 256
if im.palette:
palette_size = len(im.palette.getdata()[1]) // 3
- return im.convert("P", palett... | 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
@@ -957,3 +957,13 @@
with Image.open("Tests/images/missing_background.gif") as im:
im.seek(1)
assert_image_equal_tofile(im, "Tests/images/missing_background_first_frame.png")
+
+... | null | null | namanjain12/pillow_final:0e10a5cc7be0c5c17f1c0fd95c74cd2934c19632 | true | null | 1 | 8 | null | 1,108 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.211333 | 80.55275 | ||
8,955 | r2e_gym::train::5755 | r2e_gym | train | 5,755 | scrapy__9f9a2292e08cb0944e1e88e64cef1f4b17486ec8 | scrapy | scrapy/scrapy | python | 9f9a2292e08cb0944e1e88e64cef1f4b17486ec8 | **Missing Deprecation Warning for `custom` Attribute in `build_component_list()`**
**Description**
When using the `custom` attribute with the `build_component_list()` function, no deprecation warning is issued. This lack of notification can lead to unexpected errors, especially when `custom` contains duplicate compon... | diff --git a/scrapy/utils/conf.py b/scrapy/utils/conf.py
--- a/scrapy/utils/conf.py
+++ b/scrapy/utils/conf.py
@@ -50,11 +50,17 @@
"please provide a real number or None instead"
)
- if isinstance(custom, (list, tuple)):
- _check_components(custom)
- return type(c... | diff --git a/tests/test_utils_conf.py b/tests/test_utils_conf.py
--- a/tests/test_utils_conf.py
+++ b/tests/test_utils_conf.py
@@ -1,5 +1,7 @@
import unittest
import warnings
+
+import pytest
from scrapy.exceptions import ScrapyDeprecationWarning, UsageError
from scrapy.settings import BaseSettings, Settings
@@ -... | null | null | namanjain12/scrapy_final:9f9a2292e08cb0944e1e88e64cef1f4b17486ec8 | true | null | 1 | 14 | null | 987 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.211167 | 80.55225 | ||
8,956 | r2e_gym::train::5803 | r2e_gym | train | 5,803 | tornado__f31750f242f44ebed8559e51caa48eef0b9796ac | tornado | tornadoweb/tornado | python | f31750f242f44ebed8559e51caa48eef0b9796ac | **Title:** AttributeError When Checking if a Function is a Coroutine in `tornado.gen`
**Description:**
Attempting to determine whether a function is a coroutine using `tornado.gen.is_coroutine_function` results in an `AttributeError`. This prevents developers from properly introspecting coroutine functions within the ... | diff --git a/docs/gen.rst b/docs/gen.rst
--- a/docs/gen.rst
+++ b/docs/gen.rst
@@ -50,6 +50,8 @@
.. autofunction:: maybe_future
+ .. autofunction:: is_coroutine_function
+
Legacy interface
----------------
diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -273... | 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
@@ -656,6 +656,28 @@
def tearDown(self):
super(GenCoroutineTest, self).tearDown()
assert self.finished
+
+ def test_attributes(self):
+ self.finished = True
+
+... | null | null | namanjain12/tornado_final:f31750f242f44ebed8559e51caa48eef0b9796ac | true | null | 2 | 15 | null | 967 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.211167 | 80.55225 | ||
8,957 | r2e_gym::train::5625 | r2e_gym | train | 5,625 | scrapy__66cbceeb0a9104fc0fa238898e38d0d9ce9cbcf6 | scrapy | scrapy/scrapy | python | 66cbceeb0a9104fc0fa238898e38d0d9ce9cbcf6 | **Title:** Incorrect URL Construction for Redirects with Location Header Starting with Multiple Slashes
**Description:**
When the `Location` header in a redirect response begins with multiple slashes (`///`), the middleware incorrectly constructs the redirected URL by appending it to the original domain. This results ... | diff --git a/scrapy/downloadermiddlewares/redirect.py b/scrapy/downloadermiddlewares/redirect.py
--- a/scrapy/downloadermiddlewares/redirect.py
+++ b/scrapy/downloadermiddlewares/redirect.py
@@ -1,5 +1,5 @@
import logging
-from six.moves.urllib.parse import urljoin
+from six.moves.urllib.parse import urljoin, urlparse... | diff --git a/tests/test_downloadermiddleware_redirect.py b/tests/test_downloadermiddleware_redirect.py
--- a/tests/test_downloadermiddleware_redirect.py
+++ b/tests/test_downloadermiddleware_redirect.py
@@ -100,6 +100,22 @@
req2 = self.mw.process_response(req, rsp, self.spider)
assert isinstance(req2,... | null | null | namanjain12/scrapy_final:66cbceeb0a9104fc0fa238898e38d0d9ce9cbcf6 | true | null | 1 | 7 | null | 1,127 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.211167 | 80.55225 | ||
8,958 | r2e_gym::train::6011 | r2e_gym | train | 6,011 | tornado__b2091c407a4483da9dfa8852e080668c0440f428 | tornado | tornadoweb/tornado | python | b2091c407a4483da9dfa8852e080668c0440f428 | **Title:** Exception `__context__` Leaks in Coroutines Causing Unintended Nested Exceptions in Python 3
**Description:**
When handling exceptions within coroutines in Python 3, the raised exceptions retain an unintended `__context__`. This leads to unexpected nested exceptions, making it harder to debug and understand... | diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -824,13 +824,20 @@
self.future = None
try:
orig_stack_contexts = stack_context._state.contexts
+ exc_info = None
+
try:
... | 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
@@ -844,6 +844,29 @@
yield gen.sleep(0.01)
self.finished = True
+ @skipBefore33
+ @gen_test
+ def test_py3_leak_exception_context(self):
+ class LeakedExcept... | null | null | namanjain12/tornado_final:b2091c407a4483da9dfa8852e080668c0440f428 | true | null | 1 | 9 | null | 1,086 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.211 | 80.55175 | ||
8,959 | r2e_gym::train::5973 | r2e_gym | train | 5,973 | tornado__de39a398fb556c8c30b4c431b16974e0ca35e22d | tornado | tornadoweb/tornado | python | de39a398fb556c8c30b4c431b16974e0ca35e22d | **Title: TwistedResolver Fails to Raise Exceptions for Invalid Hostnames, Causing Timeouts**
**Description:**
When attempting to resolve a hostname that does not exist, the `TwistedResolver` fails to properly handle the error. Instead of raising an exception, the resolver operation times out after 5 seconds. This pre... | diff --git a/tornado/platform/twisted.py b/tornado/platform/twisted.py
--- a/tornado/platform/twisted.py
+++ b/tornado/platform/twisted.py
@@ -527,8 +527,10 @@
resolved_family = socket.AF_INET6
else:
deferred = self.resolver.getHostByName(utf8(host))
- resolved = yield gen.... | 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
@@ -7,6 +7,7 @@
import time
from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip
+from tornado.stack_context import ExceptionStackContext
from tornad... | null | null | namanjain12/tornado_final:de39a398fb556c8c30b4c431b16974e0ca35e22d | true | null | 1 | 6 | null | 1,145 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.210833 | 80.55125 | ||
8,960 | r2e_gym::train::5163 | r2e_gym | train | 5,163 | pyramid__bff4d2b605c92fe2e6282861429ffc8e24c53796 | pyramid | pylons/pyramid | python | bff4d2b605c92fe2e6282861429ffc8e24c53796 | **Title:** `get_renderer` Fails with TypeError When `registry` Argument Is Provided
**Description:**
When attempting to retrieve a renderer with a specific registry, providing the `registry` argument to the `get_renderer` function results in a TypeError. This prevents the use of a custom registry when obtaining render... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -56,6 +56,10 @@
- Add support for Python 3.7. Add testing on Python 3.8 with allowed failures.
See https://github.com/Pylons/pyramid/pull/3333
+
+- Add a ``registry`` argument to ``pyramid.renderers.get_renderer``
+ to allow users to a... | 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,20 @@
result = self._callFUT('abc/def.pt', package=pyramid.tests)
self.assertEqual(result, renderer)
+ def test_it_with_registr... | null | null | namanjain12/pyramid_final:bff4d2b605c92fe2e6282861429ffc8e24c53796 | true | null | 3 | 15 | null | 965 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.210833 | 80.55125 | ||
8,961 | r2e_gym::train::6061 | r2e_gym | train | 6,061 | pillow__fee6bafead4683f5a7d2752339165c699ac907df | pillow | python-pillow/pillow | python | fee6bafead4683f5a7d2752339165c699ac907df | **Title:** Opening Extremely Large BMP Images Raises OSError Instead of DecompressionBombError
**Description:**
When attempting to open a BMP image with extremely large dimensions, an `OSError` is raised indicating the BMP size is unsupported. This behavior is inconsistent with how other image formats handle potential... | diff --git a/docs/releasenotes/8.0.0.rst b/docs/releasenotes/8.0.0.rst
--- a/docs/releasenotes/8.0.0.rst
+++ b/docs/releasenotes/8.0.0.rst
@@ -86,15 +86,11 @@
For example ``draw.regular_polygon(((100, 100), 50), 5)``
draws a pentagon centered at the point ``(100, 100)`` with a polygon radius of ``50``.
-Security
-=... | diff --git a/Tests/test_decompression_bomb.py b/Tests/test_decompression_bomb.py
--- a/Tests/test_decompression_bomb.py
+++ b/Tests/test_decompression_bomb.py
@@ -60,6 +60,10 @@
with pytest.raises(Image.DecompressionBombError):
Image.open("Tests/images/decompression_bomb.gif")
+ def test_exce... | null | null | namanjain12/pillow_final:fee6bafead4683f5a7d2752339165c699ac907df | true | null | 2 | 16 | null | 945 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.210833 | 80.55125 | ||
8,962 | r2e_gym::train::480 | r2e_gym | train | 480 | orange3__15baede0c89aceea836156b86b2ade646bd29c68 | orange3 | biolab/orange3 | python | 15baede0c89aceea836156b86b2ade646bd29c68 | **Title**: Parameter Fitter raises TypeError when provided with classless data
**Description**:
When using the Parameter Fitter with a classification learner and supplying data that lacks class variables, the tool crashes with an unhandled `TypeError` instead of displaying a meaningful error message.
**Example Code*... | diff --git a/Orange/widgets/evaluate/owparameterfitter.py b/Orange/widgets/evaluate/owparameterfitter.py
--- a/Orange/widgets/evaluate/owparameterfitter.py
+++ b/Orange/widgets/evaluate/owparameterfitter.py
@@ -335,6 +335,7 @@
incompatible_learner = Msg("{}")
manual_steps_error = Msg("Invalid values f... | diff --git a/Orange/widgets/evaluate/tests/test_owparameterfitter.py b/Orange/widgets/evaluate/tests/test_owparameterfitter.py
--- a/Orange/widgets/evaluate/tests/test_owparameterfitter.py
+++ b/Orange/widgets/evaluate/tests/test_owparameterfitter.py
@@ -9,7 +9,7 @@
from AnyQt.QtWidgets import QToolTip
from Orange.... | null | null | namanjain12/orange3_final:15baede0c89aceea836156b86b2ade646bd29c68 | true | null | 1 | 6 | null | 1,144 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.210667 | 80.55075 | ||
8,963 | r2e_gym::train::186 | r2e_gym | train | 186 | orange3__6cce7c50277af9c0eedd2c934bed609071de18b4 | orange3 | biolab/orange3 | python | 6cce7c50277af9c0eedd2c934bed609071de18b4 | **Title:** Description Formatting Fails for Large Tables Due to Missing Frequency Calculations
**Description:**
When generating descriptions for large tables, the system attempts to calculate the frequency of missing values regardless of the table size. This leads to errors and incorrect summaries when handling datase... | diff --git a/Orange/widgets/data/owfile.py b/Orange/widgets/data/owfile.py
--- a/Orange/widgets/data/owfile.py
+++ b/Orange/widgets/data/owfile.py
@@ -525,8 +525,10 @@
text += f"<p>{len(table)} {pl(len(table), 'instance')}"
- missing_in_attr = missing_prop(table.get_nan_frequency_attribute())
- ... | diff --git a/Orange/widgets/data/tests/test_owfile.py b/Orange/widgets/data/tests/test_owfile.py
--- a/Orange/widgets/data/tests/test_owfile.py
+++ b/Orange/widgets/data/tests/test_owfile.py
@@ -75,6 +75,23 @@
def tearDown(self):
dataset_dirs.pop()
+
+ def test_describe(self):
+ table = Table(... | null | null | namanjain12/orange3_final:6cce7c50277af9c0eedd2c934bed609071de18b4 | true | null | 2 | 13 | null | 1,003 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2105 | 80.55025 | ||
8,964 | r2e_gym::train::70 | r2e_gym | train | 70 | orange3__945e235a69847d01e4c8f2800da36f29ec0a4ea4 | orange3 | biolab/orange3 | python | 945e235a69847d01e4c8f2800da36f29ec0a4ea4 | **Title:** Selecting Rows Fails When Time Variable is in Metas
**Description:**
When using the Select Rows widget with a time variable included in the metadata, the widget fails to apply the selection criteria and raises an error.
**Example Code:**
```python
from Orange.data import Table, Domain, TimeVariable
# Crea... | diff --git a/Orange/widgets/data/owselectrows.py b/Orange/widgets/data/owselectrows.py
--- a/Orange/widgets/data/owselectrows.py
+++ b/Orange/widgets/data/owselectrows.py
@@ -554,7 +554,7 @@
invalidate_datetime()
datetime_format = (var.have_date, var.have_time)
- c... | diff --git a/Orange/widgets/data/tests/test_owselectrows.py b/Orange/widgets/data/tests/test_owselectrows.py
--- a/Orange/widgets/data/tests/test_owselectrows.py
+++ b/Orange/widgets/data/tests/test_owselectrows.py
@@ -10,7 +10,7 @@
from Orange.data import (
Table, Variable, ContinuousVariable, StringVariable, ... | null | null | namanjain12/orange3_final:945e235a69847d01e4c8f2800da36f29ec0a4ea4 | true | null | 1 | 7 | null | 1,123 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2105 | 80.55025 | ||
8,965 | r2e_gym::train::4581 | r2e_gym | train | 4,581 | numpy__20d2f8216a5384419f4b609772f4691fabb2cebf | numpy | numpy/numpy | python | 20d2f8216a5384419f4b609772f4691fabb2cebf | **Title:** TypeError When Accessing `dtype.name` for NEP 42 DTypes with `type=None`
**Description:**
When working with NEP 42 custom dtypes in NumPy, accessing the `name` attribute can raise a `TypeError` if the dtype's `type` is `None`. This issue occurs because the code attempts to use `issubclass()` on `dtype.type`... | diff --git a/numpy/core/_dtype.py b/numpy/core/_dtype.py
--- a/numpy/core/_dtype.py
+++ b/numpy/core/_dtype.py
@@ -334,6 +334,8 @@
elif dtype.type == np.bool_:
# implied
return False
+ elif dtype.type is None:
+ return True
elif np.issubdtype(dtype, np.flexible) and _isunsized(dtyp... | diff --git a/numpy/core/tests/test_custom_dtypes.py b/numpy/core/tests/test_custom_dtypes.py
--- a/numpy/core/tests/test_custom_dtypes.py
+++ b/numpy/core/tests/test_custom_dtypes.py
@@ -45,6 +45,9 @@
# Check the repr, mainly to cover the code paths:
assert repr(SF(scaling=1.)) == "_ScaledFloatTestDTy... | null | null | namanjain12/numpy_final:20d2f8216a5384419f4b609772f4691fabb2cebf | true | null | 1 | 6 | null | 1,143 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2105 | 80.55025 | ||
8,966 | r2e_gym::train::5099 | r2e_gym | train | 5,099 | pyramid__ea1f05799cab69881b0bef292033965abfdb16cb | pyramid | pylons/pyramid | python | ea1f05799cab69881b0bef292033965abfdb16cb | **Title:** `get_appsettings` Raises TypeError When Supplying Options Argument
**Description:**
When providing an `options` dictionary to the `get_appsettings` function, a `TypeError` is thrown because the function does not accept the additional argument.
**Example Code:**
```python
config_file = '/foo/bar/myapp.ini'... | 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:ea1f05799cab69881b0bef292033965abfdb16cb | true | null | 3 | 25 | null | 760 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.21 | 80.54875 | ||
8,967 | r2e_gym::train::4598 | r2e_gym | train | 4,598 | numpy__b3c0960a54c81a26bd07912dda96db9e356b34d1 | numpy | numpy/numpy | python | b3c0960a54c81a26bd07912dda96db9e356b34d1 | **Title:** `np.percentile` and `np.quantile` Do Not Raise Error for Complex Number Inputs
**Description:**
When using `np.percentile` or `np.quantile` with arrays containing complex numbers, the functions process the data without raising any errors. Since these statistical functions are intended for real numbers, acce... | 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
@@ -3934,7 +3934,7 @@
Parameters
----------
- a : array_like
+ a : array_like of real numbers
Input array or object that can be converted to an array.
q ... | 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
@@ -2973,6 +2973,14 @@
o = np.ones((1,))
np.percentile(d, 5, None, o, False, 'linear')
+ def test_complex(self):
+ ... | null | null | namanjain12/numpy_final:b3c0960a54c81a26bd07912dda96db9e356b34d1 | true | null | 2 | 20 | null | 859 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.209833 | 80.54825 | ||
8,968 | r2e_gym::train::4394 | r2e_gym | train | 4,394 | numpy__a4e47e0205b78eb96248e71918c2558e25a9d3c7 | numpy | numpy/numpy | python | a4e47e0205b78eb96248e71918c2558e25a9d3c7 | **[ISSUE]**
**Title:** `np.eye()` Throws TypeError When Using `order` Keyword Argument
**Description:**
When trying to specify the memory layout of the array created by `np.eye()` using the `order` keyword, a `TypeError` is raised because the function does not recognize the `order` argument.
**Example Code:**
```py... | diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -137,7 +137,7 @@
return m[::-1, ...]
-def eye(N, M=None, k=0, dtype=float):
+def eye(N, M=None, k=0, dtype=float, order='C'):
"""
Return a 2-D array with ones on the diago... | diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -94,6 +94,15 @@
def test_bool(self):
assert_equal(eye(2, 2, dtype=bool), [[True, False], [False, True]])
+
+ def test_order(sel... | null | null | namanjain12/numpy_final:a4e47e0205b78eb96248e71918c2558e25a9d3c7 | true | null | 2 | 18 | null | 899 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.209833 | 80.54825 | ||
8,969 | r2e_gym::train::5447 | r2e_gym | train | 5,447 | aiohttp__98e3a9181d7b3264d7ebd7955a01ba9a08df9dc3 | aiohttp | aio-libs/aiohttp | python | 98e3a9181d7b3264d7ebd7955a01ba9a08df9dc3 | **Title:** Unable to Register Route Names with Dots and Colons
**Description:**
When trying to register a route with a name that includes dots and colons to separate multiple identifiers, a `ValueError` is raised incorrectly.
**Example Code:**
```python
handler = make_handler()
route = PlainRoute('GET', handler, 't... | diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py
--- a/aiohttp/web_urldispatcher.py
+++ b/aiohttp/web_urldispatcher.py
@@ -389,6 +389,7 @@
r'^\{(?P<var>[a-zA-Z][_a-zA-Z0-9]*):(?P<re>.+)\}$')
GOOD = r'[^{}/]+'
ROUTE_RE = re.compile(r'(\{[_a-zA-Z][^{}]*(?:\{[^{}]*\}[^{}]*)*\})')... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -83,6 +83,10 @@
route = PlainRoute('GET', handler, 'return', '/handler/to/path')
self.assertRaises(ValueError, self.router.register_route, route)
+ route = Pla... | null | null | namanjain12/aiohttp_final:98e3a9181d7b3264d7ebd7955a01ba9a08df9dc3 | true | null | 1 | 16 | null | 939 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.209833 | 80.54825 | ||
8,970 | r2e_gym::train::5471 | r2e_gym | train | 5,471 | aiohttp__d7802fe2e48bd7b1f70c8d66786ad125305eaa24 | aiohttp | aio-libs/aiohttp | python | d7802fe2e48bd7b1f70c8d66786ad125305eaa24 | **Title:** HTTPUnavailableForLegalReasons exception fails when 'link' argument is None or empty
**Description:**
When initializing the `HTTPUnavailableForLegalReasons` exception without providing the `link` argument or by setting it to `None` or an empty string, the system raises errors instead of handling these cases... | diff --git a/CHANGES/7689.feature b/CHANGES/7689.feature
--- a/CHANGES/7689.feature
+++ b/CHANGES/7689.feature
@@ -0,0 +1 @@
+Allow ``link`` argument to be set to None/empty in HTTP 451 exception.
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -145,6 +145,7 @@
Hu Bo
... | diff --git a/tests/test_web_exceptions.py b/tests/test_web_exceptions.py
--- a/tests/test_web_exceptions.py
+++ b/tests/test_web_exceptions.py
@@ -312,23 +312,51 @@
class TestHTTPUnavailableForLegalReasons:
def test_ctor(self) -> None:
- resp = web.HTTPUnavailableForLegalReasons(
+ exc = web.HTTPU... | null | null | namanjain12/aiohttp_final:d7802fe2e48bd7b1f70c8d66786ad125305eaa24 | true | null | 4 | 39 | null | 1,190 | 0 | 0.75 | 1 | 0.75 | 0.85 | 0.328333 | 80.5475 | ||
8,971 | r2e_gym::train::6168 | r2e_gym | train | 6,168 | pillow__794e9f0f0e85535e6bd1791e2ec127dec345f319 | pillow | python-pillow/pillow | python | 794e9f0f0e85535e6bd1791e2ec127dec345f319 | **Title:** Setting EXIF X-Resolution Causes TypeError During Image Save
**Description:**
When attempting to set the EXIF `XResolution` to an integer value and save the image, a `TypeError` is raised unexpectedly. This issue occurs even though the `XResolution` should accept integer values and handle them correctly dur... | diff --git a/src/PIL/Image.py b/src/PIL/Image.py
--- a/src/PIL/Image.py
+++ b/src/PIL/Image.py
@@ -3248,7 +3248,7 @@
def _fixup(self, value):
try:
- if len(value) == 1 and not isinstance(value, dict):
+ if len(value) == 1 and isinstance(value, tuple):
return value[... | 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
@@ -219,7 +219,7 @@
gps_index = 34853
expected_exif_gps = {
0: b"\x00\x00\x00\x01",
- 2: (4294967295, 1),
+ 2: 4294967295,
... | null | null | namanjain12/pillow_final:794e9f0f0e85535e6bd1791e2ec127dec345f319 | true | null | 1 | 6 | null | 1,137 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2095 | 80.54725 | ||
8,972 | r2e_gym::train::5144 | r2e_gym | train | 5,144 | pyramid__40d71e805bfcf8522c6af71995c05c496f1c4b4f | pyramid | pylons/pyramid | python | 40d71e805bfcf8522c6af71995c05c496f1c4b4f | **Title:** HTTPException `__str__` Method Returns Non-String When `detail` Is Not a String
**Description:**
When an `HTTPException` is instantiated with a `detail` that is not a string (e.g., a dictionary), invoking `str()` on the exception returns the `detail` object directly instead of a string representation. This ... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,10 @@
Bug Fixes
---------
+- HTTPException's accepts a detail kwarg that may be used to pass additional
+ details to the exception. You may now pass objects so long as they have a
+ valid __str__ method. See https://github.com/P... | diff --git a/pyramid/tests/test_httpexceptions.py b/pyramid/tests/test_httpexceptions.py
--- a/pyramid/tests/test_httpexceptions.py
+++ b/pyramid/tests/test_httpexceptions.py
@@ -2,6 +2,7 @@
from pyramid.compat import (
bytes_,
+ string_types,
text_,
)
@@ -363,6 +364,11 @@
start_response... | null | null | namanjain12/pyramid_final:40d71e805bfcf8522c6af71995c05c496f1c4b4f | true | null | 2 | 6 | null | 1,135 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.209167 | 80.54625 | ||
8,973 | r2e_gym::train::4748 | r2e_gym | train | 4,748 | numpy__6f009fce15e7bea11c31c871170a37071761eac4 | numpy | numpy/numpy | python | 6f009fce15e7bea11c31c871170a37071761eac4 | **Title:** Unclear ValueError when using `stat_length=0` with 'minimum' or 'maximum' padding modes
**Description:**
When attempting to pad an array using the 'minimum' or 'maximum' mode with `stat_length` set to 0, an unclear `ValueError` is raised. The error message does not provide a helpful explanation of the issue... | diff --git a/numpy/lib/arraypad.py b/numpy/lib/arraypad.py
--- a/numpy/lib/arraypad.py
+++ b/numpy/lib/arraypad.py
@@ -323,6 +323,12 @@
if right_length is None or max_length < right_length:
right_length = max_length
+ if (left_length == 0 or right_length == 0) \
+ and stat_func in {np.amax... | diff --git a/numpy/lib/tests/test_arraypad.py b/numpy/lib/tests/test_arraypad.py
--- a/numpy/lib/tests/test_arraypad.py
+++ b/numpy/lib/tests/test_arraypad.py
@@ -468,6 +468,29 @@
[21, 21, 21, 20, 21, 22, 23, 24, 23, 23]]
)
assert_array_equal(a, b)
+
+ @pytest.mark.filterwarnings(... | null | null | namanjain12/numpy_final:6f009fce15e7bea11c31c871170a37071761eac4 | true | null | 1 | 9 | null | 1,074 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.209 | 80.54575 | ||
8,974 | r2e_gym::train::6187 | r2e_gym | train | 6,187 | pillow__8531b01d6cdf0b70f256f93092caa2a5d91afc11 | pillow | python-pillow/pillow | python | 8531b01d6cdf0b70f256f93092caa2a5d91afc11 | **Title:** ImageMath.eval Allows Execution of Unauthorized Built-ins, Enabling Code Injection
**Description:**
The `ImageMath.eval` function previously permitted the use of arbitrary built-in functions, which poses a security risk by allowing the execution of unauthorized code. For example, evaluating an expression wi... | diff --git a/docs/releasenotes/9.0.0.rst b/docs/releasenotes/9.0.0.rst
--- a/docs/releasenotes/9.0.0.rst
+++ b/docs/releasenotes/9.0.0.rst
@@ -116,6 +116,14 @@
duplicate tiles that only differ by their offset, only load the last tile. Credit to
Google's `OSS-Fuzz`_ project for finding this issue.
+Restrict builtins... | diff --git a/Tests/test_imagemath.py b/Tests/test_imagemath.py
--- a/Tests/test_imagemath.py
+++ b/Tests/test_imagemath.py
@@ -1,3 +1,5 @@
+import pytest
+
from PIL import Image, ImageMath
@@ -48,6 +50,11 @@
assert pixel(ImageMath.eval("float(A)/B", images)) == "F 0.5"
assert pixel(ImageMath.eval("float(... | null | null | namanjain12/pillow_final:8531b01d6cdf0b70f256f93092caa2a5d91afc11 | true | null | 2 | 15 | null | 952 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.208667 | 80.54475 | ||
8,975 | r2e_gym::train::5729 | r2e_gym | train | 5,729 | scrapy__73668ce4076b87d2d2493f2c9b445c643da9055a | scrapy | scrapy/scrapy | python | 73668ce4076b87d2d2493f2c9b445c643da9055a | **Title:** FormRequest.from_response Includes Fields with `None` Values, Causing TypeError
**Description:**
When using `FormRequest.from_response` with `formdata` that contains fields set to `None`, the field is still included in the form data. This results in a `TypeError` during the request processing because `to_by... | diff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rst
--- a/docs/topics/request-response.rst
+++ b/docs/topics/request-response.rst
@@ -417,7 +417,9 @@
:param formdata: fields to override in the form data. If a field was
already present in the response ``<form>`` element,... | diff --git a/tests/test_http_request.py b/tests/test_http_request.py
--- a/tests/test_http_request.py
+++ b/tests/test_http_request.py
@@ -424,6 +424,17 @@
fs = _qs(req)
self.assertEqual(fs[b'one'], [b'1'])
self.assertEqual(fs[b'two'], [b'2'])
+
+ def test_from_response_drop_params(self):
... | null | null | namanjain12/scrapy_final:73668ce4076b87d2d2493f2c9b445c643da9055a | true | null | 2 | 6 | null | 1,132 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.208667 | 80.54475 | ||
8,976 | r2e_gym::train::4822 | r2e_gym | train | 4,822 | numpy__5b22ee427e17706e3b765cf6c65e924d89f3bfce | numpy | numpy/numpy | python | 5b22ee427e17706e3b765cf6c65e924d89f3bfce | **Title:** Using `@np.errstate` as a decorator raises TypeError
**Description:**
When attempting to use `@np.errstate(all='ignore')` as a decorator for a function, a `TypeError` is raised indicating that the `'errstate' object is not callable`.
**Example Code:**
```python
import numpy as np
@np.errstate(all='ignore'... | 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
@@ -81,6 +81,27 @@
array types, including structures, booleans, and integers of non-native
endianness.
+`numpy.errstate` is now also function decorator
+--------------------... | diff --git a/numpy/core/tests/test_errstate.py b/numpy/core/tests/test_errstate.py
--- a/numpy/core/tests/test_errstate.py
+++ b/numpy/core/tests/test_errstate.py
@@ -39,3 +39,11 @@
with np.errstate(call=None):
assert_(np.geterrcall() is None, 'call is not None')
assert_(np.geterr... | null | null | namanjain12/numpy_final:5b22ee427e17706e3b765cf6c65e924d89f3bfce | true | null | 2 | 31 | null | 632 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.208667 | 80.54475 | ||
8,977 | r2e_gym::train::5267 | r2e_gym | train | 5,267 | aiohttp__ea948a4a984d2db4fceb42e6706f87e21cfea6a5 | aiohttp | aio-libs/aiohttp | python | ea948a4a984d2db4fceb42e6706f87e21cfea6a5 | **Title:** `MultiDict.getall() does not accept a default value, raising TypeError when provided`
**Description:**
When using the `getall` method on a `MultiDict` instance, providing a default value for a non-existent key results in a `TypeError`. The method currently only accepts the key as an argument, which causes i... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,11 @@
CHANGES
=======
+
+0.8.1 (unreleased)
+------------------
+
+- MultiDict.getall() accepts default value.
+
0.8.0 (06-06-2014)
------------------
diff --git a/aiohttp/multidict.py b/aiohttp/multidict.py
--- a/aiohttp/multid... | diff --git a/tests/test_multidict.py b/tests/test_multidict.py
--- a/tests/test_multidict.py
+++ b/tests/test_multidict.py
@@ -129,6 +129,9 @@
with self.assertRaisesRegex(KeyError, "some_key"):
d.getall('some_key')
+
+ default = object()
+ self.assertIs(d.getall('some_key', default... | null | null | namanjain12/aiohttp_final:ea948a4a984d2db4fceb42e6706f87e21cfea6a5 | true | null | 2 | 18 | null | 892 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.208667 | 80.54475 | ||
8,978 | r2e_gym::train::5889 | r2e_gym | train | 5,889 | tornado__a86d3c774603c56a7f98c577da3694b777fcd10d | tornado | tornadoweb/tornado | python | a86d3c774603c56a7f98c577da3694b777fcd10d | **Title:** Unable to Pass `asyncio_loop` Argument to `AsyncIOLoop`, Results in TypeError
**Description:**
When attempting to explicitly pass an `asyncio` event loop to `AsyncIOLoop`, a `TypeError` is raised instead of properly initializing the loop.
**Example Code:**
```python
import asyncio
from tornado.platform.asy... | diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py
--- a/tornado/platform/asyncio.py
+++ b/tornado/platform/asyncio.py
@@ -310,6 +310,12 @@
Each ``AsyncIOLoop`` creates a new ``asyncio.EventLoop``; this object
can be accessed with the ``asyncio_loop`` attribute.
+ .. versionchanged:: ... | 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
@@ -1,3 +1,4 @@
+import asyncio
from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
from collections.abc import Generator
@@ -427,6 +428,12 @@
... | null | null | namanjain12/tornado_final:a86d3c774603c56a7f98c577da3694b777fcd10d | true | null | 1 | 17 | null | 911 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2085 | 80.54425 | ||
8,979 | r2e_gym::train::5055 | r2e_gym | train | 5,055 | datalad__0174e66d85d0fa42d25f1231039a7889ef964237 | datalad | datalad/datalad | python | 0174e66d85d0fa42d25f1231039a7889ef964237 | **Title:** TypeError When Matching Bytes Content with String Regex
**Description:**
When processing authentication failure responses, if the content is received as bytes, using a string-based regular expression leads to a `TypeError`. This occurs because the regex pattern is not compatible with the bytes content, caus... | diff --git a/datalad/downloaders/http.py b/datalad/downloaders/http.py
--- a/datalad/downloaders/http.py
+++ b/datalad/downloaders/http.py
@@ -19,7 +19,11 @@
import io
from time import sleep
-from ..utils import assure_list_from_str, assure_dict_from_str
+from ..utils import (
+ assure_list_from_str,
+ assure... | diff --git a/datalad/downloaders/tests/test_http.py b/datalad/downloaders/tests/test_http.py
--- a/datalad/downloaders/tests/test_http.py
+++ b/datalad/downloaders/tests/test_http.py
@@ -30,6 +30,7 @@
)
from ..http import (
HTMLFormAuthenticator,
+ HTTPBaseAuthenticator,
HTTPDownloader,
HTTPBearerTo... | null | null | namanjain12/datalad_final:0174e66d85d0fa42d25f1231039a7889ef964237 | true | null | 1 | 9 | null | 1,071 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2085 | 80.54425 | ||
8,980 | r2e_gym::train::4943 | r2e_gym | train | 4,943 | datalad__18553cfa239d1e123e23cb7b51550439c3582e0e | datalad | datalad/datalad | python | 18553cfa239d1e123e23cb7b51550439c3582e0e | **Title:** Initialization of `Parameter` Does Not Validate Unknown Keyword Arguments
**Description:**
When creating a `Parameter` instance with an undefined keyword argument, the system fails to raise an immediate error. This oversight allows misspecified parameters to pass through, potentially leading to unexpected b... | diff --git a/datalad/support/param.py b/datalad/support/param.py
--- a/datalad/support/param.py
+++ b/datalad/support/param.py
@@ -12,6 +12,9 @@
import re
import textwrap
+import argparse
+from inspect import getargspec
+
from .constraints import expand_contraint_spec
_whitespace_re = re.compile('\n\s+|^\s+')
@... | diff --git a/datalad/tests/test_interface.py b/datalad/tests/test_interface.py
--- a/datalad/tests/test_interface.py
+++ b/datalad/tests/test_interface.py
@@ -18,6 +18,7 @@
from ..utils import swallow_outputs
from .utils import assert_re_in
+from .utils import assert_in
class Demo(Interface):
@@ -66,6 +67,11 @... | null | null | namanjain12/datalad_final:18553cfa239d1e123e23cb7b51550439c3582e0e | true | null | 1 | 18 | null | 890 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.208333 | 80.54375 | ||
8,981 | r2e_gym::train::6439 | r2e_gym | train | 6,439 | pillow__dd46100bdc7fbb6c2fb71008a49c40f081eb0c7c | pillow | python-pillow/pillow | python | dd46100bdc7fbb6c2fb71008a49c40f081eb0c7c | **Title:** `ImageMath.eval` Allows Disallowed Builtins Within Lambda Expressions
**Description:**
When using `ImageMath.eval` with expressions that include disallowed built-in functions inside lambda expressions, it does not raise an error as expected. This can potentially allow unsafe operations to be executed.
**Ex... | diff --git a/src/PIL/ImageMath.py b/src/PIL/ImageMath.py
--- a/src/PIL/ImageMath.py
+++ b/src/PIL/ImageMath.py
@@ -240,11 +240,18 @@
if hasattr(v, "im"):
args[k] = _Operand(v)
- code = compile(expression, "<string>", "eval")
- for name in code.co_names:
- if name not in args and nam... | diff --git a/Tests/test_imagemath.py b/Tests/test_imagemath.py
--- a/Tests/test_imagemath.py
+++ b/Tests/test_imagemath.py
@@ -52,9 +52,17 @@
assert pixel(ImageMath.eval("float(B)**33", images)) == "F 8589934592.0"
-def test_prevent_exec():
+@pytest.mark.parametrize(
+ "expression",
+ (
+ "exec('p... | null | null | namanjain12/pillow_final:dd46100bdc7fbb6c2fb71008a49c40f081eb0c7c | true | null | 1 | 17 | null | 910 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.208333 | 80.54375 | ||
8,982 | r2e_gym::train::6648 | r2e_gym | train | 6,648 | pillow__db4916849ec255a9f4312e02dced7b3f893471ea | pillow | python-pillow/pillow | python | db4916849ec255a9f4312e02dced7b3f893471ea | **Title:** `ImageSequence` Module Lacks `all_frames` Function, Causing AttributeError
**Description:**
When attempting to retrieve all frames from an image using the `ImageSequence` module, the `all_frames` function is not available. This results in an `AttributeError`, preventing developers from easily accessing all ... | diff --git a/src/PIL/ImageSequence.py b/src/PIL/ImageSequence.py
--- a/src/PIL/ImageSequence.py
+++ b/src/PIL/ImageSequence.py
@@ -54,3 +54,25 @@
def next(self):
return self.__next__()
+
+
+def all_frames(im, func=None):
+ """
+ Applies a given function to all frames in an image or a list of image... | diff --git a/Tests/test_imagesequence.py b/Tests/test_imagesequence.py
--- a/Tests/test_imagesequence.py
+++ b/Tests/test_imagesequence.py
@@ -74,3 +74,25 @@
im.seek(0)
color2 = im.getpalette()[0:3]
self.assertEqual(color1, color2)
+
+ def test_all_frames(self):
+ # Test a single im... | null | null | namanjain12/pillow_final:db4916849ec255a9f4312e02dced7b3f893471ea | true | null | 1 | 22 | null | 807 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.207833 | 80.54225 | ||
8,983 | r2e_gym::train::6077 | r2e_gym | train | 6,077 | pillow__f34360d1e3c8f29f1a0b0ccae62b5f7c95700440 | pillow | python-pillow/pillow | python | f34360d1e3c8f29f1a0b0ccae62b5f7c95700440 | ### Error When Saving Multiple PNG Frames with Specified Bit Depth
**Description**
When attempting to save multiple frames in PNG format with a specified bit depth, a `ValueError` is raised, preventing the save operation from completing successfully.
**Example Code**
```python
from PIL import Image, ImageSequence
... | diff --git a/src/PIL/PngImagePlugin.py b/src/PIL/PngImagePlugin.py
--- a/src/PIL/PngImagePlugin.py
+++ b/src/PIL/PngImagePlugin.py
@@ -1104,7 +1104,7 @@
self.seq_num += 1
-def _write_multiple_frames(im, fp, chunk, rawmode, default_image, append_images):
+def _write_multiple_frames(im, fp, chunk, mode, rawm... | diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py
--- a/Tests/test_file_png.py
+++ b/Tests/test_file_png.py
@@ -655,11 +655,12 @@
png.call(cid, 0, 0)
ImageFile.LOAD_TRUNCATED_IMAGES = False
- def test_specify_bits(self, tmp_path: Path) -> None:
+ @pytest.mark.parametrize("sa... | null | null | namanjain12/pillow_final:f34360d1e3c8f29f1a0b0ccae62b5f7c95700440 | true | null | 1 | 17 | null | 906 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.207667 | 80.54175 | ||
8,984 | r2e_gym::train::4257 | r2e_gym | train | 4,257 | numpy__0e65b7166a6265a2047cb3ca47f487f3de19f0a6 | numpy | numpy/numpy | python | 0e65b7166a6265a2047cb3ca47f487f3de19f0a6 | **Title:** `np.piecewise` Raises ValueError with Multiple Conditions and Multidimensional Inputs
**Description:**
When using `np.piecewise` with multiple conditions, especially on multidimensional arrays or with scalar domains and three conditions, the function raises a `ValueError` instead of correctly evaluating the... | diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -944,11 +944,15 @@
condlist = condlist.T
if n == n2 - 1: # compute the "otherwise" condition.
totlist = np.logical_or.reduce(condlist, axis=0)
- co... | diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -1862,6 +1862,10 @@
x = piecewise([1, 2], [[True, False], [False, True]], [3, 4])
assert_array_equal(x, [3, 4])
+ d... | null | null | namanjain12/numpy_final:0e65b7166a6265a2047cb3ca47f487f3de19f0a6 | true | null | 1 | 12 | null | 1,005 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2075 | 80.54125 | ||
8,985 | r2e_gym::train::5405 | r2e_gym | train | 5,405 | aiohttp__274c54e46c11e6f527326a3574eb984f90e0f740 | aiohttp | aio-libs/aiohttp | python | 274c54e46c11e6f527326a3574eb984f90e0f740 | **Title:** WebSocket connection terminates abnormally when receiving messages during close timeout
**Description:**
When the server initiates the closure of a WebSocket connection, any non-close messages sent by the client within the close timeout window cause the connection to terminate with an abnormal closure code.... | diff --git a/CHANGES/9506.bugfix.rst b/CHANGES/9506.bugfix.rst
--- a/CHANGES/9506.bugfix.rst
+++ b/CHANGES/9506.bugfix.rst
@@ -0,0 +1 @@
+Fixed :py:meth:`WebSocketResponse.close() <aiohttp.web.WebSocketResponse.close>` to discard non-close messages within its timeout window after sending close -- by :user:`lenard-mosys... | diff --git a/tests/test_web_websocket_functional.py b/tests/test_web_websocket_functional.py
--- a/tests/test_web_websocket_functional.py
+++ b/tests/test_web_websocket_functional.py
@@ -1243,7 +1243,11 @@
"""Test abnormal closure when the server closes and a message is pending."""
async def handler(request... | null | null | namanjain12/aiohttp_final:274c54e46c11e6f527326a3574eb984f90e0f740 | true | null | 3 | 16 | null | 925 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2075 | 80.54125 | ||
8,986 | r2e_gym::train::4702 | r2e_gym | train | 4,702 | numpy__45cb03723b863b0814092631fe9cf17df67add4e | numpy | numpy/numpy | python | 45cb03723b863b0814092631fe9cf17df67add4e | **Title:** `np.ma.masked_invalid` Raises TypeError with Pandas Series-like Objects
**Description:**
When using `np.ma.masked_invalid` with Pandas Series-like objects, a `TypeError` is raised. This occurs because the function internally uses `getdata()`, which is incompatible with certain attributes of the Series, lead... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2310,7 +2310,7 @@
mask=False,
fill_value=2.1)
- Unlike `masked_equal`, `masked_values` can perform approximate equalities.
+ Unlike `masked_equal`, `masked_values` can perform approx... | 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
@@ -4507,6 +4507,20 @@
match="not supported for the input types"):
np.ma.masked_invalid(a)
+ def test_masked_invalid_pandas(self):
+ ... | null | null | namanjain12/numpy_final:45cb03723b863b0814092631fe9cf17df67add4e | true | null | 1 | 10 | null | 1,044 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.207333 | 80.54075 | ||
8,987 | r2e_gym::train::6431 | r2e_gym | train | 6,431 | pillow__33cfac771572384477df0fe682f5f60ffbc31777 | pillow | python-pillow/pillow | python | 33cfac771572384477df0fe682f5f60ffbc31777 | Title: Saving BMP image with excessive size raises struct.error instead of ValueError
**Description**
When attempting to save a BMP image with a file size exceeding the BMP format limit, a low-level `struct.error` is raised instead of a controlled `ValueError`. This unhandled error occurs because the file size exceeds... | diff --git a/src/PIL/BmpImagePlugin.py b/src/PIL/BmpImagePlugin.py
--- a/src/PIL/BmpImagePlugin.py
+++ b/src/PIL/BmpImagePlugin.py
@@ -321,12 +321,15 @@
# bitmap header
if bitmap_header:
offset = 14 + header + colors * 4
+ file_size = offset + image
+ if file_size > 2 ** 32 - 1:
+ ... | diff --git a/Tests/test_file_bmp.py b/Tests/test_file_bmp.py
--- a/Tests/test_file_bmp.py
+++ b/Tests/test_file_bmp.py
@@ -40,6 +40,13 @@
self.assertEqual(im.mode, reloaded.mode)
self.assertEqual(im.size, reloaded.size)
self.assertEqual(reloaded.format, "BMP")
+
+ def test_save... | null | null | namanjain12/pillow_final:33cfac771572384477df0fe682f5f60ffbc31777 | true | null | 1 | 13 | null | 984 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.207333 | 80.54075 | ||
8,988 | r2e_gym::train::465 | r2e_gym | train | 465 | orange3__a45aed7c4a012ac4586cf15efcb1172e0dcff555 | orange3 | biolab/orange3 | python | a45aed7c4a012ac4586cf15efcb1172e0dcff555 | ### Title
AttributeError When Invoking `commit.now()` in FeatureStatistics Widget
### Description
After updating the `FeatureStatistics` widget to use deferred commits, several operations that trigger commits are failing unexpectedly. Specifically, attempts to call `commit.now()` within the widget result in an `Attrib... | diff --git a/Orange/widgets/data/owfeaturestatistics.py b/Orange/widgets/data/owfeaturestatistics.py
--- a/Orange/widgets/data/owfeaturestatistics.py
+++ b/Orange/widgets/data/owfeaturestatistics.py
@@ -805,7 +805,8 @@
self.__restore_sorting()
self.__color_var_changed()
- self.commit()
+ ... | diff --git a/Orange/widgets/data/tests/test_owfeaturestatistics.py b/Orange/widgets/data/tests/test_owfeaturestatistics.py
--- a/Orange/widgets/data/tests/test_owfeaturestatistics.py
+++ b/Orange/widgets/data/tests/test_owfeaturestatistics.py
@@ -335,7 +335,7 @@
# By default, nothing should be sent since auto ... | null | null | namanjain12/orange3_final:a45aed7c4a012ac4586cf15efcb1172e0dcff555 | true | null | 1 | 9 | null | 1,063 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.207167 | 80.54025 | ||
8,989 | r2e_gym::train::5311 | r2e_gym | train | 5,311 | aiohttp__c3789965cdf023d5069d1f04e853a3c6f7a7ab3d | aiohttp | aio-libs/aiohttp | python | c3789965cdf023d5069d1f04e853a3c6f7a7ab3d | **Title:** `StreamResponse.start()` Allows Starting with a Different Request Without Raising an Error
**Description:**
When using the `StreamResponse.start()` method, initiating the response with a different request after it has already been started does not raise an error. This can lead to inconsistent states and une... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -399,6 +399,7 @@
self._cookies = http.cookies.SimpleCookie()
self.set_status(status, reason)
+ self._req = None
self._resp_impl = None
self._eof_sent = False
@@ -526,22 +527,23 @@
... | 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
@@ -106,6 +106,10 @@
self.assertTrue(msg.send_headers.called)
self.assertIs(msg, resp.start(req))
+ req2 = self.make_request('GET', '/')
+ with self.as... | null | null | namanjain12/aiohttp_final:c3789965cdf023d5069d1f04e853a3c6f7a7ab3d | true | null | 1 | 16 | null | 922 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.207 | 80.53975 | ||
8,990 | r2e_gym::train::4059 | r2e_gym | train | 4,059 | coveragepy__e9e703c7885840412295a0aaf3c84b5244483881 | coveragepy | nedbat/coveragepy | python | e9e703c7885840412295a0aaf3c84b5244483881 | **Title:** Missing `current` Method in Coverage Class Causes AttributeError
**Description:**
When attempting to retrieve the current Coverage instance using `Coverage.current()`, an `AttributeError` is raised because the method does not exist in the `Coverage` class.
**Example Buggy Code:**
```python
import coverage
... | diff --git a/CHANGES.rst b/CHANGES.rst
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -31,6 +31,8 @@
- The ``--show-contexts`` option for the ``html`` command adds context
information to each covered line. Hovering over the "ctx" marker at the
end of the line reveals a list of the contexts that covered the line.
... | diff --git a/tests/test_api.py b/tests/test_api.py
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -614,6 +614,37 @@
cov.switch_context("test3")
+class CurrentInstanceTest(CoverageTest):
+ """Tests of Coverage.current()."""
+
+ def assert_current_is_none(self, current):
+ """Assert that... | null | null | namanjain12/coveragepy_final:e9e703c7885840412295a0aaf3c84b5244483881 | true | null | 2 | 17 | null | 900 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.206667 | 80.53875 | ||
8,991 | r2e_gym::train::5718 | r2e_gym | train | 5,718 | scrapy__394b991e3a0891def90473350cff7f61a8532d5e | scrapy | scrapy/scrapy | python | 394b991e3a0891def90473350cff7f61a8532d5e | **Title:** Exporting Items with Non-String Types Causes Serialization Errors
**Description:**
When attempting to export items that include non-string types such as booleans, numbers, and datetime objects, the exporters raise errors instead of handling the serialization correctly.
**Example Buggy Code:**
```python
fro... | diff --git a/scrapy/exporters.py b/scrapy/exporters.py
--- a/scrapy/exporters.py
+++ b/scrapy/exporters.py
@@ -200,7 +200,7 @@
try:
yield to_native_str(s)
except TypeError:
- yield to_native_str(repr(s))
+ yield s
def _write_headers_and_set... | diff --git a/tests/test_exporters.py b/tests/test_exporters.py
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -133,6 +133,19 @@
value = TestItem(name=u'John\xa3', age=u'22')
expected = {b'name': b'John\xc2\xa3', b'age': b'22'}
self.assertEqual(expected, exporter.export_item(va... | null | null | namanjain12/scrapy_final:394b991e3a0891def90473350cff7f61a8532d5e | true | null | 1 | 10 | null | 1,039 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2065 | 80.53825 | ||
8,992 | r2e_gym::train::5849 | r2e_gym | train | 5,849 | tornado__88cfbc2b3446b29f198f64c7b84d70394f5c711e | tornado | tornadoweb/tornado | python | 88cfbc2b3446b29f198f64c7b84d70394f5c711e | **Title:** Header Parsing Fails with Unicode Newline-like Characters in Header Values
**Description:**
When HTTP headers contain unicode characters that resemble newline characters within their values, the header parser incorrectly splits the headers. This leads to malformed headers or runtime errors.
**Example Buggy... | diff --git a/tornado/httputil.py b/tornado/httputil.py
--- a/tornado/httputil.py
+++ b/tornado/httputil.py
@@ -62,6 +62,11 @@
pass
+# RFC 7230 section 3.5: a recipient MAY recognize a single LF as a line
+# terminator and ignore any preceding CR.
+_CRLF_RE = re.compile(r'\r?\n')
+
+
class _NormalizedHeade... | 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
@@ -3,7 +3,7 @@
from __future__ import absolute_import, division, print_function, with_statement
from tornado.httputil import url_concat, parse_multipart_form_data, HTTP... | null | null | namanjain12/tornado_final:88cfbc2b3446b29f198f64c7b84d70394f5c711e | true | null | 1 | 7 | null | 1,098 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.206333 | 80.53775 | ||
8,993 | r2e_gym::train::6436 | r2e_gym | train | 6,436 | pillow__d80610822f62b24677ada2c42fba7f014fb837ed | pillow | python-pillow/pillow | python | d80610822f62b24677ada2c42fba7f014fb837ed | **Title:** Saving JPEG with Large ICC Profile Results in Encoder Error
**Description:**
When attempting to save a JPEG image that contains a large ICC profile, an `OSError` is raised due to insufficient buffer size. This issue occurs specifically when the ICC profile data exceeds the expected buffer capacity, preventi... | diff --git a/src/PIL/JpegImagePlugin.py b/src/PIL/JpegImagePlugin.py
--- a/src/PIL/JpegImagePlugin.py
+++ b/src/PIL/JpegImagePlugin.py
@@ -797,10 +797,14 @@
bufsize = 2 * im.size[0] * im.size[1]
else:
bufsize = im.size[0] * im.size[1]
-
- # The EXIF info needs to be written as one ... | 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
@@ -214,12 +214,19 @@
# Should not raise OSError for image with icc larger than image size.
im.save(
f,
- format="JPEG",
p... | null | null | namanjain12/pillow_final:d80610822f62b24677ada2c42fba7f014fb837ed | true | null | 1 | 12 | null | 998 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.206333 | 80.53775 | ||
8,994 | r2e_gym::train::4764 | r2e_gym | train | 4,764 | numpy__7a05c91277e2e970cccf95c999a7159893b42a92 | numpy | numpy/numpy | python | 7a05c91277e2e970cccf95c999a7159893b42a92 | **Title:** Printing Masked-Void Instances with Object Dtype Fields Raises ValueError
**Description:**
When creating a structured masked array with object dtype fields, attempting to print an element where one of the fields is masked results in a `ValueError`. This issue arises because the assignment involving structur... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5936,7 +5936,14 @@
return self._data.__str__()
printopt = masked_print_option
rdtype = _recursive_make_descr(self._data.dtype, "O")
- res = np.array([self._data]).astype(rdtype)
+
+ ... | 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
@@ -756,6 +756,10 @@
assert_equal(repr(mx[0]), "(1, -X-)")
finally:
masked_print_option.set_display(ini_display)
+
+ # also check if there ... | null | null | namanjain12/numpy_final:7a05c91277e2e970cccf95c999a7159893b42a92 | true | null | 1 | 9 | null | 1,058 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.206333 | 80.53775 | ||
8,995 | r2e_gym::train::5438 | r2e_gym | train | 5,438 | aiohttp__06b23989d9a80da93eddf285960e00a01b078151 | aiohttp | aio-libs/aiohttp | python | 06b23989d9a80da93eddf285960e00a01b078151 | **Title:** Raises ValueError when redirect URL includes credentials alongside AUTH argument
**Description:**
When making a request with authentication and encountering a redirect that contains credentials in the URL, the client raises a `ValueError` instead of properly handling the redirect.
**Example Code:**
```pyth... | diff --git a/CHANGES/9436.bugfix.rst b/CHANGES/9436.bugfix.rst
--- a/CHANGES/9436.bugfix.rst
+++ b/CHANGES/9436.bugfix.rst
@@ -0,0 +1 @@
+Authentication provided by a redirect now takes precedence over provided ``auth`` when making requests with the client -- by :user:`PLPeeters`.
diff --git a/aiohttp/client.py b/aioht... | diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py
--- a/tests/test_client_functional.py
+++ b/tests/test_client_functional.py
@@ -2927,6 +2927,68 @@
await session.close()
+async def test_creds_in_auth_and_redirect_url(
+ create_server_for_url_and_handler: Callable[[URL, Hand... | null | null | namanjain12/aiohttp_final:06b23989d9a80da93eddf285960e00a01b078151 | true | null | 3 | 19 | null | 856 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.206 | 80.53675 | ||
8,996 | r2e_gym::train::5167 | r2e_gym | train | 5,167 | pyramid__95e97113b3fe108a1dbf908ae6716b89e786c91d | pyramid | pylons/pyramid | python | 95e97113b3fe108a1dbf908ae6716b89e786c91d | **Title:** AttributeError When Initializing DefaultRootFactory Without matchdict
**Description:**
When initializing `DefaultRootFactory` with a request that lacks a `matchdict`, an `AttributeError` is raised. This occurs because the factory attempts to access `matchdict` attributes directly during initialization, lead... | diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -98,6 +98,10 @@
since Pyramid 1.1. Use methods of ``request.environ`` (a real dictionary)
instead.
+- Removed ancient backwards compatibily hack in
+ ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of
+ th... | diff --git a/pyramid/tests/test_traversal.py b/pyramid/tests/test_traversal.py
--- a/pyramid/tests/test_traversal.py
+++ b/pyramid/tests/test_traversal.py
@@ -1278,21 +1278,12 @@
def _makeOne(self, environ):
return self._getTargetClass()(environ)
- def test_no_matchdict(self):
- class DummyReq... | null | null | namanjain12/pyramid_final:95e97113b3fe108a1dbf908ae6716b89e786c91d | true | null | 2 | 11 | null | 1,015 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205833 | 80.53625 | ||
8,997 | r2e_gym::train::4739 | r2e_gym | train | 4,739 | numpy__03283c289f6105da70e64948b91efe96700d974e | numpy | numpy/numpy | python | 03283c289f6105da70e64948b91efe96700d974e | **Title:** `tensordot` Raises ValueError with Zero-Length Dimensions Unlike `dot` and `einsum`
**Description:**
When using `numpy.tensordot` with arrays that have zero-length dimensions, it raises a `ValueError` during reshaping. This behavior is inconsistent with `numpy.dot` and `numpy.einsum`, which handle zero-leng... | diff --git a/doc/release/1.14.0-notes.rst b/doc/release/1.14.0-notes.rst
--- a/doc/release/1.14.0-notes.rst
+++ b/doc/release/1.14.0-notes.rst
@@ -27,6 +27,12 @@
Compatibility notes
===================
+
+``np.tensordot`` now returns zero array when contracting over 0-length dimension
+-----------------------------... | 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
@@ -2664,5 +2664,16 @@
assert_raises(TypeError, np.sum, x, keepdims=True)
+class TestTensordot(TestCase):
+
+ def test_zero_dimension(self):
+ ... | null | null | namanjain12/numpy_final:03283c289f6105da70e64948b91efe96700d974e | true | null | 2 | 16 | null | 914 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205667 | 80.53575 | ||
8,998 | r2e_gym::train::4306 | r2e_gym | train | 4,306 | numpy__d699516f58b8a0293081d58a1358734903c0ac1f | numpy | numpy/numpy | python | d699516f58b8a0293081d58a1358734903c0ac1f | **Title:** `numpy.linalg.norm` Raises ValueError When Using `'nuc'` Norm
**Description:**
When attempting to compute the nuclear norm of a matrix using `numpy.linalg.norm` with `ord='nuc'`, the function raises a `ValueError` indicating that the norm order is invalid. The nuclear norm, which is the sum of the singular ... | diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -1352,7 +1352,7 @@
----------
x : (M, N) array_like
The matrix whose condition number is sought.
- p : {None, 1, -1, 2, -2, inf, -inf, 'fro'}, optional
+ p : {None, 1, -1, 2... | diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -837,10 +837,11 @@
array(c, dtype=self.dt)):
_test(v)
- def test_matrix(self):
+ def test_matrix_2x2(self):
... | null | null | namanjain12/numpy_final:d699516f58b8a0293081d58a1358734903c0ac1f | true | null | 1 | 23 | null | 773 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.2055 | 80.53525 | ||
8,999 | r2e_gym::train::4638 | r2e_gym | train | 4,638 | numpy__8888a76c2c8211588b71e19a45a938d73fd0b5f4 | numpy | numpy/numpy | python | 8888a76c2c8211588b71e19a45a938d73fd0b5f4 | **[ISSUE]**
**Title:** Pickling MaskedArray with `dtype=object` Raises TypeError During Unpickling
**Description:**
When attempting to pickle and unpickle a `MaskedArray` with `dtype=object`, a `TypeError` is raised. This prevents the successful serialization of masked arrays containing objects.
**Example Code:**
``... | diff --git a/numpy/ma/core.py b/numpy/ma/core.py
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -5860,17 +5860,8 @@
"""
cf = 'CF'[self.flags.fnc]
- state = (1,
- self.shape,
- self.dtype,
- self.flags.fnc,
- self._data.tobytes(... | 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
@@ -476,13 +476,24 @@
def test_pickling(self):
# Tests pickling
- a = arange(10)
- a[::3] = masked
- a.fill_value = 999
- a_pickled = pic... | null | null | namanjain12/numpy_final:8888a76c2c8211588b71e19a45a938d73fd0b5f4 | true | null | 1 | 13 | null | 972 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.205333 | 80.53475 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.