selection_rank int64 0 10k | uid stringlengths 17 29 | source stringclasses 7
values | split stringclasses 3
values | row_idx int64 0 58.9k | instance_id stringlengths 14 120 | repo stringclasses 246
values | repo_canon stringclasses 232
values | language stringclasses 8
values | base_commit stringlengths 40 40 ⌀ | problem_statement stringlengths 84 23.6k | extra_context stringclasses 626
values | hints stringlengths 0 59.3k | patch stringlengths 252 175k | test_patch stringlengths 0 358k | f2p stringlengths 10 155k ⌀ | p2p stringlengths 2 1.75M ⌀ | env_image stringlengths 41 154 ⌀ | env_available bool 1
class | created_at stringlengths 10 20 ⌀ | n_src_files int64 1 15 | src_lines int64 1 1.48k | n_f2p float64 1 1.87k ⌀ | ps_chars int64 84 23.6k | leak_ratio float64 0 0.6 | s_prior float64 0.6 1 | s_verif float64 0.75 1 | s_ps float64 0.04 1 | s_patch float64 0.07 1 | s_tiebreak float64 0.02 1 | score float64 47.9 98.6 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9,900 | r2e_gym::train::5834 | r2e_gym | train | 5,834 | tornado__29e067f087b8666ebe4ab67d7d786bd9389e7dbc | tornado | tornadoweb/tornado | python | 29e067f087b8666ebe4ab67d7d786bd9389e7dbc | **Title:** `current_user` is loaded eagerly in UI modules, preventing lazy evaluation
**Description:**
When using UI modules, the `current_user` is accessed immediately upon module initialization instead of being evaluated lazily. This results in unnecessary loading of user data even when the `current_user` is not uti... | diff --git a/tornado/web.py b/tornado/web.py
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -2305,8 +2305,11 @@
self.handler = handler
self.request = handler.request
self.ui = handler.ui
- self.current_user = handler.current_user
self.locale = handler.locale
+
+ @property
+ ... | 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
@@ -1460,6 +1460,91 @@
@wsgi_safe
+class GetCurrentUserTest(WebTestCase):
+ def get_app_kwargs(self):
+ class WithoutUserModule(UIModule):
+ def render(self):
+ ... | null | null | namanjain12/tornado_final:29e067f087b8666ebe4ab67d7d786bd9389e7dbc | true | null | 1 | 5 | null | 1,206 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.217667 | 75.82175 | ||
9,901 | r2e_gym::train::5801 | r2e_gym | train | 5,801 | tornado__21657acf52bf068133f638dd3904d329d254fc98 | tornado | tornadoweb/tornado | python | 21657acf52bf068133f638dd3904d329d254fc98 | **Title:** Incorrect Redirect Location with Double Slashes in Request URI
**Description:**
When a redirect is initiated from a URL that begins with double slashes, the `Location` header is incorrectly formed by combining the original request URI with the redirect URL. This results in an invalid redirect path.
**Examp... | diff --git a/tornado/web.py b/tornado/web.py
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -650,8 +650,7 @@
else:
assert isinstance(status, int) and 300 <= status <= 399
self.set_status(status)
- self.set_header("Location", urlparse.urljoin(utf8(self.request.uri),
- ... | 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
@@ -597,6 +597,7 @@
url("/redirect", RedirectHandler),
url("/web_redirect_permanent", WebRedirectHandler, {"url": "/web_redirect_newpath"}),
url("/web_red... | null | null | namanjain12/tornado_final:21657acf52bf068133f638dd3904d329d254fc98 | true | null | 1 | 3 | null | 1,242 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.217 | 75.81975 | ||
9,902 | r2e_gym::train::5734 | r2e_gym | train | 5,734 | scrapy__1718e450ef9549a4fc71b01dba1e6faf7a63238a | scrapy | scrapy/scrapy | python | 1718e450ef9549a4fc71b01dba1e6faf7a63238a | **Title:** AttributeError Not Raised When `start_urls` Is Empty and `start_url` Is Defined
**Description:**
When a spider mistakenly defines `start_url` instead of the required `start_urls`, and `start_urls` is empty or not set, the crawler fails to start without providing a clear error message. This oversight can pre... | diff --git a/scrapy/spiders/__init__.py b/scrapy/spiders/__init__.py
--- a/scrapy/spiders/__init__.py
+++ b/scrapy/spiders/__init__.py
@@ -68,6 +68,11 @@
def start_requests(self):
cls = self.__class__
+ if not self.start_urls and hasattr(self, 'start_url'):
+ raise AttributeError(
+ ... | diff --git a/tests/test_spider.py b/tests/test_spider.py
--- a/tests/test_spider.py
+++ b/tests/test_spider.py
@@ -391,6 +391,13 @@
self.assertTrue(hasattr(spider, '_follow_links'))
self.assertFalse(spider._follow_links)
+ def test_start_url(self):
+ spider = self.spider_class("example.com... | null | null | namanjain12/scrapy_final:1718e450ef9549a4fc71b01dba1e6faf7a63238a | true | null | 1 | 5 | null | 1,201 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.216833 | 75.81925 | ||
9,903 | r2e_gym::train::5796 | r2e_gym | train | 5,796 | tornado__e9c83cbbc87d7b33c068284afaa526dc2f8f18f9 | tornado | tornadoweb/tornado | python | e9c83cbbc87d7b33c068284afaa526dc2f8f18f9 | **Title:** HTTPServer Raises AssertionError on Chunked POST Requests with Multiple Data Chunks
**Description:**
When sending a POST request with `Transfer-Encoding: chunked` and splitting the data into multiple chunks, the HTTPServer crashes with an AssertionError instead of properly handling the request.
**Example B... | diff --git a/tornado/httpserver.py b/tornado/httpserver.py
--- a/tornado/httpserver.py
+++ b/tornado/httpserver.py
@@ -161,6 +161,7 @@
def __init__(self, server, connection):
self.server = server
self.connection = connection
+ self._chunks = []
def headers_received(self, start_line,... | diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py
--- a/tornado/test/httpserver_test.py
+++ b/tornado/test/httpserver_test.py
@@ -405,8 +405,10 @@
Transfer-Encoding: chunked
Content-Type: application/x-www-form-urlencoded
-7
-foo=bar
+4
+foo=
+3
+bar
0
""".replace(b"\n", b"\r\n"))
| null | null | namanjain12/tornado_final:e9c83cbbc87d7b33c068284afaa526dc2f8f18f9 | true | null | 1 | 5 | null | 1,187 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.2145 | 75.81225 | ||
9,904 | r2e_gym::train::4947 | r2e_gym | train | 4,947 | datalad__834da6f3829d797b8a2b17d9cb9fad2463214102 | datalad | datalad/datalad | python | 834da6f3829d797b8a2b17d9cb9fad2463214102 | **TypeError in `update_docstring_with_parameters` When Handling Functions Without Optional Arguments**
**Description**
When using `update_docstring_with_parameters` on a function that has no optional arguments, a `TypeError` is raised. This occurs because the function assumes that `getargspec` returns a tuple for `def... | diff --git a/datalad/interface/base.py b/datalad/interface/base.py
--- a/datalad/interface/base.py
+++ b/datalad/interface/base.py
@@ -354,12 +354,12 @@
# get the signature
ndefaults = 0
args, varargs, varkw, defaults = getargspec(func)
+ defaults = defaults or tuple()
if add_args:
add_a... | diff --git a/datalad/interface/tests/test_base.py b/datalad/interface/tests/test_base.py
--- a/datalad/interface/tests/test_base.py
+++ b/datalad/interface/tests/test_base.py
@@ -32,6 +32,7 @@
nadict,
nagen,
NA_STRING,
+ update_docstring_with_parameters,
)
from argparse import Namespace
@@ -190,3 ... | null | null | namanjain12/datalad_final:834da6f3829d797b8a2b17d9cb9fad2463214102 | true | null | 1 | 4 | null | 1,186 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.211 | 75.80175 | ||
9,905 | r2e_gym::train::5170 | r2e_gym | train | 5,170 | pyramid__3b5076b6b3fd7218acf445e917eb039999b61820 | pyramid | pylons/pyramid | python | 3b5076b6b3fd7218acf445e917eb039999b61820 | **Title:** Registry constructor does not accept additional arguments, causing initialization errors
**Description:**
When initializing the `Registry` class with additional positional or keyword arguments, a `TypeError` is raised. This prevents passing necessary parameters to the underlying `Components` class, hinderin... | diff --git a/pyramid/registry.py b/pyramid/registry.py
--- a/pyramid/registry.py
+++ b/pyramid/registry.py
@@ -56,7 +56,7 @@
_settings = None
- def __init__(self, package_name=CALLER_PACKAGE):
+ def __init__(self, package_name=CALLER_PACKAGE, *args, **kw):
# add a registry-instance-specific lock... | diff --git a/pyramid/tests/test_registry.py b/pyramid/tests/test_registry.py
--- a/pyramid/tests/test_registry.py
+++ b/pyramid/tests/test_registry.py
@@ -5,8 +5,8 @@
from pyramid.registry import Registry
return Registry
- def _makeOne(self):
- return self._getTargetClass()()
+ def ... | null | null | namanjain12/pyramid_final:3b5076b6b3fd7218acf445e917eb039999b61820 | true | null | 1 | 4 | null | 1,181 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.210167 | 75.79925 | ||
9,906 | r2e_gym::train::5363 | r2e_gym | train | 5,363 | aiohttp__5a8d95b6bafe5aaae92b644a6561b71ddfee8cd4 | aiohttp | aio-libs/aiohttp | python | 5a8d95b6bafe5aaae92b644a6561b71ddfee8cd4 | **Title:** AttributeError: 'Application' object has no attribute '_logger' when creating request handler
**Description:**
When initializing a request handler using the `make_handler` method of the `Application` object, an `AttributeError` is raised because the `_logger` attribute does not exist.
**Example Code:**
```... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -1222,7 +1222,7 @@
return self._loop
def make_handler(self, **kwargs):
- kwargs.setdefault('logger', self._logger)
+ kwargs.setdefault('logger', self.logger)
return RequestHandler(self, self.... | diff --git a/tests/test_web.py b/tests/test_web.py
--- a/tests/test_web.py
+++ b/tests/test_web.py
@@ -34,7 +34,7 @@
def test_app_ctor(self):
app = web.Application(loop=self.loop)
self.assertIs(self.loop, app.loop)
- self.assertIs(app._logger, log.web_logger)
+ self.assertIs(app.log... | null | null | namanjain12/aiohttp_final:5a8d95b6bafe5aaae92b644a6561b71ddfee8cd4 | true | null | 1 | 4 | null | 1,179 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.209833 | 75.79825 | ||
9,907 | r2e_gym::train::4066 | r2e_gym | train | 4,066 | coveragepy__952ee6c3ce1b13a8bf422a14fdd8c95ce887e14a | coveragepy | nedbat/coveragepy | python | 952ee6c3ce1b13a8bf422a14fdd8c95ce887e14a | **Title:** Extra Leading Space in Formatted Info Lines Causes Test Failures
**Description:**
The `info_formatter` function is adding an unnecessary leading space to each formatted line, resulting in misaligned output. This causes tests that compare the expected and actual output to fail due to the extra spaces.
**Exa... | diff --git a/coverage/cmdline.py b/coverage/cmdline.py
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -594,7 +594,7 @@
if info == 'sys':
print("-- sys ----------------------------------------")
for line in info_formatter(self.coverage.sysinfo()):
- ... | diff --git a/tests/test_misc.py b/tests/test_misc.py
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -56,13 +56,13 @@
('nothing', []),
]))
self.assertEqual(lines, [
- ' x: hello there',
- ' very long label: one element',
- ' regu... | null | null | namanjain12/coveragepy_final:952ee6c3ce1b13a8bf422a14fdd8c95ce887e14a | true | null | 2 | 4 | null | 1,160 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.206667 | 75.78875 | ||
9,908 | r2e_gym::train::412 | r2e_gym | train | 412 | orange3__a92047f178edc6870c3b98659bb769b0bb41c844 | orange3 | biolab/orange3 | python | a92047f178edc6870c3b98659bb769b0bb41c844 | **Title:** OWPreprocess Status Bar Displays Only Data Length Without Detailed Summary
**Description:**
When loading a dataset into the OWPreprocess widget, the status bar is expected to show both the number of instances and a detailed summary of the data. However, it currently only displays the number of instances, om... | diff --git a/Orange/widgets/data/owpreprocess.py b/Orange/widgets/data/owpreprocess.py
--- a/Orange/widgets/data/owpreprocess.py
+++ b/Orange/widgets/data/owpreprocess.py
@@ -29,6 +29,7 @@
from Orange.widgets.utils.overlay import OverlayWidget
from Orange.widgets.utils.sql import check_sql_input
from Orange.widgets.... | diff --git a/Orange/widgets/data/tests/test_owpreprocess.py b/Orange/widgets/data/tests/test_owpreprocess.py
--- a/Orange/widgets/data/tests/test_owpreprocess.py
+++ b/Orange/widgets/data/tests/test_owpreprocess.py
@@ -12,8 +12,8 @@
from Orange.widgets.data import owpreprocess
from Orange.widgets.data.owpreprocess im... | null | null | namanjain12/orange3_final:a92047f178edc6870c3b98659bb769b0bb41c844 | true | null | 1 | 5 | null | 1,133 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.2055 | 75.78525 | ||
9,909 | r2e_gym::train::220 | r2e_gym | train | 220 | orange3__1995ceb1306231032de3f842fe6a5b6eb06a75bd | orange3 | biolab/orange3 | python | 1995ceb1306231032de3f842fe6a5b6eb06a75bd | **Title:** TypeError When Binning Sparse Data Due to Unsupported 'isnan' Operation
**Description:**
When using the `EqualWidth` discretization method on sparse data, the process crashes with a `TypeError`. The issue arises because the method attempts to apply `np.isnan` on sparse matrix inputs, which is not supported.... | diff --git a/Orange/preprocess/discretize.py b/Orange/preprocess/discretize.py
--- a/Orange/preprocess/discretize.py
+++ b/Orange/preprocess/discretize.py
@@ -6,7 +6,7 @@
from Orange.data import DiscreteVariable, Domain
from Orange.data.sql.table import SqlTable
from Orange.preprocess.util import _RefuseDataInConstr... | diff --git a/Orange/tests/test_discretize.py b/Orange/tests/test_discretize.py
--- a/Orange/tests/test_discretize.py
+++ b/Orange/tests/test_discretize.py
@@ -13,6 +13,9 @@
# noinspection PyPep8Naming
+from Orange.widgets.tests.utils import table_dense_sparse
+
+
class TestEqualFreq(TestCase):
def test_equif... | null | null | namanjain12/orange3_final:1995ceb1306231032de3f842fe6a5b6eb06a75bd | true | null | 1 | 4 | null | 1,153 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.2055 | 75.78525 | ||
9,910 | r2e_gym::train::5594 | r2e_gym | train | 5,594 | scrapy__1c0da1749d5250bbd82c2eb76fe26e49be13fb74 | scrapy | scrapy/scrapy | python | 1c0da1749d5250bbd82c2eb76fe26e49be13fb74 | **Title:** CaselessDict Fails to Initialize with Mapping Subclasses Due to Unpacking Error
**Description:**
When initializing `CaselessDict` with objects that are instances of `Mapping` or its subclasses, a `ValueError` is raised because the initializer expects key-value pairs but receives an unexpected structure.
**... | diff --git a/scrapy/utils/datatypes.py b/scrapy/utils/datatypes.py
--- a/scrapy/utils/datatypes.py
+++ b/scrapy/utils/datatypes.py
@@ -8,7 +8,7 @@
import copy
import six
import warnings
-from collections import OrderedDict
+from collections import OrderedDict, Mapping
from scrapy.exceptions import ScrapyDeprecati... | diff --git a/tests/test_utils_datatypes.py b/tests/test_utils_datatypes.py
--- a/tests/test_utils_datatypes.py
+++ b/tests/test_utils_datatypes.py
@@ -1,5 +1,6 @@
import copy
import unittest
+from collections import Mapping, MutableMapping
from scrapy.utils.datatypes import CaselessDict, SequenceExclude
@@ -7,13... | null | null | namanjain12/scrapy_final:1c0da1749d5250bbd82c2eb76fe26e49be13fb74 | true | null | 1 | 4 | null | 1,152 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.205333 | 75.78475 | ||
9,911 | r2e_gym::train::5903 | r2e_gym | train | 5,903 | tornado__9c927ffb85aa46194eca5776f67aff74c4b7aa71 | tornado | tornadoweb/tornado | python | 9c927ffb85aa46194eca5776f67aff74c4b7aa71 | **Title:** Server Sends Extra Data in HEAD Response with Transfer-Encoding: Chunked
**Description:**
When handling a `HEAD` request with `Transfer-Encoding: chunked`, the server incorrectly sends an extra terminating chunk (`0\r\n\r\n`). According to the HTTP specification, `HEAD` responses should not include a messag... | diff --git a/tornado/http1connection.py b/tornado/http1connection.py
--- a/tornado/http1connection.py
+++ b/tornado/http1connection.py
@@ -511,7 +511,10 @@
% self._expected_content_remaining
)
if self._chunking_output:
- if not self.stream.closed():
+ assert ... | diff --git a/tornado/test/httpserver_test.py b/tornado/test/httpserver_test.py
--- a/tornado/test/httpserver_test.py
+++ b/tornado/test/httpserver_test.py
@@ -770,6 +770,12 @@
# be written out in chunks.
self.write("".join(chr(i % 256) * 1024 for i in range(512)))
+ class Tran... | null | null | namanjain12/tornado_final:9c927ffb85aa46194eca5776f67aff74c4b7aa71 | true | null | 1 | 5 | null | 1,127 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.2045 | 75.78225 | ||
9,912 | r2e_gym::train::5487 | r2e_gym | train | 5,487 | aiohttp__1e86b777e61cf4eefc7d92fa57fa19dcc676013b | aiohttp | aio-libs/aiohttp | python | 1e86b777e61cf4eefc7d92fa57fa19dcc676013b | **Title:** ClientRequest Does Not Raise Error with Invalid Version Sequence Types
**Description:**
When initializing a `ClientRequest` with an invalid version sequence that includes injected headers, the system does not raise the expected `AttributeError`. This can lead to malformed HTTP requests being sent without p... | diff --git a/CHANGES/7835.bugfix b/CHANGES/7835.bugfix
--- a/CHANGES/7835.bugfix
+++ b/CHANGES/7835.bugfix
@@ -0,0 +1 @@
+Fixed arbitrary sequence types being allowed to inject headers via version parameter -- by :user:`Dreamsorcerer`
diff --git a/aiohttp/client_reqrep.py b/aiohttp/client_reqrep.py
--- a/aiohttp/client... | diff --git a/tests/test_client_request.py b/tests/test_client_request.py
--- a/tests/test_client_request.py
+++ b/tests/test_client_request.py
@@ -20,6 +20,7 @@
Fingerprint,
_gen_default_accept_encoding,
)
+from aiohttp.http import HttpVersion
from aiohttp.test_utils import make_mocked_coro
@@ -590,18 +... | null | null | namanjain12/aiohttp_final:1e86b777e61cf4eefc7d92fa57fa19dcc676013b | true | null | 2 | 5 | null | 1,118 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.203 | 75.77775 | ||
9,913 | r2e_gym::train::5893 | r2e_gym | train | 5,893 | tornado__8b1c466cbf12d593255457247404c00f9c7fa4c1 | tornado | tornadoweb/tornado | python | 8b1c466cbf12d593255457247404c00f9c7fa4c1 | **Title:** `Lock.acquire()` Does Not Accept `timeout` Keyword Argument
**Description:**
When attempting to acquire a lock with a timeout, using the `timeout` keyword results in a `TypeError`. The `Lock.acquire()` method currently does not recognize the `timeout` parameter, causing unexpected failures in scenarios wher... | diff --git a/tornado/locks.py b/tornado/locks.py
--- a/tornado/locks.py
+++ b/tornado/locks.py
@@ -433,13 +433,13 @@
self.__class__.__name__,
self._block)
- def acquire(self, deadline=None):
+ def acquire(self, timeout=None):
"""Attempt to lock. Returns a Future.
Re... | diff --git a/tornado/test/locks_test.py b/tornado/test/locks_test.py
--- a/tornado/test/locks_test.py
+++ b/tornado/test/locks_test.py
@@ -448,7 +448,7 @@
lock = locks.Lock()
lock.acquire()
with self.assertRaises(gen.TimeoutError):
- yield lock.acquire(deadline=timedelta(seconds=0.... | null | null | namanjain12/tornado_final:8b1c466cbf12d593255457247404c00f9c7fa4c1 | true | null | 1 | 4 | null | 1,136 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.202667 | 75.77675 | ||
9,914 | swe_bench::test::1120 | swe_bench | test | 1,120 | matplotlib__matplotlib-26311 | matplotlib/matplotlib | matplotlib/matplotlib | python | 3044bded1b23ae8dc73c1611b124e88db98308ac | [Bug]: labels can't be placed at start of contours
### Bug summary
For some combinations of contour shape and fontsize, the automatic label placement tries to put the label right at the start of the contour. This is not currently possible on `main`.
### Code for reproduction
```python
import matplotlib.pyplot as pl... | I left a comment on your commit.
Trying to target the end of a broken contour might be easier?
> Writing a test seems harder. I tried pasting the above code into a test, and it passed against main. I assume that is because the tests have different "screen space" than when I just run it as a script.
Can you set th... | diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py
--- a/lib/matplotlib/contour.py
+++ b/lib/matplotlib/contour.py
@@ -370,7 +370,7 @@ def _split_path_and_get_label_rotation(self, path, idx, screen_pos, lw, spacing=
# path always starts with a MOVETO, and we consider there's an implicit
... | diff --git a/lib/matplotlib/tests/test_contour.py b/lib/matplotlib/tests/test_contour.py
--- a/lib/matplotlib/tests/test_contour.py
+++ b/lib/matplotlib/tests/test_contour.py
@@ -1,6 +1,7 @@
import datetime
import platform
import re
+from unittest import mock
import contourpy # type: ignore
import numpy as np
@... | ["lib/matplotlib/tests/test_contour.py::test_label_contour_start"] | ["lib/matplotlib/tests/test_contour.py::test_contour_shape_1d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_2d_valid", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args0-Length", "lib/matplotlib/tests/test_contour.py::test_contour_shape_error[args1-Length", "lib/matplotlib/tests/t... | null | true | 2023-07-14T20:39:31Z | 1 | 2 | 1 | 2,135 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.3625 | 75.7625 | |
9,915 | r2e_gym::train::5719 | r2e_gym | train | 5,719 | scrapy__a8a6f050e71fbb7881076a8d6e2867e868d26016 | scrapy | scrapy/scrapy | python | a8a6f050e71fbb7881076a8d6e2867e868d26016 | **Title:** KeyError 'site.local' in RobotsTxtMiddleware When Handling Immediate DNS Lookup Errors
**Description:**
When the `RobotsTxtMiddleware` processes a request and encounters an immediate DNS lookup error while retrieving the `robots.txt` file, it raises a `KeyError`. This prevents the middleware from handling t... | diff --git a/scrapy/downloadermiddlewares/robotstxt.py b/scrapy/downloadermiddlewares/robotstxt.py
--- a/scrapy/downloadermiddlewares/robotstxt.py
+++ b/scrapy/downloadermiddlewares/robotstxt.py
@@ -101,4 +101,6 @@
rp_dfd.callback(rp)
def _robots_error(self, failure, netloc):
- self._parsers.pop(... | diff --git a/tests/test_downloadermiddleware_robotstxt.py b/tests/test_downloadermiddleware_robotstxt.py
--- a/tests/test_downloadermiddleware_robotstxt.py
+++ b/tests/test_downloadermiddleware_robotstxt.py
@@ -123,6 +123,18 @@
deferred.addCallback(lambda _: self.assertTrue(middleware._logerror.called))
... | null | null | namanjain12/scrapy_final:a8a6f050e71fbb7881076a8d6e2867e868d26016 | true | null | 1 | 4 | null | 1,102 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.197 | 75.75975 | ||
9,916 | r2e_gym::train::5713 | r2e_gym | train | 5,713 | scrapy__643dbeffcf6951991fdeed0069690c55684e66ff | scrapy | scrapy/scrapy | python | 643dbeffcf6951991fdeed0069690c55684e66ff | **Title:** Initializing Selector with both `response` and `text` raises AttributeError instead of ValueError
**Description:**
When creating a `Selector` instance by providing both `response` and `text` arguments, an unexpected `AttributeError` is raised instead of the intended `ValueError`. This prevents proper error ... | diff --git a/scrapy/selector/unified.py b/scrapy/selector/unified.py
--- a/scrapy/selector/unified.py
+++ b/scrapy/selector/unified.py
@@ -46,6 +46,10 @@
selectorlist_cls = SelectorList
def __init__(self, response=None, text=None, type=None, root=None, _root=None, **kwargs):
+ if not(response is None... | diff --git a/tests/test_selector.py b/tests/test_selector.py
--- a/tests/test_selector.py
+++ b/tests/test_selector.py
@@ -123,6 +123,10 @@
sel.xpath('//p').extract_unquoted()
self.assertSubstring('Use .extract() instead', str(w[-1].message))
+ def test_selector_bad_args(self):
+ w... | null | null | namanjain12/scrapy_final:643dbeffcf6951991fdeed0069690c55684e66ff | true | null | 1 | 4 | null | 1,094 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.195667 | 75.75575 | ||
9,917 | r2e_gym::train::5215 | r2e_gym | train | 5,215 | pyramid__3fce167f6378cf8eabafdcc3f6c7fa2f7225c9e2 | pyramid | pylons/pyramid | python | 3fce167f6378cf8eabafdcc3f6c7fa2f7225c9e2 | **Title:** URL Dispatcher Fails When Regex Patterns Contain Colons
**Description:**
When defining URL patterns that include regex with colons, the URL dispatcher incorrectly splits the pattern, leading to failures in route compilation. This prevents properly matching and generating URLs that contain colons in their re... | diff --git a/pyramid/urldispatch.py b/pyramid/urldispatch.py
--- a/pyramid/urldispatch.py
+++ b/pyramid/urldispatch.py
@@ -148,7 +148,9 @@
name = pat.pop() # unicode
name = name[1:-1]
if ':' in name:
- name, reg = name.split(':')
+ # reg may contain colons as well,
+ ... | diff --git a/pyramid/tests/test_urldispatch.py b/pyramid/tests/test_urldispatch.py
--- a/pyramid/tests/test_urldispatch.py
+++ b/pyramid/tests/test_urldispatch.py
@@ -306,6 +306,14 @@
def test_custom_regex(self):
matcher, generator = self._callFUT('foo/{baz}/biz/{buz:[^/\.]+}.{bar}')
+ self.asser... | null | null | namanjain12/pyramid_final:3fce167f6378cf8eabafdcc3f6c7fa2f7225c9e2 | true | null | 1 | 4 | null | 1,093 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1955 | 75.75525 | ||
9,918 | r2e_gym::train::5824 | r2e_gym | train | 5,824 | tornado__27f508f4e98518119c310742f8e96d127bbeff82 | tornado | tornadoweb/tornado | python | 27f508f4e98518119c310742f8e96d127bbeff82 | **Title:** `read_until_close` Raises AttributeError When Callback is Provided and an Error Occurs
**Description:**
When using the `read_until_close` method with a callback, an error during the read operation leads to an `AttributeError`. This occurs because the method attempts to add a done callback to a `None` future... | diff --git a/tornado/iostream.py b/tornado/iostream.py
--- a/tornado/iostream.py
+++ b/tornado/iostream.py
@@ -352,7 +352,8 @@
try:
self._try_inline_read()
except:
- future.add_done_callback(lambda f: f.exception())
+ if future is not None:
+ future.ad... | diff --git a/tornado/test/iostream_test.py b/tornado/test/iostream_test.py
--- a/tornado/test/iostream_test.py
+++ b/tornado/test/iostream_test.py
@@ -457,6 +457,18 @@
server.close()
client.close()
+ @unittest.skipIf(mock is None, 'mock package not present')
+ def test_read_until_close... | null | null | namanjain12/tornado_final:27f508f4e98518119c310742f8e96d127bbeff82 | true | null | 1 | 3 | null | 1,112 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.195333 | 75.75475 | ||
9,919 | r2e_gym::train::5846 | r2e_gym | train | 5,846 | tornado__932dcc7dbe8fe20a3619e80183bb0f03f6473bd9 | tornado | tornadoweb/tornado | python | 932dcc7dbe8fe20a3619e80183bb0f03f6473bd9 | **Title:** `Future.result()` Raises TypeError When Passing `timeout` Argument
**Description:**
When attempting to retrieve the result of a `Future` with a timeout, a `TypeError` is raised because the `result` method does not accept the `timeout` argument. This prevents handling scenarios where waiting for a future to ... | diff --git a/tornado/concurrent.py b/tornado/concurrent.py
--- a/tornado/concurrent.py
+++ b/tornado/concurrent.py
@@ -124,11 +124,11 @@
self.__exc_info = exc_info
self.set_exception(exc_info[1])
- def result(self):
+ def result(self, timeout=None):
if self.__exc_info is not None:
... | diff --git a/tornado/test/concurrent_test.py b/tornado/test/concurrent_test.py
--- a/tornado/test/concurrent_test.py
+++ b/tornado/test/concurrent_test.py
@@ -28,6 +28,13 @@
from tornado import stack_context
from tornado.tcpserver import TCPServer
from tornado.testing import AsyncTestCase, LogTrapTestCase, bind_unus... | null | null | namanjain12/tornado_final:932dcc7dbe8fe20a3619e80183bb0f03f6473bd9 | true | null | 1 | 4 | null | 1,088 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.194667 | 75.75275 | ||
9,920 | r2e_gym::train::174 | r2e_gym | train | 174 | orange3__d2ec951049232bc507a39216a097407024a9f065 | orange3 | biolab/orange3 | python | d2ec951049232bc507a39216a097407024a9f065 | **Title:** Exception Raised When Switching Regression Error Without a Model
**Description:**
When attempting to switch the regression error type in the `OWPredictions` widget without providing a model, an exception is raised. This occurs specifically when only data is inputted without an accompanying predictive model.... | diff --git a/Orange/widgets/evaluate/owpredictions.py b/Orange/widgets/evaluate/owpredictions.py
--- a/Orange/widgets/evaluate/owpredictions.py
+++ b/Orange/widgets/evaluate/owpredictions.py
@@ -325,7 +325,9 @@
self.score_opt_box.setVisible(bool(self.class_var))
def _reg_error_changed(self):
- se... | diff --git a/Orange/widgets/evaluate/tests/test_owpredictions.py b/Orange/widgets/evaluate/tests/test_owpredictions.py
--- a/Orange/widgets/evaluate/tests/test_owpredictions.py
+++ b/Orange/widgets/evaluate/tests/test_owpredictions.py
@@ -1157,6 +1157,13 @@
self.assertEqual(delegate.span, max(3 / 2, 6 / 11))
... | null | null | namanjain12/orange3_final:d2ec951049232bc507a39216a097407024a9f065 | true | null | 1 | 4 | null | 1,087 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1945 | 75.75225 | ||
9,921 | r2e_gym::train::5983 | r2e_gym | train | 5,983 | tornado__6e63b238c7ed7c307f1e22232afa7df7fb5901a9 | tornado | tornadoweb/tornado | python | 6e63b238c7ed7c307f1e22232afa7df7fb5901a9 | **Title:** `HTTPResponse.request` Sometimes Returns a `_RequestProxy` Instead of `HTTPRequest`
**Description:**
When making an HTTP request, the `response.request` attribute is expected to be an instance of `HTTPRequest`. However, in certain scenarios, it returns a `_RequestProxy` instead. This unexpected type causes ... | diff --git a/tornado/httpclient.py b/tornado/httpclient.py
--- a/tornado/httpclient.py
+++ b/tornado/httpclient.py
@@ -373,7 +373,10 @@
def __init__(self, request, code, headers=None, buffer=None,
effective_url=None, error=None, request_time=None,
time_info=None, reason=None):
-... | diff --git a/tornado/test/httpclient_test.py b/tornado/test/httpclient_test.py
--- a/tornado/test/httpclient_test.py
+++ b/tornado/test/httpclient_test.py
@@ -334,6 +334,19 @@
self.assertEqual(e.code, 404)
self.assertEqual(e.response.code, 404)
+ @gen_test
+ def test_reuse_request_from... | null | null | namanjain12/tornado_final:6e63b238c7ed7c307f1e22232afa7df7fb5901a9 | true | null | 1 | 5 | null | 1,064 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.194 | 75.75075 | ||
9,922 | r2e_gym::train::205 | r2e_gym | train | 205 | orange3__e70705c8960050098a174827d2a6a1e0d42cfc40 | orange3 | biolab/orange3 | python | e70705c8960050098a174827d2a6a1e0d42cfc40 | **Title:** TypeError When Filtering Primitive Meta Attributes in Table._filter_is_defined
**Description:**
When attempting to filter meta attributes that are of primitive types, the application crashes with a `TypeError`. This error occurs because the `isnan` function from the `bottleneck` library does not support the... | diff --git a/Orange/data/table.py b/Orange/data/table.py
--- a/Orange/data/table.py
+++ b/Orange/data/table.py
@@ -1212,8 +1212,10 @@
col, sparse = self.get_column_view(column)
if sparse:
remove += col == 0
+ elif self.domain[column].is_primitive():
... | diff --git a/Orange/data/tests/test_table.py b/Orange/data/tests/test_table.py
--- a/Orange/data/tests/test_table.py
+++ b/Orange/data/tests/test_table.py
@@ -96,6 +96,11 @@
filtered = val_filter(self.table)
self.assertEqual(list(filtered.metas[:, -2].flatten()), list("bd"))
+ def test_is_defined... | null | null | namanjain12/orange3_final:e70705c8960050098a174827d2a6a1e0d42cfc40 | true | null | 1 | 4 | null | 1,083 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.193833 | 75.75025 | ||
9,923 | r2e_gym::train::150 | r2e_gym | train | 150 | orange3__918508b33a9c50779e9f4b78ba465fce298f5f72 | orange3 | biolab/orange3 | python | 918508b33a9c50779e9f4b78ba465fce298f5f72 | **Title:** Pivot Widget crashes with IndexError when handling tables with only meta attributes
**Description:**
When a data table containing only meta attributes is provided to the Pivot widget, it results in an unexpected crash due to an `IndexError`. This behavior prevents users from utilizing meta-only datasets eff... | diff --git a/Orange/widgets/data/owpivot.py b/Orange/widgets/data/owpivot.py
--- a/Orange/widgets/data/owpivot.py
+++ b/Orange/widgets/data/owpivot.py
@@ -921,8 +921,8 @@
self.row_feature = model[0]
model = self.controls.val_feature.model()
if model and len(model) > 2:
- self.v... | diff --git a/Orange/widgets/data/tests/test_owpivot.py b/Orange/widgets/data/tests/test_owpivot.py
--- a/Orange/widgets/data/tests/test_owpivot.py
+++ b/Orange/widgets/data/tests/test_owpivot.py
@@ -277,6 +277,14 @@
self.assertEqual(model.data(model.index(3, 4)), "normal")
self.assertEqual(model.data(... | null | null | namanjain12/orange3_final:918508b33a9c50779e9f4b78ba465fce298f5f72 | true | null | 1 | 4 | null | 1,083 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.193833 | 75.75025 | ||
9,924 | swe_bench::test::1814 | swe_bench | test | 1,814 | sphinx-doc__sphinx-8264 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | d1f8dddeff742ca09dca6ab829410248b919a5c5 | TypeError: 'type' object is not iterable
Hi All,
this is the first time I try to create a documentation using Sphinx.
venv is a virutal environment created with miniconda.
Using the Miniconda3 prompt, I activated the environment and tried
to create the documentation.
As suggested in the error, please find below the err... | I suppose this error was raised when autodoc could not process some kind of type annotation. So I need to know what kind of python code was documented. Could you share your project? Or could you make a minimal reproducible example?
Thanks for your reply. Unfortunately, I cannot share the whole project but thanks to you... | diff --git a/sphinx/util/typing.py b/sphinx/util/typing.py
--- a/sphinx/util/typing.py
+++ b/sphinx/util/typing.py
@@ -109,7 +109,10 @@ def _stringify_py37(annotation: Any) -> str:
return repr(annotation)
if getattr(annotation, '__args__', None):
- if qualname == 'Union':
+ if not isinstan... | diff --git a/tests/test_util_typing.py b/tests/test_util_typing.py
--- a/tests/test_util_typing.py
+++ b/tests/test_util_typing.py
@@ -32,6 +32,10 @@ class MyList(List[T]):
pass
+class BrokenType:
+ __args__ = int
+
+
def test_stringify():
assert stringify(int) == "int"
assert stringify(str) == "... | ["tests/test_util_typing.py::test_stringify_broken_type_hints"] | ["tests/test_util_typing.py::test_stringify", "tests/test_util_typing.py::test_stringify_type_hints_containers", "tests/test_util_typing.py::test_stringify_Annotated", "tests/test_util_typing.py::test_stringify_type_hints_string", "tests/test_util_typing.py::test_stringify_type_hints_Callable", "tests/test_util_typing.... | null | true | 2020-10-02T17:05:52Z | 1 | 5 | 1 | 8,255 | 0 | 0.8 | 1 | 0.5 | 0.8 | 0.516667 | 75.75 | |
9,925 | r2e_gym::train::5027 | r2e_gym | train | 5,027 | datalad__51d72905a93157b03b6d35e1a1f7bc1b6569ace7 | datalad | datalad/datalad | python | 51d72905a93157b03b6d35e1a1f7bc1b6569ace7 | **Title**: Missing DEBUG log when passing ERROR to git-annex during exception handling
**Description**:
When an exception occurs in the `main` function of `datalad.customremotes.main`, the expected debug log message indicating that the error is being passed to git-annex is not generated. This omission makes it diffic... | diff --git a/datalad/customremotes/main.py b/datalad/customremotes/main.py
--- a/datalad/customremotes/main.py
+++ b/datalad/customremotes/main.py
@@ -19,6 +19,9 @@
)
from datalad.cli.utils import setup_exceptionhook
from datalad.ui import ui
+
+import logging
+lgr = logging.getLogger('datalad.customremotes')
d... | diff --git a/datalad/customremotes/tests/test_main.py b/datalad/customremotes/tests/test_main.py
--- a/datalad/customremotes/tests/test_main.py
+++ b/datalad/customremotes/tests/test_main.py
@@ -0,0 +1,39 @@
+# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
+# ex: set sts=4 ts=4 s... | null | null | namanjain12/datalad_final:51d72905a93157b03b6d35e1a1f7bc1b6569ace7 | true | null | 1 | 5 | null | 1,055 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1925 | 75.74625 | ||
9,926 | r2e_gym::train::5920 | r2e_gym | train | 5,920 | tornado__5a069a8820e456bf886717898e9c21ead20289a5 | tornado | tornadoweb/tornado | python | 5a069a8820e456bf886717898e9c21ead20289a5 | **Title:** WebSocket Connections Follow Redirects Unexpectedly, Causing Timeout Errors
**Description:**
When attempting to establish a WebSocket connection to a URL that issues an HTTP redirect, the connection erroneously follows the redirect. This behavior is unintended for WebSocket communications and results in a t... | diff --git a/tornado/websocket.py b/tornado/websocket.py
--- a/tornado/websocket.py
+++ b/tornado/websocket.py
@@ -1409,6 +1409,9 @@
"Sec-WebSocket-Extensions"
] = "permessage-deflate; client_max_window_bits"
+ # Websocket connection is currently unable to follow redirects
+ ... | diff --git a/tornado/test/websocket_test.py b/tornado/test/websocket_test.py
--- a/tornado/test/websocket_test.py
+++ b/tornado/test/websocket_test.py
@@ -111,6 +111,11 @@
self.write("ok")
+class RedirectHandler(RequestHandler):
+ def get(self):
+ self.redirect("/echo")
+
+
class CloseReasonHand... | null | null | namanjain12/tornado_final:5a069a8820e456bf886717898e9c21ead20289a5 | true | null | 1 | 3 | null | 1,089 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1915 | 75.74325 | ||
9,927 | r2e_gym::train::5701 | r2e_gym | train | 5,701 | scrapy__9a734e675907ea4d256c03a5d22740d2a43dcf61 | scrapy | scrapy/scrapy | python | 9a734e675907ea4d256c03a5d22740d2a43dcf61 | **Title:** ScrapyJSONEncoder Fails to Serialize `set` Objects, Raising TypeError
**Description:**
When attempting to serialize a `set` using `ScrapyJSONEncoder`, a `TypeError` is raised indicating that the object is not JSON serializable. This prevents the encoder from handling data structures that include sets, whic... | diff --git a/scrapy/utils/serialize.py b/scrapy/utils/serialize.py
--- a/scrapy/utils/serialize.py
+++ b/scrapy/utils/serialize.py
@@ -14,7 +14,9 @@
TIME_FORMAT = "%H:%M:%S"
def default(self, o):
- if isinstance(o, datetime.datetime):
+ if isinstance(o, set):
+ return list(o)
+ ... | diff --git a/tests/test_utils_serialize.py b/tests/test_utils_serialize.py
--- a/tests/test_utils_serialize.py
+++ b/tests/test_utils_serialize.py
@@ -23,9 +23,14 @@
ts = "10:11:12"
dec = Decimal("1000.12")
decs = "1000.12"
+ s = {'foo'}
+ ss = ['foo']
+ dt_set = {dt}
+ ... | null | null | namanjain12/scrapy_final:9a734e675907ea4d256c03a5d22740d2a43dcf61 | true | null | 1 | 4 | null | 1,034 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.185667 | 75.72575 | ||
9,928 | r2e_gym::train::4008 | r2e_gym | train | 4,008 | coveragepy__f5eb5f2159180db8cf0a1cf8b34bc96f1140dc96 | coveragepy | nedbat/coveragepy | python | f5eb5f2159180db8cf0a1cf8b34bc96f1140dc96 | **Title:** JSON coverage report missing branch attributes leads to test assertion failures
**Description:**
When generating a JSON coverage report with branch coverage enabled, the report does not include the `covered_branches` and `missing_branches` attributes in the totals. This omission causes tests that expect the... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -114,6 +114,7 @@
Roger Hu
Ross Lawley
Roy Williams
+Salvatore Zagaria
Sandra Martocchia
Scott Belden
Sigve Tjora
diff --git a/coverage/jsonreport.py b/coverage/jsonreport.py
--- a/coverage/jsonreport.py
+++ b/coverag... | diff --git a/tests/test_json.py b/tests/test_json.py
--- a/tests/test_json.py
+++ b/tests/test_json.py
@@ -65,7 +65,9 @@
'num_branches': 2,
'excluded_lines': 0,
'num_partial_branches': 1,
- 'percent_covered': 60.0
+ 'percent_covered': 60.0... | null | null | namanjain12/coveragepy_final:f5eb5f2159180db8cf0a1cf8b34bc96f1140dc96 | true | null | 2 | 3 | null | 1,045 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.184167 | 75.72125 | ||
9,929 | r2e_gym::train::5456 | r2e_gym | train | 5,456 | aiohttp__537413a7fc05ddfb1f89ad434c03bf2e2bf58e8b | aiohttp | aio-libs/aiohttp | python | 537413a7fc05ddfb1f89ad434c03bf2e2bf58e8b | **Title:** Setting charset for 'application/octet-stream' does not raise an error
**Description:**
When attempting to set the `charset` on a `StreamResponse` with the `content_type` set to `'application/octet-stream'`, the system does not raise an error as expected. This behavior is unintuitive because setting a chars... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -201,7 +201,10 @@
@charset.setter
def charset(self, value):
self._check_sending_started()
- self.content_type # read header values if needed
+ ctype = self.content_type # read header values if ne... | 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
@@ -133,6 +133,7 @@
req = self.make_request('GET', '/')
resp = StreamResponse(req)
+ resp.content_type = 'text/html'
resp.charset = None
sel... | null | null | namanjain12/aiohttp_final:537413a7fc05ddfb1f89ad434c03bf2e2bf58e8b | true | null | 1 | 5 | null | 997 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.182833 | 75.71725 | ||
9,930 | r2e_gym::train::5408 | r2e_gym | train | 5,408 | aiohttp__dfaafac078d3f5ee5902933709f7264e9b1ffd70 | aiohttp | aio-libs/aiohttp | python | dfaafac078d3f5ee5902933709f7264e9b1ffd70 | **Title:** AsyncResolver Query Fallback Does Not Include Error Messages in OSError
**Description:**
When the `AsyncResolver` attempts to resolve a hostname and the query fallback fails, the raised `OSError` does not include the original error message. This makes it difficult to understand the cause of the failure.
*... | diff --git a/CHANGES/9455.bugfix.rst b/CHANGES/9455.bugfix.rst
--- a/CHANGES/9455.bugfix.rst
+++ b/CHANGES/9455.bugfix.rst
@@ -0,0 +1 @@
+9451.bugfix.rst
diff --git a/aiohttp/resolver.py b/aiohttp/resolver.py
--- a/aiohttp/resolver.py
+++ b/aiohttp/resolver.py
@@ -159,7 +159,7 @@
resp = await self._resolve... | diff --git a/tests/test_resolver.py b/tests/test_resolver.py
--- a/tests/test_resolver.py
+++ b/tests/test_resolver.py
@@ -333,6 +333,36 @@
@pytest.mark.skipif(not getaddrinfo, reason="aiodns >=3.2.0 required")
+async def test_async_resolver_query_fallback_error_messages_passed(
+ loop: asyncio.AbstractEventLoo... | null | null | namanjain12/aiohttp_final:dfaafac078d3f5ee5902933709f7264e9b1ffd70 | true | null | 2 | 5 | null | 977 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1795 | 75.70725 | ||
9,931 | r2e_gym::train::5673 | r2e_gym | train | 5,673 | scrapy__9e0bfc4a3dc92ac7f0fc0aff6254374045733299 | scrapy | scrapy/scrapy | python | 9e0bfc4a3dc92ac7f0fc0aff6254374045733299 | **Title:** CsvItemExporter Closes Stream Unexpectedly After Finishing Export
**Description:**
When using `CsvItemExporter` to export items, calling the `finish_exporting()` method unexpectedly closes the underlying file stream. This causes subsequent operations on the file handle, such as seeking, to fail with a `Valu... | diff --git a/scrapy/exporters.py b/scrapy/exporters.py
--- a/scrapy/exporters.py
+++ b/scrapy/exporters.py
@@ -255,6 +255,9 @@
values = list(self._build_row(x for _, x in fields))
self.csv_writer.writerow(values)
+ def finish_exporting(self):
+ self.stream.detach() # Avoid closing the wra... | diff --git a/tests/test_exporters.py b/tests/test_exporters.py
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -90,6 +90,10 @@
if self.ie.__class__ is not BaseItemExporter:
raise
self.ie.finish_exporting()
+ # Delete the item exporter object, so that if it ca... | null | null | namanjain12/scrapy_final:9e0bfc4a3dc92ac7f0fc0aff6254374045733299 | true | null | 1 | 3 | null | 1,014 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.179 | 75.70575 | ||
9,932 | r2e_gym::train::264 | r2e_gym | train | 264 | orange3__528aadcc10e6424095a74508f07432a16ac980cb | orange3 | biolab/orange3 | python | 528aadcc10e6424095a74508f07432a16ac980cb | **Title:** AttributeError When Merging Empty Tables in MergeData Widget
**Description:**
When attempting to merge empty tables using the MergeData widget, an `AttributeError` is raised. This occurs because the widget's context handler does not properly handle `Table` objects without a domain, leading to a failure when... | diff --git a/Orange/widgets/data/owmergedata.py b/Orange/widgets/data/owmergedata.py
--- a/Orange/widgets/data/owmergedata.py
+++ b/Orange/widgets/data/owmergedata.py
@@ -10,7 +10,7 @@
from orangewidget.utils.combobox import ComboBoxSearch
import Orange
-from Orange.data import StringVariable, ContinuousVariable, V... | diff --git a/Orange/widgets/data/tests/test_owmergedata.py b/Orange/widgets/data/tests/test_owmergedata.py
--- a/Orange/widgets/data/tests/test_owmergedata.py
+++ b/Orange/widgets/data/tests/test_owmergedata.py
@@ -1063,6 +1063,12 @@
self.assertIsInstance(info._StateInfo__output_summary, StateInfo.Empty)
... | null | null | namanjain12/orange3_final:528aadcc10e6424095a74508f07432a16ac980cb | true | null | 1 | 4 | null | 992 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.178667 | 75.70475 | ||
9,933 | r2e_gym::train::5204 | r2e_gym | train | 5,204 | pyramid__1814cda1f5ec85c24651bfd29645e4057ae5200e | pyramid | pylons/pyramid | python | 1814cda1f5ec85c24651bfd29645e4057ae5200e | **Title:** Instances of `AllPermissionsList` Are Not Iterable, Causing TypeError
**Description:**
When attempting to iterate over an instance of `AllPermissionsList`, a `TypeError` is raised because the `__iter__` method returns a tuple instead of an iterator. This prevents the class from being used in contexts that r... | diff --git a/pyramid/security.py b/pyramid/security.py
--- a/pyramid/security.py
+++ b/pyramid/security.py
@@ -21,10 +21,13 @@
class AllPermissionsList(object):
""" Stand in 'permission list' to represent all permissions """
+
def __iter__(self):
- return ()
+ return iter(())
+
def __con... | diff --git a/pyramid/tests/test_security.py b/pyramid/tests/test_security.py
--- a/pyramid/tests/test_security.py
+++ b/pyramid/tests/test_security.py
@@ -16,11 +16,31 @@
def _makeOne(self):
return self._getTargetClass()()
- def test_it(self):
+ def test_equality_w_self(self):
thing = sel... | null | null | namanjain12/pyramid_final:1814cda1f5ec85c24651bfd29645e4057ae5200e | true | null | 1 | 5 | null | 968 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.178 | 75.70275 | ||
9,934 | r2e_gym::train::398 | r2e_gym | train | 398 | orange3__ee4dd2c9e3dba0d5e65a79adb4442cab7a50760b | orange3 | biolab/orange3 | python | ee4dd2c9e3dba0d5e65a79adb4442cab7a50760b | **Title:** Variables with Over 100 Unique Values Classified as DiscreteVariable Instead of StringVariable
**Description:**
When a dataset column contains more than 100 unique string values, it is incorrectly identified as a `DiscreteVariable` instead of a `StringVariable`. This misclassification can lead to improper d... | diff --git a/Orange/data/variable.py b/Orange/data/variable.py
--- a/Orange/data/variable.py
+++ b/Orange/data/variable.py
@@ -26,6 +26,8 @@
DISCRETE_MAX_VALUES = 3 # == 2 + nan
MAX_NUM_OF_DECIMALS = 5
+# the variable with more than 100 different values should not be StringVariable
+DISCRETE_MAX_ALLOWED_VALUES = 1... | diff --git a/Orange/data/tests/test_io.py b/Orange/data/tests/test_io.py
--- a/Orange/data/tests/test_io.py
+++ b/Orange/data/tests/test_io.py
@@ -0,0 +1,70 @@
+import unittest
+import numpy as np
+
+from Orange.data import ContinuousVariable, DiscreteVariable, StringVariable
+from Orange.data.io import guess_data_type... | null | null | namanjain12/orange3_final:ee4dd2c9e3dba0d5e65a79adb4442cab7a50760b | true | null | 1 | 5 | null | 965 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1775 | 75.70125 | ||
9,935 | r2e_gym::train::4013 | r2e_gym | train | 4,013 | coveragepy__94920c01e81048f9167cd4a2225cdee00659ad16 | coveragepy | nedbat/coveragepy | python | 94920c01e81048f9167cd4a2225cdee00659ad16 | **Title:** Missing `optimize_if_not_debug2` in PYBEHAVIOR Causes AttributeError on CPython 3.8.0b1
**Description:**
When using CPython version 3.8.0b1 or later, the `PYBEHAVIOR` class in `coverage/env.py` does not include the `optimize_if_not_debug2` attribute. This omission leads to an AttributeError during test exec... | diff --git a/coverage/env.py b/coverage/env.py
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -31,8 +31,11 @@
# Is "if __debug__" optimized away?
optimize_if_debug = (not PYPY)
- # If "if not __debug__" optimized away?
+ # Is "if not __debug__" optimized away?
optimize_if_not_debug = (not PYPY) a... | diff --git a/tests/test_arcs.py b/tests/test_arcs.py
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1178,6 +1178,9 @@
# Before 3.7, no Python optimized away "if not __debug__:"
if not env.PYBEHAVIOR.optimize_if_debug:
self.skipTest("PyPy doesn't optimize away 'if __debug__:'")
+ ... | null | null | namanjain12/coveragepy_final:94920c01e81048f9167cd4a2225cdee00659ad16 | true | null | 1 | 5 | null | 965 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1775 | 75.70125 | ||
9,936 | r2e_gym::train::5416 | r2e_gym | train | 5,416 | aiohttp__dd5bb073107caa1c764158b87fb8482124aad6c1 | aiohttp | aio-libs/aiohttp | python | dd5bb073107caa1c764158b87fb8482124aad6c1 | **[ISSUE]**
**Title:** Allowing Newlines in Response Reason Enables Header Injection
**Description:**
When setting the `reason` attribute of a response with a string that includes newline characters, no error is raised. This behavior can be exploited to inject additional HTTP headers, leading to potential security vu... | diff --git a/CHANGES/9167.bugfix.rst b/CHANGES/9167.bugfix.rst
--- a/CHANGES/9167.bugfix.rst
+++ b/CHANGES/9167.bugfix.rst
@@ -0,0 +1 @@
+Rejected `\n` in `reason` values to avoid sending broken HTTP messages -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/web_response.py b/aiohttp/web_response.py
--- a/aiohttp/web_r... | 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
@@ -270,3 +270,8 @@
):
resp = web.HTTPUnauthorized(body="text")
assert resp.status == 401
+
+
+def test_multiline_reason() -> None:
+ with pytest.raises(Va... | null | null | namanjain12/aiohttp_final:dd5bb073107caa1c764158b87fb8482124aad6c1 | true | null | 2 | 3 | null | 1,002 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.177 | 75.69975 | ||
9,937 | r2e_gym::train::278 | r2e_gym | train | 278 | orange3__d352fe2113bf4b7aaa0b80c97955739a8a2b38c7 | orange3 | biolab/orange3 | python | d352fe2113bf4b7aaa0b80c97955739a8a2b38c7 | **Title: Enumeration Annotations Return Numeric Values Causing Validation Errors**
**Description**
When the annotation variable is set to enumeration in the Bar Plot widget, the generated labels are numeric values instead of strings. This leads to errors during label validation, especially when the code expects label... | diff --git a/Orange/widgets/visualize/owbarplot.py b/Orange/widgets/visualize/owbarplot.py
--- a/Orange/widgets/visualize/owbarplot.py
+++ b/Orange/widgets/visualize/owbarplot.py
@@ -572,7 +572,10 @@
elif not self.annot_var:
return []
elif self.annot_var == self.enumeration:
- ... | diff --git a/Orange/widgets/visualize/tests/test_owbarplot.py b/Orange/widgets/visualize/tests/test_owbarplot.py
--- a/Orange/widgets/visualize/tests/test_owbarplot.py
+++ b/Orange/widgets/visualize/tests/test_owbarplot.py
@@ -136,6 +136,21 @@
self.send_signal(self.widget.Inputs.data, None)
self.asser... | null | null | namanjain12/orange3_final:d352fe2113bf4b7aaa0b80c97955739a8a2b38c7 | true | null | 1 | 5 | null | 959 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1765 | 75.69825 | ||
9,938 | r2e_gym::train::5279 | r2e_gym | train | 5,279 | aiohttp__f7e4246114ce48335f224f36c2d4b058b02bea7b | aiohttp | aio-libs/aiohttp | python | f7e4246114ce48335f224f36c2d4b058b02bea7b | **Title:** EmptyStreamReader's String Representation Raises AttributeError
**Description:**
When using `EmptyStreamReader`, converting it to a string results in an `AttributeError`. This happens because `EmptyStreamReader` inherits the `__repr__` method from `StreamReader`, which expects certain attributes that `Empty... | diff --git a/CHANGES/6916.bugfix b/CHANGES/6916.bugfix
--- a/CHANGES/6916.bugfix
+++ b/CHANGES/6916.bugfix
@@ -0,0 +1 @@
+Add __repr__ to EmptyStreamReader to avoid AttributeErrors.
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -155,6 +155,7 @@
Jakob Ackermann
Jakub... | diff --git a/tests/test_streams.py b/tests/test_streams.py
--- a/tests/test_streams.py
+++ b/tests/test_streams.py
@@ -1132,6 +1132,7 @@
async def test_empty_stream_reader() -> None:
s = streams.EmptyStreamReader()
+ assert str(s) is not None
assert s.set_exception(ValueError()) is None
assert s.ex... | null | null | namanjain12/aiohttp_final:f7e4246114ce48335f224f36c2d4b058b02bea7b | true | null | 3 | 5 | null | 957 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.176167 | 75.69725 | ||
9,939 | r2e_gym::train::5752 | r2e_gym | train | 5,752 | scrapy__6c858cec91b013853a73e6215b74c90b609bc2da | scrapy | scrapy/scrapy | python | 6c858cec91b013853a73e6215b74c90b609bc2da | ### Title: Setting Cookie with Primitive Types Causes AttributeError
#### Description
When setting a cookie with a primitive type such as a boolean, the cookies middleware attempts to decode the value, leading to an `AttributeError`. This occurs because the middleware expects the cookie value to be a string or bytes, ... | diff --git a/scrapy/downloadermiddlewares/cookies.py b/scrapy/downloadermiddlewares/cookies.py
--- a/scrapy/downloadermiddlewares/cookies.py
+++ b/scrapy/downloadermiddlewares/cookies.py
@@ -80,8 +80,8 @@
logger.warning(msg.format(request, cookie, key))
return
... | diff --git a/tests/test_downloadermiddleware_cookies.py b/tests/test_downloadermiddleware_cookies.py
--- a/tests/test_downloadermiddleware_cookies.py
+++ b/tests/test_downloadermiddleware_cookies.py
@@ -347,3 +347,24 @@
self.assertCookieValEqual(req1.headers['Cookie'], 'key=value1')
self.assertCookieV... | null | null | namanjain12/scrapy_final:6c858cec91b013853a73e6215b74c90b609bc2da | true | null | 1 | 4 | null | 968 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.174667 | 75.69275 | ||
9,940 | r2e_gym::train::5641 | r2e_gym | train | 5,641 | scrapy__48c5a8c98f545e35708a580e724d0b8e1ada5e6e | scrapy | scrapy/scrapy | python | 48c5a8c98f545e35708a580e724d0b8e1ada5e6e | **Title:** `WrappedRequest.get_header` Raises `TypeError` When Default is `None`
**Description**
Calling the `get_header` method without specifying a default value or explicitly setting the default to `None` results in a `TypeError`. This occurs because the method attempts to convert `None` to a Unicode string, which ... | diff --git a/scrapy/http/cookies.py b/scrapy/http/cookies.py
--- a/scrapy/http/cookies.py
+++ b/scrapy/http/cookies.py
@@ -170,7 +170,8 @@
return name in self.request.headers
def get_header(self, name, default=None):
- return to_unicode(self.request.headers.get(name, default), errors="replace")
+... | diff --git a/tests/test_http_cookies.py b/tests/test_http_cookies.py
--- a/tests/test_http_cookies.py
+++ b/tests/test_http_cookies.py
@@ -43,6 +43,13 @@
def test_get_header(self):
self.assertEqual(self.wrapped.get_header("content-type"), "text/html")
self.assertEqual(self.wrapped.get_header("xxx... | null | null | namanjain12/scrapy_final:48c5a8c98f545e35708a580e724d0b8e1ada5e6e | true | null | 1 | 3 | null | 988 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.174667 | 75.69275 | ||
9,941 | r2e_gym::train::5981 | r2e_gym | train | 5,981 | tornado__63ae59dda4bc3d83f7a1265f3c17807d4bc7e78f | tornado | tornadoweb/tornado | python | 63ae59dda4bc3d83f7a1265f3c17807d4bc7e78f | **Title:** Calling `close()` Multiple Times on `AddThreadSelectorEventLoop` Raises OSError
**Description:**
When the `close()` method is invoked more than once on an instance of `AddThreadSelectorEventLoop`, the second call fails with an `OSError`. This behavior prevents the method from being idempotent, which is unex... | diff --git a/tornado/platform/asyncio.py b/tornado/platform/asyncio.py
--- a/tornado/platform/asyncio.py
+++ b/tornado/platform/asyncio.py
@@ -412,6 +412,8 @@
but can be attached to a running asyncio loop.
"""
+ _closed = False
+
def __init__(self, real_loop: asyncio.AbstractEventLoop) -> None:
... | diff --git a/tornado/test/asyncio_test.py b/tornado/test/asyncio_test.py
--- a/tornado/test/asyncio_test.py
+++ b/tornado/test/asyncio_test.py
@@ -20,6 +20,7 @@
AsyncIOLoop,
to_asyncio_future,
AnyThreadEventLoopPolicy,
+ AddThreadSelectorEventLoop,
)
from tornado.testing import AsyncTestCase, gen_te... | null | null | namanjain12/tornado_final:63ae59dda4bc3d83f7a1265f3c17807d4bc7e78f | true | null | 1 | 5 | null | 947 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1745 | 75.69225 | ||
9,942 | r2e_gym::train::5988 | r2e_gym | train | 5,988 | tornado__a48f65a42c3b3f0f2b21bcbce4da12c2d4419915 | tornado | tornadoweb/tornado | python | a48f65a42c3b3f0f2b21bcbce4da12c2d4419915 | **Title:** Using `with_timeout` with Coroutine Raises AttributeError
**Description:**
When attempting to use the `with_timeout` function with a coroutine, an `AttributeError` is raised because coroutine objects do not have the `add_done_callback` method. This prevents coroutines from being properly handled with a time... | diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -852,7 +852,7 @@
Added the ``quiet_exceptions`` argument and the logging of unhandled
exceptions.
"""
- # TODO: allow yield points in addition to futures?
+ # TODO: allow YieldPoints in addition to other... | 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
@@ -765,6 +765,19 @@
f2(callback=(yield gen.Callback('cb')))
results = yield [namespace['f1'](), gen.Wait('cb')]
self.assertEqual(results, [42, 43])
+ self.fin... | null | null | namanjain12/tornado_final:a48f65a42c3b3f0f2b21bcbce4da12c2d4419915 | true | null | 1 | 3 | null | 986 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.174333 | 75.69175 | ||
9,943 | r2e_gym::train::5748 | r2e_gym | train | 5,748 | scrapy__bb2cf7c0d7199fffe0aa100e5c8a51c6b4b82fc2 | scrapy | scrapy/scrapy | python | bb2cf7c0d7199fffe0aa100e5c8a51c6b4b82fc2 | **Title:** XMLItemExporter Fails When Exporting Items with Non-String Fields
**Description:**
When exporting items that include non-string fields such as booleans, floats, or integers, the `XmlItemExporter` encounters an error. This occurs because it attempts to decode these non-string types, leading to an unexpected ... | diff --git a/scrapy/exporters.py b/scrapy/exporters.py
--- a/scrapy/exporters.py
+++ b/scrapy/exporters.py
@@ -144,8 +144,10 @@
elif is_listlike(serialized_value):
for value in serialized_value:
self._export_xml_field('value', value)
+ elif isinstance(serialized_value, six.... | diff --git a/tests/test_exporters.py b/tests/test_exporters.py
--- a/tests/test_exporters.py
+++ b/tests/test_exporters.py
@@ -376,6 +376,20 @@
b'</items>'
)
+ def test_nonstring_types_item(self):
+ item = self._get_nonstring_types_item()
+ self.assertExportResult(item,
+ ... | null | null | namanjain12/scrapy_final:bb2cf7c0d7199fffe0aa100e5c8a51c6b4b82fc2 | true | null | 1 | 4 | null | 963 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.173833 | 75.69025 | ||
9,944 | r2e_gym::train::5494 | r2e_gym | train | 5,494 | aiohttp__b7e3b300369d2b8c1a1bd1e269bf23b51dc0d8ce | aiohttp | aio-libs/aiohttp | python | b7e3b300369d2b8c1a1bd1e269bf23b51dc0d8ce | **Title:** `ResponseHandler` lacks `force_close` method, causing AttributeError
**Description:**
When attempting to forcefully close a response handler, an `AttributeError` is raised because the `force_close` method is missing. This method is expected to set the `should_close` attribute to `True`, allowing external sy... | diff --git a/CHANGES/9997.bugfix.rst b/CHANGES/9997.bugfix.rst
--- a/CHANGES/9997.bugfix.rst
+++ b/CHANGES/9997.bugfix.rst
@@ -0,0 +1 @@
+Restored the ``force_close`` method to the ``ResponseHandler`` -- by :user:`bdraco`.
diff --git a/aiohttp/client_proto.py b/aiohttp/client_proto.py
--- a/aiohttp/client_proto.py
+++ ... | diff --git a/tests/test_client_proto.py b/tests/test_client_proto.py
--- a/tests/test_client_proto.py
+++ b/tests/test_client_proto.py
@@ -1,3 +1,4 @@
+import asyncio
from unittest import mock
from yarl import URL
@@ -9,7 +10,18 @@
from aiohttp.helpers import TimerNoop
-async def test_oserror(loop) -> None:
+a... | null | null | namanjain12/aiohttp_final:b7e3b300369d2b8c1a1bd1e269bf23b51dc0d8ce | true | null | 2 | 4 | null | 960 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.173333 | 75.68875 | ||
9,945 | r2e_gym::train::5294 | r2e_gym | train | 5,294 | aiohttp__a076bea6894928c2b91d8547d5e9a77e1715985d | aiohttp | aio-libs/aiohttp | python | a076bea6894928c2b91d8547d5e9a77e1715985d | **Title:** Incorrect TypeError Message When Initializing MultiDict with Multiple Arguments
**Description:**
When creating an instance of `MultiDict` with multiple positional arguments, the raised `TypeError` incorrectly reports the number of arguments provided. This misleading error message can confuse developers abou... | diff --git a/aiohttp/multidict.py b/aiohttp/multidict.py
--- a/aiohttp/multidict.py
+++ b/aiohttp/multidict.py
@@ -15,8 +15,8 @@
def __init__(self, *args, **kwargs):
if len(args) > 1:
- raise TypeError("MultiDict takes at most 2 positional "
- "arguments ({} given)"... | diff --git a/tests/test_multidict.py b/tests/test_multidict.py
--- a/tests/test_multidict.py
+++ b/tests/test_multidict.py
@@ -21,7 +21,7 @@
self.assertEqual(list(d.items(getall=True)), [])
self.assertNotEqual(self.make_dict(), list())
- with self.assertRaisesRegex(TypeError, "\(3 given\)"):
... | null | null | namanjain12/aiohttp_final:a076bea6894928c2b91d8547d5e9a77e1715985d | true | null | 1 | 4 | null | 959 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.173167 | 75.68825 | ||
9,946 | r2e_gym::train::5495 | r2e_gym | train | 5,495 | aiohttp__88f383427e918360fd2762a9a3256897159e2d6b | aiohttp | aio-libs/aiohttp | python | 88f383427e918360fd2762a9a3256897159e2d6b | Title: Allowing Newlines in HTTP Response Reason Can Lead to Errors
**Description**
When setting the `reason` field in an HTTP response, including newline characters does not raise an error. This can lead to malformed HTTP responses or potential header injection vulnerabilities.
**Example Buggy Code**
```python
fro... | diff --git a/CHANGES/9167.bugfix.rst b/CHANGES/9167.bugfix.rst
--- a/CHANGES/9167.bugfix.rst
+++ b/CHANGES/9167.bugfix.rst
@@ -0,0 +1 @@
+Rejected `\n` in `reason` values to avoid sending broken HTTP messages -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/web_exceptions.py b/aiohttp/web_exceptions.py
--- a/aiohttp/w... | 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
@@ -183,6 +183,10 @@
assert resp.reason == "Done"
assert resp.status == 200
+ def test_multiline_reason(self) -> None:
+ with pytest.raises(ValueEr... | null | null | namanjain12/aiohttp_final:88f383427e918360fd2762a9a3256897159e2d6b | true | null | 3 | 5 | null | 935 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1725 | 75.68625 | ||
9,947 | swe_bench::test::1687 | swe_bench | test | 1,687 | scikit-learn__scikit-learn-25443 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 677a4cfef679313cd437c6af9e0398a22df73ab6 | With MLPClassifer, when warm_start is True or coeffs_ are provided, fit doesn’t respect max_iters
#### Description
With MLPClassifer, when warm_start is True or coeffs_ are provided, fit doesn’t respect max_iters. The reason for this is, when fitting, max iteration check is equality (==) against self.n_iter_. When warm... | I would like to investigate this.
Just change the **random_state** parameter to **0** i.e. **random_state=_0_**. This will give you the same result
@Julisam sorry I don't follow.
I think ``max_iter`` should probably be the total number of calls for consistency with ``RandomForest`` (and gradient boosting?). That means ... | diff --git a/sklearn/neural_network/_multilayer_perceptron.py b/sklearn/neural_network/_multilayer_perceptron.py
--- a/sklearn/neural_network/_multilayer_perceptron.py
+++ b/sklearn/neural_network/_multilayer_perceptron.py
@@ -607,6 +607,7 @@ def _fit_stochastic(
batch_size = np.clip(self.batch_size, 1, n_... | diff --git a/sklearn/neural_network/tests/test_mlp.py b/sklearn/neural_network/tests/test_mlp.py
--- a/sklearn/neural_network/tests/test_mlp.py
+++ b/sklearn/neural_network/tests/test_mlp.py
@@ -752,7 +752,7 @@ def test_warm_start_full_iteration(MLPEstimator):
clf.fit(X, y)
assert max_iter == clf.n_iter_
... | ["sklearn/neural_network/tests/test_mlp.py::test_warm_start_full_iteration[MLPClassifier]", "sklearn/neural_network/tests/test_mlp.py::test_warm_start_full_iteration[MLPRegressor]", "sklearn/neural_network/tests/test_mlp.py::test_mlp_warm_start_no_convergence[sgd-MLPClassifier]", "sklearn/neural_network/tests/test_mlp.... | ["sklearn/neural_network/tests/test_mlp.py::test_alpha", "sklearn/neural_network/tests/test_mlp.py::test_fit", "sklearn/neural_network/tests/test_mlp.py::test_gradient", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification[X0-y0]", "sklearn/neural_network/tests/test_mlp.py::test_lbfgs_classification[X1-... | null | true | 2023-01-20T14:46:21Z | 1 | 1 | 6 | 1,997 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.336167 | 75.6835 | |
9,948 | r2e_gym::train::5751 | r2e_gym | train | 5,751 | scrapy__5ad64204ac0c477246331e9db72024fb37b569bc | scrapy | scrapy/scrapy | python | 5ad64204ac0c477246331e9db72024fb37b569bc | **Title:** TypeError When Creating Item Subclasses Due to Missing `__classcell__` in Python 3.6
**Description:**
When defining a subclass of `Item` using the `ItemMeta` metaclass in Python 3.6, a `TypeError` is raised because the `__classcell__` attribute is not properly propagated. This prevents the subclass from bei... | diff --git a/scrapy/item.py b/scrapy/item.py
--- a/scrapy/item.py
+++ b/scrapy/item.py
@@ -25,6 +25,7 @@
class ItemMeta(ABCMeta):
def __new__(mcs, class_name, bases, attrs):
+ classcell = attrs.pop('__classcell__', None)
new_bases = tuple(base._class for base in bases if hasattr(base, '_class'))... | diff --git a/tests/test_item.py b/tests/test_item.py
--- a/tests/test_item.py
+++ b/tests/test_item.py
@@ -1,7 +1,13 @@
+import sys
import unittest
-from scrapy.item import Item, Field
import six
+
+from scrapy.item import ABCMeta, Item, ItemMeta, Field
+from tests import mock
+
+
+PY36_PLUS = (sys.version_info.maj... | null | null | namanjain12/scrapy_final:5ad64204ac0c477246331e9db72024fb37b569bc | true | null | 1 | 3 | null | 965 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.170833 | 75.68125 | ||
9,949 | r2e_gym::train::5432 | r2e_gym | train | 5,432 | aiohttp__d58d2c3d0f8755dcd982071e3dc12e9f14db55f6 | aiohttp | aio-libs/aiohttp | python | d58d2c3d0f8755dcd982071e3dc12e9f14db55f6 | **Title:** StreamWriter Zero Copy Writes Cause Incomplete Compressed Chunked Data
**Description:**
When using the `StreamWriter` with compression and chunking enabled, zero copy writes result in incomplete or empty data being sent. This leads to failures in tests that verify the integrity of compressed chunked data.
... | diff --git a/CHANGES/10125.bugfix.rst b/CHANGES/10125.bugfix.rst
--- a/CHANGES/10125.bugfix.rst
+++ b/CHANGES/10125.bugfix.rst
@@ -0,0 +1 @@
+Disabled zero copy writes in the ``StreamWriter`` -- by :user:`bdraco`.
diff --git a/aiohttp/http_writer.py b/aiohttp/http_writer.py
--- a/aiohttp/http_writer.py
+++ b/aiohttp/ht... | diff --git a/tests/test_http_writer.py b/tests/test_http_writer.py
--- a/tests/test_http_writer.py
+++ b/tests/test_http_writer.py
@@ -123,16 +123,15 @@
assert transport.write.called # type: ignore[attr-defined]
chunks = [c[1][0] for c in list(transport.write.mock_calls)] # type: ignore[attr-defined]
t... | null | null | namanjain12/aiohttp_final:d58d2c3d0f8755dcd982071e3dc12e9f14db55f6 | true | null | 2 | 3 | null | 963 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1705 | 75.68025 | ||
9,950 | r2e_gym::train::4099 | r2e_gym | train | 4,099 | coveragepy__5c3d0946821118ad11f5b10753c638a446f24bfe | coveragepy | nedbat/coveragepy | python | 5c3d0946821118ad11f5b10753c638a446f24bfe | **Title:** AttributeError When Parsing Decorated Docstring-Only Functions
**Description:**
When parsing functions that contain only docstrings and are decorated, an `AttributeError` is raised because the `PYBEHAVIOR` configuration lacks the `docstring_only_function` attribute. This prevents the parser from correctly h... | diff --git a/coverage/env.py b/coverage/env.py
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -82,6 +82,9 @@
# affect the outcome.
actual_syspath0_dash_m = CPYTHON and (PYVERSION >= (3, 7, 0, 'beta', 3))
+ # 3.7 changed how functions with only docstrings are numbered.
+ docstring_only_function = (not ... | diff --git a/tests/test_parser.py b/tests/test_parser.py
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -214,7 +214,7 @@
expected_arcs = set(arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8"))
expected_exits = {1: 1, 2: 1, 4: 1, 8: 1, 10: 1}
- if (not env.PYPY) and (env.PYVERSION >... | null | null | namanjain12/coveragepy_final:5c3d0946821118ad11f5b10753c638a446f24bfe | true | null | 1 | 3 | null | 956 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.169333 | 75.67675 | ||
9,951 | swe_bench::test::1364 | swe_bench | test | 1,364 | pylint-dev__pylint-8169 | pylint-dev/pylint | pylint-dev/pylint | python | 4689b195d8539ef04fd0c30423037a5f4932a20f | False positive `no-name-in-module` when importing from ``from ccxt.base.errors`` even when using the ``ignored-modules`` option
### Bug description
Simply importing exceptions from the [`ccxt`](https://github.com/ccxt/ccxt) library is giving this error. Here's an example of how we import them:
```python
from ccxt.bas... | Could you upgrade to at least 2.15.10 (better yet 2.16.0b1) and confirm the issue still exists, please ?
Tried with
```
pylint 2.15.10
astroid 2.13.4
Python 3.9.16 (main, Dec 7 2022, 10:16:11)
[Clang 14.0.0 (clang-1400.0.29.202)]
```
and also with pylint 2.16.0b1 and I still get the same issue.
Thank you ! I ... | diff --git a/pylint/checkers/variables.py b/pylint/checkers/variables.py
--- a/pylint/checkers/variables.py
+++ b/pylint/checkers/variables.py
@@ -2933,7 +2933,7 @@ def _check_module_attrs(
break
try:
module = next(module.getattr(name)[0].infer())
- if modul... | diff --git a/tests/regrtest_data/pkg_mod_imports/__init__.py b/tests/regrtest_data/pkg_mod_imports/__init__.py
new file mode 100644
--- /dev/null
+++ b/tests/regrtest_data/pkg_mod_imports/__init__.py
@@ -0,0 +1,6 @@
+base = [
+ 'Exchange',
+ 'Precise',
+ 'exchanges',
+ 'decimal_to_precision',
+]
diff --git ... | ["tests/test_self.py::TestRunTC::test_no_name_in_module"] | ["tests/test_self.py::TestRunTC::test_pkginfo", "tests/test_self.py::TestRunTC::test_all", "tests/test_self.py::TestRunTC::test_no_ext_file", "tests/test_self.py::TestRunTC::test_w0704_ignored", "tests/test_self.py::TestRunTC::test_exit_zero", "tests/test_self.py::TestRunTC::test_nonexistent_config_file", "tests/test_s... | null | true | 2023-02-02T12:18:35Z | 1 | 2 | 1 | 1,960 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.333333 | 75.675 | |
9,952 | r2e_gym::train::5811 | r2e_gym | train | 5,811 | tornado__c3c263de0a7b627af4ea3b729a32acd2ddd99d38 | tornado | tornadoweb/tornado | python | c3c263de0a7b627af4ea3b729a32acd2ddd99d38 | **Title:** Missing default User-Agent in Simple HTTP Client When Not Provided
**Description:**
When using the simple HTTP client to make requests without specifying a `User-Agent` header, the client does not set any default `User-Agent`. As a result, the server receives requests without this header, leading to unexpec... | diff --git a/tornado/simple_httpclient.py b/tornado/simple_httpclient.py
--- a/tornado/simple_httpclient.py
+++ b/tornado/simple_httpclient.py
@@ -1,5 +1,5 @@
from tornado.escape import _unicode
-from tornado import gen
+from tornado import gen, version
from tornado.httpclient import (
HTTPResponse,
HTTPErr... | diff --git a/tornado/test/simple_httpclient_test.py b/tornado/test/simple_httpclient_test.py
--- a/tornado/test/simple_httpclient_test.py
+++ b/tornado/test/simple_httpclient_test.py
@@ -10,7 +10,7 @@
import typing # noqa: F401
from tornado.escape import to_unicode, utf8
-from tornado import gen
+from tornado impo... | null | null | namanjain12/tornado_final:c3c263de0a7b627af4ea3b729a32acd2ddd99d38 | true | null | 1 | 4 | null | 912 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.165333 | 75.66475 | ||
9,953 | r2e_gym::train::5907 | r2e_gym | train | 5,907 | tornado__f4e652922553408ca0777127962f080724ce92c4 | tornado | tornadoweb/tornado | python | f4e652922553408ca0777127962f080724ce92c4 | **Title:** `gen.multi` Raises AssertionError When Handling Multiple `gen.moment` or `None`
**Description:**
When using `gen.multi` with multiple `gen.moment` instances or `None`, an `AssertionError` is raised. This occurs because `gen.multi` expects all yielded items to be real `Future` objects, but `gen.moment` retur... | diff --git a/tornado/gen.py b/tornado/gen.py
--- a/tornado/gen.py
+++ b/tornado/gen.py
@@ -814,6 +814,9 @@
else:
keys = None
children = list(map(convert_yielded, children))
+ # filter out NullFutures, like gen.moment
+ children = [child for child in children
+ if not isinstance(c... | 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
@@ -1598,6 +1598,16 @@
# coroutine finalizer was called (not on PyPy3 apparently)
self.assertIs(result[-1], None)
+ def test_multi_moment(self):
+ # Test g... | null | null | namanjain12/tornado_final:f4e652922553408ca0777127962f080724ce92c4 | true | null | 1 | 3 | null | 902 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.160333 | 75.64975 | ||
9,954 | r2e_gym::train::5039 | r2e_gym | train | 5,039 | datalad__4461fc9571573796e6250a3fb29db176ae7e52d0 | datalad | datalad/datalad | python | 4461fc9571573796e6250a3fb29db176ae7e52d0 | **Title:** Formatter Raises ValueError for Unsupported 'l' Conversion Specifier
**Description:**
When using the `Formatter` class to apply a lowercase conversion with the `!l` specifier, a `ValueError` is raised indicating an unknown conversion specifier. This behavior prevents the desired lowercase formatting in scen... | diff --git a/datalad/plugin/addurls.py b/datalad/plugin/addurls.py
--- a/datalad/plugin/addurls.py
+++ b/datalad/plugin/addurls.py
@@ -65,6 +65,11 @@
except KeyError:
return super(Formatter, self).get_value(
key, args, kwargs)
+
+ def convert_field(self, value, conversion):
+ ... | 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
@@ -33,6 +33,13 @@
fmt.format("{notinvals}", values, notinvals="ok") == "ok"
+def test_formatter_lower_case():
+ fmt = addurls.Format... | null | null | namanjain12/datalad_final:4461fc9571573796e6250a3fb29db176ae7e52d0 | true | null | 1 | 5 | null | 850 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.158333 | 75.64375 | ||
9,955 | r2e_gym::train::5171 | r2e_gym | train | 5,171 | pyramid__39846565d0d98a6a9ef2ef34faad3eb620b3e9fb | pyramid | pylons/pyramid | python | 39846565d0d98a6a9ef2ef34faad3eb620b3e9fb | **Title:** Registry object lacks `package_name` attribute, causing AttributeError
**Description:**
When creating a `Registry` instance with a specified package name, accessing the `package_name` attribute results in an `AttributeError`. This prevents users from retrieving the package name associated with the registry.... | diff --git a/pyramid/registry.py b/pyramid/registry.py
--- a/pyramid/registry.py
+++ b/pyramid/registry.py
@@ -5,6 +5,7 @@
from zope.interface.registry import Components
from pyramid.compat import text_
+from pyramid.decorator import reify
from pyramid.interfaces import (
ISettings,
@@ -41,6 +42,10 @@
... | diff --git a/pyramid/tests/test_registry.py b/pyramid/tests/test_registry.py
--- a/pyramid/tests/test_registry.py
+++ b/pyramid/tests/test_registry.py
@@ -11,6 +11,11 @@
def test___nonzero__(self):
registry = self._makeOne()
self.assertEqual(registry.__nonzero__(), True)
+
+ def test_package_n... | null | null | namanjain12/pyramid_final:39846565d0d98a6a9ef2ef34faad3eb620b3e9fb | true | null | 1 | 5 | null | 846 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.157667 | 75.64175 | ||
9,956 | r2e_gym::train::5726 | r2e_gym | train | 5,726 | scrapy__3f76853bd27d84f53ebaaa97cb819e8a29195a89 | scrapy | scrapy/scrapy | python | 3f76853bd27d84f53ebaaa97cb819e8a29195a89 | **Title:** AttributeError Occurs When Parsing Contracts with Invalid Annotation Format
**Description:**
When defining contract annotations in a spider's docstring, improperly formatted annotations can cause the contract parsing process to fail unexpectedly.
**Example Buggy Code:**
```python
class TestSpider(Spider):
... | diff --git a/scrapy/contracts/__init__.py b/scrapy/contracts/__init__.py
--- a/scrapy/contracts/__init__.py
+++ b/scrapy/contracts/__init__.py
@@ -120,7 +120,8 @@
if line.startswith("@"):
m = re.match(r"@(\w+)\s*(.*)", line)
- assert m is not None
+ if m is ... | diff --git a/tests/test_contracts.py b/tests/test_contracts.py
--- a/tests/test_contracts.py
+++ b/tests/test_contracts.py
@@ -182,6 +182,19 @@
"""
pass
+ def invalid_regex(self, response):
+ """method with invalid regex
+ @ Scrapy is awsome
+ """
+ pass
+
+ def inv... | null | null | namanjain12/scrapy_final:3f76853bd27d84f53ebaaa97cb819e8a29195a89 | true | null | 1 | 3 | null | 880 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.156667 | 75.63875 | ||
9,957 | r2e_gym::train::5948 | r2e_gym | train | 5,948 | tornado__7ebed4ac9c5ad8bedac6c8ce4c5d50fef401bf83 | tornado | tornadoweb/tornado | python | 7ebed4ac9c5ad8bedac6c8ce4c5d50fef401bf83 | **Semaphore Release Does Not Clear Waiters, Causing Acquire Test to Fail**
When releasing a semaphore, the internal waiters queue is not properly cleared. This leads to unexpected behavior where the semaphore retains waiters even after they should have been released, causing tests that expect no remaining waiters to f... | diff --git a/tornado/locks.py b/tornado/locks.py
--- a/tornado/locks.py
+++ b/tornado/locks.py
@@ -181,7 +181,8 @@
def release(self):
"""Increment the counter and wake one waiter."""
self._value += 1
- for waiter in self._waiters:
+ while self._waiters:
+ waiter = self._w... | diff --git a/tornado/test/locks_test.py b/tornado/test/locks_test.py
--- a/tornado/test/locks_test.py
+++ b/tornado/test/locks_test.py
@@ -248,6 +248,7 @@
sem.release()
# Now acquire() is instant.
self.assertTrue(sem.acquire().done())
+ self.assertEqual(0, len(sem._waiters))
@ge... | null | null | namanjain12/tornado_final:7ebed4ac9c5ad8bedac6c8ce4c5d50fef401bf83 | true | null | 1 | 3 | null | 857 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.152833 | 75.62725 | ||
9,958 | r2e_gym::train::5928 | r2e_gym | train | 5,928 | tornado__7cb24cfbe1bf5bf9aeebdbffe856ac5e67c4a7fb | tornado | tornadoweb/tornado | python | 7cb24cfbe1bf5bf9aeebdbffe856ac5e67c4a7fb | **Title:** HTTPServerRequest `repr` Includes Headers, Potentially Exposing Sensitive Information
**Description:**
When creating an `HTTPServerRequest` with headers, the string representation (`repr`) of the request includes all headers. This behavior can inadvertently expose sensitive information contained within the ... | diff --git a/tornado/httputil.py b/tornado/httputil.py
--- a/tornado/httputil.py
+++ b/tornado/httputil.py
@@ -467,8 +467,7 @@
def __repr__(self):
attrs = ("protocol", "host", "method", "uri", "version", "remote_ip")
args = ", ".join(["%s=%r" % (n, getattr(self, n)) for n in attrs])
- retu... | 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
@@ -418,6 +418,10 @@
requets = HTTPServerRequest(uri='/')
self.assertIsInstance(requets.body, bytes)
+ def test_repr_does_not_contain_headers(self):
+... | null | null | namanjain12/tornado_final:7cb24cfbe1bf5bf9aeebdbffe856ac5e67c4a7fb | true | null | 1 | 3 | null | 852 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.152 | 75.62475 | ||
9,959 | r2e_gym::train::5675 | r2e_gym | train | 5,675 | scrapy__991197003bdf8e908aebe5ce39ceff353af7e016 | scrapy | scrapy/scrapy | python | 991197003bdf8e908aebe5ce39ceff353af7e016 | **Title:** TypeError Occurs When Hashing URL Strings in `file_path` Method
**Description:**
When generating file paths, passing a URL string directly to `hashlib.sha1` results in a `TypeError`. The `hashlib.sha1` function expects a bytes-like object, but a string is provided instead. This prevents the `file_path` met... | diff --git a/scrapy/pipelines/files.py b/scrapy/pipelines/files.py
--- a/scrapy/pipelines/files.py
+++ b/scrapy/pipelines/files.py
@@ -26,6 +26,7 @@
from scrapy.http import Request
from scrapy.utils.misc import md5sum
from scrapy.utils.log import failure_to_exc_info
+from scrapy.utils.python import to_bytes
logge... | diff --git a/tests/test_pipeline_files.py b/tests/test_pipeline_files.py
--- a/tests/test_pipeline_files.py
+++ b/tests/test_pipeline_files.py
@@ -12,6 +12,7 @@
from scrapy.item import Item, Field
from scrapy.http import Request, Response
from scrapy.settings import Settings
+from scrapy.utils.python import to_bytes... | null | null | namanjain12/scrapy_final:991197003bdf8e908aebe5ce39ceff353af7e016 | true | null | 1 | 3 | null | 837 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1495 | 75.61725 | ||
9,960 | r2e_gym::train::5916 | r2e_gym | train | 5,916 | tornado__99188df220c2efbdc4ff41838fcfa7a853d672fb | tornado | tornadoweb/tornado | python | 99188df220c2efbdc4ff41838fcfa7a853d672fb | ### Unhandled Exception in Callback Causes Async Operation to Timeout
**Description**
When using a `@return_future` function with a callback that raises an exception, the exception is not properly handled. Instead of propagating the error, the asynchronous operation times out.
**Example Buggy Code**
```python
@retu... | diff --git a/tornado/concurrent.py b/tornado/concurrent.py
--- a/tornado/concurrent.py
+++ b/tornado/concurrent.py
@@ -18,7 +18,7 @@
import functools
import sys
-from tornado.stack_context import ExceptionStackContext
+from tornado.stack_context import ExceptionStackContext, wrap
from tornado.util import raise_exc... | diff --git a/tornado/test/concurrent_test.py b/tornado/test/concurrent_test.py
--- a/tornado/test/concurrent_test.py
+++ b/tornado/test/concurrent_test.py
@@ -121,6 +121,12 @@
kwargs['callback'](42)
future = f()
self.assertEqual(future.result(), 42)
+
+ def test_error_in_callback(self)... | null | null | namanjain12/tornado_final:99188df220c2efbdc4ff41838fcfa7a853d672fb | true | null | 1 | 4 | null | 812 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.148667 | 75.61475 | ||
9,961 | r2e_gym::train::5372 | r2e_gym | train | 5,372 | aiohttp__64f5fe2c23b9b6aa35a231e9d95c267f26e28c24 | aiohttp | aio-libs/aiohttp | python | 64f5fe2c23b9b6aa35a231e9d95c267f26e28c24 | **Title:** HTTP Headers with Non-ASCII Characters Cause Encoding Errors
**Description:**
When adding HTTP headers that include non-ASCII characters, attempting to send these headers results in a `UnicodeEncodeError`. This issue arises because the headers are being encoded using the 'ascii' codec, which cannot handle c... | diff --git a/aiohttp/protocol.py b/aiohttp/protocol.py
--- a/aiohttp/protocol.py
+++ b/aiohttp/protocol.py
@@ -575,8 +575,10 @@
removes hop headers, etc."""
assert not self.headers_sent, 'headers have been sent already'
assert isinstance(name, str), '{!r} is not a string'.format(name)
+ ... | diff --git a/tests/test_http_protocol.py b/tests/test_http_protocol.py
--- a/tests/test_http_protocol.py
+++ b/tests/test_http_protocol.py
@@ -66,6 +66,20 @@
msg.add_header('content-type', 'plain/html')
self.assertEqual([('CONTENT-TYPE', 'plain/html')], list(msg.headers))
+
+ def test_add_header_... | null | null | namanjain12/aiohttp_final:64f5fe2c23b9b6aa35a231e9d95c267f26e28c24 | true | null | 1 | 4 | null | 809 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.148167 | 75.61325 | ||
9,962 | r2e_gym::train::5010 | r2e_gym | train | 5,010 | datalad__68c56799e9c05a5e7463922584396ad4e511401e | datalad | datalad/datalad | python | 68c56799e9c05a5e7463922584396ad4e511401e | **Title:** `--version` Command Displays License Information Alongside Version
**Description:**
When executing the `datalad --version` command, it currently outputs both the version number and the license information. This behavior is unexpected as the `--version` flag should ideally display only the version of the pro... | diff --git a/datalad/cmdline/common_args.py b/datalad/cmdline/common_args.py
--- a/datalad/cmdline/common_args.py
+++ b/datalad/cmdline/common_args.py
@@ -29,7 +29,7 @@
version = (
'version', ('--version',),
dict(action='version',
- help="show the program's version and license information")
+ ... | diff --git a/datalad/cmdline/tests/test_main.py b/datalad/cmdline/tests/test_main.py
--- a/datalad/cmdline/tests/test_main.py
+++ b/datalad/cmdline/tests/test_main.py
@@ -81,8 +81,9 @@
# https://hg.python.org/cpython/file/default/Doc/whatsnew/3.4.rst#l1952
out = stdout if sys.version_info >= (3, 4) else stder... | null | null | namanjain12/datalad_final:68c56799e9c05a5e7463922584396ad4e511401e | true | null | 2 | 4 | null | 800 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.146667 | 75.60875 | ||
9,963 | r2e_gym::train::5336 | r2e_gym | train | 5,336 | aiohttp__d9a9368f0923e1447231880075271e7fe38683d8 | aiohttp | aio-libs/aiohttp | python | d9a9368f0923e1447231880075271e7fe38683d8 | **Title:** FormData Constructor Raises TypeError When Using `default_to_multipart` Parameter
**Description:**
When attempting to initialize a `FormData` object with the `default_to_multipart` parameter, a `TypeError` is raised because the constructor does not recognize this argument.
**Example Code:**
```python
form ... | diff --git a/CHANGES/9335.feature.rst b/CHANGES/9335.feature.rst
--- a/CHANGES/9335.feature.rst
+++ b/CHANGES/9335.feature.rst
@@ -0,0 +1 @@
+Added ``default_to_multipart`` parameter to ``FormData``.
diff --git a/aiohttp/formdata.py b/aiohttp/formdata.py
--- a/aiohttp/formdata.py
+++ b/aiohttp/formdata.py
@@ -23,11 +23... | diff --git a/tests/test_formdata.py b/tests/test_formdata.py
--- a/tests/test_formdata.py
+++ b/tests/test_formdata.py
@@ -25,10 +25,18 @@
def test_formdata_multipart(buf: bytearray) -> None:
- form = FormData()
+ form = FormData(default_to_multipart=False)
assert not form.is_multipart
form.add_f... | null | null | namanjain12/aiohttp_final:d9a9368f0923e1447231880075271e7fe38683d8 | true | null | 2 | 5 | null | 770 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.145 | 75.60375 | ||
9,964 | r2e_gym::train::292 | r2e_gym | train | 292 | orange3__277969995213592595e95a16e62993b086c83709 | orange3 | biolab/orange3 | python | 277969995213592595e95a16e62993b086c83709 | **Title:** Calibration Plot Crashes When Folds Are Empty
**Description:**
When the Calibration Plot widget receives evaluation results with no folds (i.e., `folds` is `None`), it crashes unexpectedly. This occurs because the widget attempts to determine the length of `folds` without first checking if it is `None`.
**... | diff --git a/Orange/widgets/evaluate/owcalibrationplot.py b/Orange/widgets/evaluate/owcalibrationplot.py
--- a/Orange/widgets/evaluate/owcalibrationplot.py
+++ b/Orange/widgets/evaluate/owcalibrationplot.py
@@ -487,7 +487,7 @@
if results is not None:
problems = [
msg for condition... | diff --git a/Orange/widgets/evaluate/tests/test_owcalibrationplot.py b/Orange/widgets/evaluate/tests/test_owcalibrationplot.py
--- a/Orange/widgets/evaluate/tests/test_owcalibrationplot.py
+++ b/Orange/widgets/evaluate/tests/test_owcalibrationplot.py
@@ -1,5 +1,6 @@
import copy
import warnings
+import unittest
from ... | null | null | namanjain12/orange3_final:277969995213592595e95a16e62993b086c83709 | true | null | 2 | 5 | null | 767 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1445 | 75.60225 | ||
9,965 | r2e_gym::train::5271 | r2e_gym | train | 5,271 | aiohttp__ea47a46f5f9008a1ab44279c41debe609d568282 | aiohttp | aio-libs/aiohttp | python | ea47a46f5f9008a1ab44279c41debe609d568282 | **Title:** `__repr__` of `MultiDict` Fails to Display All Items with Multiple Values per Key
**Description:**
The `__repr__` method of both `MultiDict` and `MutableMultiDict` does not correctly display all items when a key has multiple values. Instead of showing every key-value pair, it only shows the first occurrence... | diff --git a/aiohttp/multidict.py b/aiohttp/multidict.py
--- a/aiohttp/multidict.py
+++ b/aiohttp/multidict.py
@@ -102,7 +102,8 @@
def __repr__(self):
return '<{}>\n{}'.format(
self.__class__.__name__, pprint.pformat(
- list(self.items())))
+ list(self.items(geta... | diff --git a/tests/test_multidict.py b/tests/test_multidict.py
--- a/tests/test_multidict.py
+++ b/tests/test_multidict.py
@@ -58,7 +58,8 @@
def test_getone(self):
d = self.make_dict([('key', 'value1')], key='value2')
- self.assertEqual(d.getone('key'), 'value1')
+ with self.assertRaises(K... | null | null | namanjain12/aiohttp_final:ea47a46f5f9008a1ab44279c41debe609d568282 | true | null | 1 | 3 | null | 803 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.143833 | 75.60025 | ||
9,966 | r2e_gym::train::5684 | r2e_gym | train | 5,684 | scrapy__99cddecd2812b142dc9d7fb05870745b6595896b | scrapy | scrapy/scrapy | python | 99cddecd2812b142dc9d7fb05870745b6595896b | **Title:** Crash Occurs When No Spider Matches the Provided URL
**Description:**
When using the `parse` command with a URL that doesn't match any existing spider, the application crashes unexpectedly. This happens because it attempts to set the `start_requests` method on a `NoneType` object when no spider is found.
*... | diff --git a/scrapy/commands/parse.py b/scrapy/commands/parse.py
--- a/scrapy/commands/parse.py
+++ b/scrapy/commands/parse.py
@@ -146,7 +146,8 @@
def _start_requests(spider):
yield self.prepare_request(spider, Request(url), opts)
- self.spidercls.start_requests = _start_requests
+ ... | diff --git a/tests/test_command_parse.py b/tests/test_command_parse.py
--- a/tests/test_command_parse.py
+++ b/tests/test_command_parse.py
@@ -1,6 +1,7 @@
import os
import argparse
from os.path import join, abspath, isfile, exists
+
from twisted.internet import defer
from scrapy.commands import parse
from scrapy.... | null | null | namanjain12/scrapy_final:99cddecd2812b142dc9d7fb05870745b6595896b | true | null | 1 | 3 | null | 801 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1435 | 75.59925 | ||
9,967 | r2e_gym::train::5481 | r2e_gym | train | 5,481 | aiohttp__c0c3376e6699d0741424c43ac1b25beea366b1fd | aiohttp | aio-libs/aiohttp | python | c0c3376e6699d0741424c43ac1b25beea366b1fd | **Title:** TCPSite.name Raises Error When Host is an Empty String
**Description:**
When initializing a `TCPSite` with an empty string as the host, constructing the site's name results in a `ValueError`. The system attempts to build a URL with an empty host while specifying a port, which is invalid.
**Example Code:**
... | diff --git a/CHANGES/8929.bugfix.rst b/CHANGES/8929.bugfix.rst
--- a/CHANGES/8929.bugfix.rst
+++ b/CHANGES/8929.bugfix.rst
@@ -0,0 +1 @@
+Fixed ``Site.name`` when host is an empty string -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/web_runner.py b/aiohttp/web_runner.py
--- a/aiohttp/web_runner.py
+++ b/aiohttp/web... | diff --git a/tests/test_web_runner.py b/tests/test_web_runner.py
--- a/tests/test_web_runner.py
+++ b/tests/test_web_runner.py
@@ -243,6 +243,13 @@
assert port == 8080
+async def test_tcpsite_empty_str_host(make_runner: Any) -> None:
+ runner = make_runner()
+ await runner.setup()
+ site = web.TCPSite... | null | null | namanjain12/aiohttp_final:c0c3376e6699d0741424c43ac1b25beea366b1fd | true | null | 2 | 3 | null | 800 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.143333 | 75.59875 | ||
9,968 | r2e_gym::train::5886 | r2e_gym | train | 5,886 | tornado__8fdd57d272cb0885e3803d923f480ad483bc43d1 | tornado | tornadoweb/tornado | python | 8fdd57d272cb0885e3803d923f480ad483bc43d1 | **Title:** `locale.format_date` Raises `NameError` for `long` Type in Python 3
**Description:**
When using the `format_date` method from the `locale` module with a numeric timestamp, a `NameError` is raised in Python 3 due to the use of the undefined `long` type.
**Example Code:**
```python
import tornado.locale
impo... | diff --git a/tornado/locale.py b/tornado/locale.py
--- a/tornado/locale.py
+++ b/tornado/locale.py
@@ -43,6 +43,7 @@
import csv
import datetime
+import numbers
import os
import re
@@ -287,7 +288,7 @@
"""
if self.code.startswith("ru"):
relative = False
- if type(date) in (in... | diff --git a/tornado/test/locale_test.py b/tornado/test/locale_test.py
--- a/tornado/test/locale_test.py
+++ b/tornado/test/locale_test.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import, division, print_function, with_statement
+import datetime
import os
import tornado.locale
from tornado.escape import ut... | null | null | namanjain12/tornado_final:8fdd57d272cb0885e3803d923f480ad483bc43d1 | true | null | 1 | 3 | null | 800 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.143333 | 75.59875 | ||
9,969 | r2e_gym::train::5746 | r2e_gym | train | 5,746 | scrapy__9f7fcf5582ed61787180df20a62a301cc09fce4a | scrapy | scrapy/scrapy | python | 9f7fcf5582ed61787180df20a62a301cc09fce4a | **Title:** `update_classpath()` Raises AttributeError with Non-String Inputs
**Description:**
When the `update_classpath()` function is provided with a non-string object, it raises an `AttributeError` instead of handling the input gracefully.
**Example Code:**
```python
def test_handle_non_string_input():
non_str... | diff --git a/scrapy/utils/deprecate.py b/scrapy/utils/deprecate.py
--- a/scrapy/utils/deprecate.py
+++ b/scrapy/utils/deprecate.py
@@ -1,5 +1,6 @@
"""Some helpers for deprecation messages"""
+import six
import warnings
import inspect
from scrapy.exceptions import ScrapyDeprecationWarning
@@ -149,6 +150,8 @@
de... | diff --git a/tests/test_utils_deprecate.py b/tests/test_utils_deprecate.py
--- a/tests/test_utils_deprecate.py
+++ b/tests/test_utils_deprecate.py
@@ -279,3 +279,7 @@
output = update_classpath('scrapy.unmatched.Path')
self.assertEqual(output, 'scrapy.unmatched.Path')
self.assertEqual(len(... | null | null | namanjain12/scrapy_final:9f7fcf5582ed61787180df20a62a301cc09fce4a | true | null | 1 | 3 | null | 797 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.142833 | 75.59725 | ||
9,970 | swe_bench::test::1090 | swe_bench | test | 1,090 | matplotlib__matplotlib-25640 | matplotlib/matplotlib | matplotlib/matplotlib | python | 61ed3f40057a48821ccad758fd5f04f0df1b8aab | PGF output: Contour labels extend beyond figure boundary
### Bug report
**Bug summary**
When using contour plots with the PGF backend, contour labels close to the axes can protrude beyond the axis boundary. This was originally posted as a [question at StackOverflow](https://stackoverflow.com/q/50554835).
**Code for r... | I can confirm the issue on master (with Fedora 28, and Python 3.6 from conda).
Workflow to play with the issue:
1. a Python script `mwe.py` based on @Socob's snippet:
```python
import numpy as np
import matplotlib
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
mpl_version = matplotlib.__vers... | diff --git a/lib/matplotlib/backends/backend_pgf.py b/lib/matplotlib/backends/backend_pgf.py
--- a/lib/matplotlib/backends/backend_pgf.py
+++ b/lib/matplotlib/backends/backend_pgf.py
@@ -657,6 +657,7 @@ def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):
s = _escape_and_apply_props(s, prop... | diff --git a/lib/matplotlib/tests/test_backend_pgf.py b/lib/matplotlib/tests/test_backend_pgf.py
--- a/lib/matplotlib/tests/test_backend_pgf.py
+++ b/lib/matplotlib/tests/test_backend_pgf.py
@@ -67,6 +67,8 @@ def create_figure():
ha='right', fontsize=20)
plt.ylabel('sans-serif, blue, $\\frac{\\sqrt{x... | ["lib/matplotlib/tests/test_backend_pgf.py::test_xelatex[pdf]", "lib/matplotlib/tests/test_backend_pgf.py::test_pdflatex[pdf]"] | ["lib/matplotlib/tests/test_backend_pgf.py::test_tex_special_chars", "lib/matplotlib/tests/test_backend_pgf.py::test_pathclip", "lib/matplotlib/tests/test_backend_pgf.py::test_mixedmode[pdf]", "lib/matplotlib/tests/test_backend_pgf.py::test_bbox_inches", "lib/matplotlib/tests/test_backend_pgf.py::test_pdf_pages[lualate... | null | true | 2023-04-07T06:09:01Z | 1 | 1 | 2 | 1,820 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.306667 | 75.595 | |
9,971 | r2e_gym::train::5115 | r2e_gym | train | 5,115 | pyramid__67ff3b9ce4bcaceeee90f2aa4ae900d9220cac8b | pyramid | pylons/pyramid | python | 67ff3b9ce4bcaceeee90f2aa4ae900d9220cac8b | **Title:** TypeError When Initializing Session with String Timeout
**Description:**
Initializing a session with the `timeout` parameter as a string results in a `TypeError`. This occurs because the code attempts to compare a float with a string, which is not supported.
**Example Code:**
```python
request = testing.Du... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -254,3 +254,5 @@
- Jesse Dhillon, 2015/10/07
- Amos Latteier, 2015/10/22
+
+- Rami Chousein, 2015/10/28
diff --git a/pyramid/session.py b/pyramid/session.py
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -244,7 +... | 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
@@ -61,6 +61,22 @@
request.cookies['session'] = cookieval
session = self._makeOne(request, timeout=None)
self.assertEqual(dict(session), {'state':... | null | null | namanjain12/pyramid_final:67ff3b9ce4bcaceeee90f2aa4ae900d9220cac8b | true | null | 2 | 4 | null | 755 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.139167 | 75.58625 | ||
9,972 | r2e_gym::train::5814 | r2e_gym | train | 5,814 | tornado__eab34a911f956b8a0e7076bb6817bcdea5f7c44f | tornado | tornadoweb/tornado | python | eab34a911f956b8a0e7076bb6817bcdea5f7c44f | **Title:** HTTPServerRequest.body is initialized as a string instead of bytes
**Description:**
When an `HTTPServerRequest` is created without providing a body, the `body` attribute is set to an empty string. This causes type inconsistencies since other parts of the system expect the body to always be a byte string.
*... | diff --git a/tornado/httputil.py b/tornado/httputil.py
--- a/tornado/httputil.py
+++ b/tornado/httputil.py
@@ -331,7 +331,7 @@
self.uri = uri
self.version = version
self.headers = headers or HTTPHeaders()
- self.body = body or ""
+ self.body = body or b""
# set remote... | 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
@@ -264,6 +264,10 @@
# more required parameters slip in.
HTTPServerRequest(uri='/')
+ def test_body_is_a_byte_string(self):
+ requets = HTTPSer... | null | null | namanjain12/tornado_final:eab34a911f956b8a0e7076bb6817bcdea5f7c44f | true | null | 2 | 4 | null | 749 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.138167 | 75.58325 | ||
9,973 | r2e_gym::train::5790 | r2e_gym | train | 5,790 | tornado__13aa5a18568b9a3bcdfa9be518f87339311c7ad3 | tornado | tornadoweb/tornado | python | 13aa5a18568b9a3bcdfa9be518f87339311c7ad3 | **Title:** NameError When Using `multiple=True` Options with `type=int` on Python 3
**Description:**
When defining an option with `multiple=True` and specifying `type=int`, parsing the command line in Python 3 results in a `NameError`. This error occurs because the code references `long`, which is not defined in Pytho... | diff --git a/tornado/options.py b/tornado/options.py
--- a/tornado/options.py
+++ b/tornado/options.py
@@ -61,6 +61,7 @@
from __future__ import absolute_import, division, print_function, with_statement
import datetime
+import numbers
import re
import sys
import os
@@ -339,7 +340,7 @@
if self.multiple:
... | diff --git a/tornado/test/options_test.py b/tornado/test/options_test.py
--- a/tornado/test/options_test.py
+++ b/tornado/test/options_test.py
@@ -1,9 +1,11 @@
from __future__ import absolute_import, division, print_function, with_statement
+import datetime
import os
import sys
from tornado.options import Optio... | null | null | namanjain12/tornado_final:13aa5a18568b9a3bcdfa9be518f87339311c7ad3 | true | null | 1 | 3 | null | 747 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1345 | 75.57225 | ||
9,974 | r2e_gym::train::5647 | r2e_gym | train | 5,647 | scrapy__439a3e59b8e858441f8d97dbc32f398db392330d | scrapy | scrapy/scrapy | python | 439a3e59b8e858441f8d97dbc32f398db392330d | **Title:** LocalCache raises TypeError when no limit is set
**Description:**
When initializing `LocalCache` without specifying a limit, adding items results in a `TypeError`. This occurs because the cache attempts to compare its length with `self.limit`, which is `None`.
**Example Code:**
```python
cache = LocalCache... | diff --git a/scrapy/utils/datatypes.py b/scrapy/utils/datatypes.py
--- a/scrapy/utils/datatypes.py
+++ b/scrapy/utils/datatypes.py
@@ -315,8 +315,9 @@
self.limit = limit
def __setitem__(self, key, value):
- while len(self) >= self.limit:
- self.popitem(last=False)
+ if self.limi... | diff --git a/tests/test_utils_datatypes.py b/tests/test_utils_datatypes.py
--- a/tests/test_utils_datatypes.py
+++ b/tests/test_utils_datatypes.py
@@ -7,7 +7,7 @@
else:
from collections.abc import Mapping, MutableMapping
-from scrapy.utils.datatypes import CaselessDict, SequenceExclude
+from scrapy.utils.dataty... | null | null | namanjain12/scrapy_final:439a3e59b8e858441f8d97dbc32f398db392330d | true | null | 1 | 5 | null | 694 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.132333 | 75.56575 | ||
9,975 | swe_bench::dev::153 | swe_bench | dev | 153 | pylint-dev__astroid-927 | pylint-dev/astroid | pylint-dev/astroid | python | cd8b6a43192724128af68605ef22aabf3254f495 | infer_stmts cannot infer multiple uses of the same AssignName
Given multiple assignments to the same target which both reference the same AssignName, infer_stmts fails for subsequent attempts after the first.
### Steps to reproduce
This appears to be a minimum working example, removing any part removes the effect:
`... | It appears that this is caused by `InferenceContext` maintaining a strong reference to the mutable set that is shared between clones, see this simplified example:
```python
class Context:
def __init__(self, path=None):
self.path = path or set()
def clone(self):
return Context(path=self.p... | diff --git a/astroid/context.py b/astroid/context.py
--- a/astroid/context.py
+++ b/astroid/context.py
@@ -102,7 +102,7 @@ def clone(self):
starts with the same context but diverge as each side is inferred
so the InferenceContext will need be cloned"""
# XXX copy lookupname/callcontext ?
- ... | diff --git a/tests/unittest_brain_numpy_core_umath.py b/tests/unittest_brain_numpy_core_umath.py
--- a/tests/unittest_brain_numpy_core_umath.py
+++ b/tests/unittest_brain_numpy_core_umath.py
@@ -14,7 +14,7 @@
except ImportError:
HAS_NUMPY = False
-from astroid import bases, builder, nodes, util
+from astroid im... | ["tests/unittest_inference.py::InferenceTest::test_stop_iteration_leak", "tests/unittest_inference.py::test_issue926_infer_stmts_referencing_same_name_is_not_uninferable", "tests/unittest_inference.py::test_issue926_binop_referencing_same_name_is_not_uninferable"] | ["tests/unittest_inference.py::InferenceUtilsTest::test_path_wrapper", "tests/unittest_inference.py::InferenceTest::test__new__", "tests/unittest_inference.py::InferenceTest::test__new__bound_methods", "tests/unittest_inference.py::InferenceTest::test_advanced_tupleassign_name_inference1", "tests/unittest_inference.py:... | null | true | 2021-03-29T12:55:48Z | 1 | 2 | 3 | 1,708 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.291333 | 75.549 | |
9,976 | swe_bench::dev::213 | swe_bench | dev | 213 | sqlfluff__sqlfluff-4764 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | a820c139ccbe6d1865d73c4a459945cd69899f8f | Enable quiet mode/no-verbose in CLI for use in pre-commit hook
There seems to be only an option to increase the level of verbosity when using SQLFluff [CLI](https://docs.sqlfluff.com/en/stable/cli.html), not to limit it further.
It would be great to have an option to further limit the amount of prints when running `sq... | diff --git a/src/sqlfluff/cli/commands.py b/src/sqlfluff/cli/commands.py
--- a/src/sqlfluff/cli/commands.py
+++ b/src/sqlfluff/cli/commands.py
@@ -44,6 +44,7 @@
dialect_selector,
dialect_readout,
)
+from sqlfluff.core.linter import LintingResult
from sqlfluff.core.config import progress_bar_configuration
... | diff --git a/test/cli/commands_test.py b/test/cli/commands_test.py
--- a/test/cli/commands_test.py
+++ b/test/cli/commands_test.py
@@ -557,6 +557,18 @@ def test__cli__command_lint_parse(command):
),
1,
),
+ # Test that setting --quiet with --verbose raises an error.
+ (
... | ["test/cli/commands_test.py::test__cli__fix_multiple_errors_quiet_force", "test/cli/commands_test.py::test__cli__fix_multiple_errors_quiet_no_force"] | ["test/cli/commands_test.py::test__cli__command_directed", "test/cli/commands_test.py::test__cli__command_dialect", "test/cli/commands_test.py::test__cli__command_no_dialect", "test/cli/commands_test.py::test__cli__command_parse_error_dialect_explicit_warning", "test/cli/commands_test.py::test__cli__command_parse_error... | null | true | 2023-04-16T14:24:42Z | 3 | 106 | 2 | 765 | 0 | 0.8 | 1 | 0.4 | 1 | 0.480833 | 75.5425 | ||
9,977 | r2e_gym::train::5560 | r2e_gym | train | 5,560 | aiohttp__d7cd0613472fd4d9940e37f1c55921f6a1515324 | aiohttp | aio-libs/aiohttp | python | d7cd0613472fd4d9940e37f1c55921f6a1515324 | **Title**: FormData Accepts Non-String Values Without Raising TypeError
**Description**:
When non-string values are included in form data, the system does not raise a `TypeError` as expected. This allows invalid data to pass through, potentially leading to unexpected behavior or errors during form processing.
**Examp... | diff --git a/CHANGES/9292.breaking.rst b/CHANGES/9292.breaking.rst
--- a/CHANGES/9292.breaking.rst
+++ b/CHANGES/9292.breaking.rst
@@ -0,0 +1 @@
+Started rejecting non string values in `FormData`, to avoid unexpected results -- by :user:`Dreamsorcerer`.
diff --git a/aiohttp/formdata.py b/aiohttp/formdata.py
--- a/aioht... | 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
@@ -205,6 +205,12 @@
("h1", "v2"),
("h2", "header2"),
]
+
+
+@pytest.mark.parametrize("obj", (object(), None))
+async def test_invalid_data(session: Clien... | null | null | namanjain12/aiohttp_final:d7cd0613472fd4d9940e37f1c55921f6a1515324 | true | null | 2 | 3 | null | 675 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1225 | 75.53625 | ||
9,978 | r2e_gym::train::4968 | r2e_gym | train | 4,968 | datalad__bc838e2a58128d9d63f10b2447d8c89cb1ec1ac8 | datalad | datalad/datalad | python | bc838e2a58128d9d63f10b2447d8c89cb1ec1ac8 | **Title:** Comparing `FileStatus` with `None` Raises AttributeError
**Description:**
When attempting to compare a `FileStatus` instance with `None`, an `AttributeError` is raised. This occurs because the comparison logic tries to access attributes of `None`, which does not have the expected attributes.
**Example Code... | diff --git a/datalad/support/status.py b/datalad/support/status.py
--- a/datalad/support/status.py
+++ b/datalad/support/status.py
@@ -27,6 +27,9 @@
self.filename = filename
def __eq__(self, other):
+ # If other is still None, we must be different
+ if not other:
+ return False
... | diff --git a/datalad/support/tests/test_status.py b/datalad/support/tests/test_status.py
--- a/datalad/support/tests/test_status.py
+++ b/datalad/support/tests/test_status.py
@@ -20,6 +20,9 @@
assert_not_equal(FileStatus(mtime=0.2), FileStatus(mtime=0.1))
assert_not_equal(FileStatus(mtime=0.2), FileStatus(mti... | null | null | namanjain12/datalad_final:bc838e2a58128d9d63f10b2447d8c89cb1ec1ac8 | true | null | 1 | 3 | null | 663 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.1205 | 75.53025 | ||
9,979 | swe_bench::test::1664 | swe_bench | test | 1,664 | scikit-learn__scikit-learn-15094 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 871b25162339c60557e5bf1754ea553ec33adf52 | MaxAbsScaler Upcasts Pandas to float64
#### Description
I am working with the Column transformer, and for memory issues, am trying to produce a float32 sparse matrix. Unfortunately, regardless of pandas input type, the output is always float64.
I've identified one of the Pipeline scalers, MaxAbsScaler, as being the c... | It should probably be preserving dtype. It doesn't look like this issue
should result from check_array, which looks like it is set up to preserve
dtype in MaxAbsScaler.
Can you please confirm that this is still an issue in scikit-learn 0.21
(you have an old version)?
Thanks for the quick response!
Same issue with 0... | diff --git a/sklearn/utils/validation.py b/sklearn/utils/validation.py
--- a/sklearn/utils/validation.py
+++ b/sklearn/utils/validation.py
@@ -453,6 +453,8 @@ def check_array(array, accept_sparse=False, accept_large_sparse=True,
dtypes_orig = None
if hasattr(array, "dtypes") and hasattr(array.dtypes, '__array... | diff --git a/sklearn/utils/tests/test_validation.py b/sklearn/utils/tests/test_validation.py
--- a/sklearn/utils/tests/test_validation.py
+++ b/sklearn/utils/tests/test_validation.py
@@ -42,7 +42,8 @@
_num_samples,
check_scalar,
_check_sample_weight,
- _allclose_dense_sparse)
+ _allclose_dense_spar... | ["sklearn/utils/tests/test_validation.py::test_check_array_pandas_dtype_casting"] | ["sklearn/utils/tests/test_validation.py::test_as_float_array", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X0]", "sklearn/utils/tests/test_validation.py::test_as_float_array_nan[X1]", "sklearn/utils/tests/test_validation.py::test_np_matrix", "sklearn/utils/tests/test_validation.py::test_memmap", "... | null | true | 2019-09-25T22:03:47Z | 1 | 2 | 1 | 1,592 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.272 | 75.491 | |
9,980 | r2e_gym::train::4935 | r2e_gym | train | 4,935 | datalad__780a6b14a620808dfe09c8d23d3eeb208eb4fb58 | datalad | datalad/datalad | python | 780a6b14a620808dfe09c8d23d3eeb208eb4fb58 | **Title:** Installation path incorrectly returns empty string for URLs without a path
**Description:**
When providing a URL that lacks a path, the function responsible for extracting the installation path returns an empty string instead of the hostname.
**Example:**
```python
url = "http://hostname/"
installation_pat... | diff --git a/datalad/distribution/utils.py b/datalad/distribution/utils.py
--- a/datalad/distribution/utils.py
+++ b/datalad/distribution/utils.py
@@ -233,7 +233,8 @@
"""
ri = RI(url)
if isinstance(ri, (URL, DataLadRI)): # decode only if URL
- path = urlunquote(ri.path) or ri.hostname
+ pa... | diff --git a/datalad/distribution/tests/test_install.py b/datalad/distribution/tests/test_install.py
--- a/datalad/distribution/tests/test_install.py
+++ b/datalad/distribution/tests/test_install.py
@@ -101,6 +101,9 @@
'///d1/+last bit',
):
eq_(_get_installationpath_from_url(url), '+last bit')
+ ... | null | null | namanjain12/datalad_final:780a6b14a620808dfe09c8d23d3eeb208eb4fb58 | true | null | 1 | 3 | null | 558 | 0 | 0.75 | 1 | 0.6375 | 0.8 | 0.103 | 75.47775 | ||
9,981 | swe_bench::test::1496 | swe_bench | test | 1,496 | scikit-learn__scikit-learn-10377 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 5e26bf902621933bc8c7f3ce21c2085ee32651d3 | BUG Inconsistent f1_score behavior when combining label indicator input with labels attribute
#### Description
When using label indicator inputs for y_pred and y_true, metrics.f1_score calculates the macro average over all label-specific f-scores whenever the labels parameter includes column index 0. It should only ave... | Thanks for the clear issue description. Your diagnosis is not quite correct. The error is made when `labels` is a prefix of the available labels.
This is probably my fault, and I apologise.
The problem is the combination of https://github.com/scikit-learn/scikit-learn/blob/4f710cdd088aa8851e8b049e4faafa03767fda10... | diff --git a/sklearn/metrics/classification.py b/sklearn/metrics/classification.py
--- a/sklearn/metrics/classification.py
+++ b/sklearn/metrics/classification.py
@@ -1072,6 +1072,7 @@ def precision_recall_fscore_support(y_true, y_pred, beta=1.0, labels=None,
raise ValueError('All labels must be in [0,... | diff --git a/sklearn/metrics/tests/test_classification.py b/sklearn/metrics/tests/test_classification.py
--- a/sklearn/metrics/tests/test_classification.py
+++ b/sklearn/metrics/tests/test_classification.py
@@ -197,6 +197,14 @@ def test_precision_recall_f_extra_labels():
assert_raises(ValueError, recall_score,... | ["sklearn/metrics/tests/test_classification.py::test_precision_recall_f_extra_labels"] | ["sklearn/metrics/tests/test_classification.py::test_multilabel_accuracy_score_subset_accuracy", "sklearn/metrics/tests/test_classification.py::test_precision_recall_f1_score_binary", "sklearn/metrics/tests/test_classification.py::test_precision_recall_f_binary_single_class", "sklearn/metrics/tests/test_classification.... | null | true | 2017-12-27T16:39:20Z | 1 | 1 | 1 | 1,572 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.265333 | 75.471 | |
9,982 | swe_bench::test::1264 | swe_bench | test | 1,264 | pydata__xarray-5126 | pydata/xarray | pydata/xarray | python | 6bfbaede69eb73810cb63672a8161bd1fc147594 | FR: Provide option for collapsing the HTML display in notebooks
# Issue description
The overly long output of the text repr of xarray always bugged so I was very happy that the recently implemented html repr collapsed the data part, and equally sad to see that 0.16.0 reverted that, IMHO, correct design implementation b... | Related: #4182 | diff --git a/xarray/core/formatting.py b/xarray/core/formatting.py
--- a/xarray/core/formatting.py
+++ b/xarray/core/formatting.py
@@ -11,7 +11,7 @@
from pandas.errors import OutOfBoundsDatetime
from .duck_array_ops import array_equiv
-from .options import OPTIONS
+from .options import OPTIONS, _get_boolean_with_de... | diff --git a/xarray/tests/test_formatting.py b/xarray/tests/test_formatting.py
--- a/xarray/tests/test_formatting.py
+++ b/xarray/tests/test_formatting.py
@@ -391,6 +391,17 @@ def test_array_repr(self):
assert actual == expected
+ with xr.set_options(display_expand_data=False):
+ actual =... | ["xarray/tests/test_formatting.py::TestFormatting::test_array_repr", "xarray/tests/test_formatting.py::test__mapping_repr[50-40-30]", "xarray/tests/test_formatting.py::test__mapping_repr[35-40-30]", "xarray/tests/test_formatting.py::test__mapping_repr[11-40-30]", "xarray/tests/test_formatting.py::test__mapping_repr[1-4... | ["xarray/tests/test_formatting.py::TestFormatting::test_get_indexer_at_least_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_first_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_last_n_items", "xarray/tests/test_formatting.py::TestFormatting::test_last_item", "xarray/tests/test_format... | null | true | 2021-04-07T10:51:03Z | 3 | 90 | 7 | 928 | 0 | 0.8 | 1 | 0.4 | 1 | 0.454667 | 75.464 | |
9,983 | swe_bench::test::1365 | swe_bench | test | 1,365 | pylint-dev__pylint-8281 | pylint-dev/pylint | pylint-dev/pylint | python | e0018ea04bce285f5fed31c00d6d16367a8800c1 | Support globbing patterns for source-roots
### Current problem
It's quite inconvenient having to specify every source root for complex multi-package projects like `--source-roots src/package1,src/package2,...,src/packageN`
### Desired solution
For complex multi-package projects it would be nice to be able to specify... | diff --git a/pylint/config/argument.py b/pylint/config/argument.py
--- a/pylint/config/argument.py
+++ b/pylint/config/argument.py
@@ -15,6 +15,7 @@
import re
import sys
from collections.abc import Callable
+from glob import glob
from typing import Any, Pattern, Sequence, Tuple, Union
from pylint import interfac... | diff --git a/tests/lint/unittest_lint.py b/tests/lint/unittest_lint.py
--- a/tests/lint/unittest_lint.py
+++ b/tests/lint/unittest_lint.py
@@ -1208,6 +1208,20 @@ def test_recursive_ignore(ignore_parameter: str, ignore_parameter_value: str) ->
assert module in linted_file_paths
+def test_source_roots_globbing()... | ["tests/lint/unittest_lint.py::test_source_roots_globbing"] | ["tests/lint/unittest_lint.py::test_deprecated", "tests/lint/unittest_lint.py::test_no_args", "tests/lint/unittest_lint.py::test_one_arg[case0]", "tests/lint/unittest_lint.py::test_one_arg[case1]", "tests/lint/unittest_lint.py::test_one_arg[case2]", "tests/lint/unittest_lint.py::test_one_arg[case3]", "tests/lint/unitte... | null | true | 2023-02-13T15:37:32Z | 4 | 32 | 1 | 576 | 0 | 0.8 | 1 | 0.55 | 0.85 | 0.202667 | 75.4205 | ||
9,984 | swe_bench::dev::84 | swe_bench | dev | 84 | pydicom__pydicom-1228 | pydicom/pydicom | pydicom/pydicom | python | 8112bb69bfc0423c3a08cb89e7960defbe7237bf | Add Tag and VR to the bulk data handling in `from_json`
Currently, if you convert back to a Dataset format from a JSON format, you MUST re-hydrate all of the bulk data URI's or you will loose the information.
This causes a problem if you just wish to use the Dataset's header (maybe to extract some data, or rearrange s... | diff --git a/pydicom/dataelem.py b/pydicom/dataelem.py
--- a/pydicom/dataelem.py
+++ b/pydicom/dataelem.py
@@ -231,7 +231,12 @@ def from_json(
vr: str,
value: object,
value_key: Union[str, None],
- bulk_data_uri_handler: Optional[Callable[[str], object]] = None
+ bulk_data_uri_h... | diff --git a/pydicom/tests/test_json.py b/pydicom/tests/test_json.py
--- a/pydicom/tests/test_json.py
+++ b/pydicom/tests/test_json.py
@@ -334,7 +334,18 @@ def test_invalid_bulkdata_uri(self):
Dataset.from_json(ds_json)
def test_bulk_data_reader_is_called(self):
- def bulk_data_reader(_):
+ ... | ["pydicom/tests/test_json.py::TestBinary::test_bulk_data_reader_is_called_2"] | ["pydicom/tests/test_json.py::TestPersonName::test_json_pn_from_file", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_to_json", "pydicom/tests/test_json.py::TestPersonName::test_pn_components_from_json", "pydicom/tests/test_json.py::TestPersonName::test_empty_value", "pydicom/tests/test_json.py::TestPe... | null | true | 2020-10-18T17:24:48Z | 3 | 74 | 1 | 979 | 0 | 0.8 | 1 | 0.4 | 1 | 0.409833 | 75.3295 | ||
9,985 | swe_bench::test::20 | swe_bench | test | 20 | astropy__astropy-13306 | astropy/astropy | astropy/astropy | python | b3fa7702635b260b008d391705c521fca7283761 | vstack'ing structured array tables fails with casting error
### Description
Using `table.vstack` on tables containing columns backed by numpy structured arrays fails.
### Steps to Reproduce
```python
a=Table([dict(field1='test',field2=(1.,0.5,1.5))])
b=Table([dict(field1='foo')])
table.vstack((a,b)) # works
a=Table... | 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/main/CONTRIBUTING.md#reporting-issues) and make sure you've provided the requested deta... | diff --git a/astropy/utils/metadata.py b/astropy/utils/metadata.py
--- a/astropy/utils/metadata.py
+++ b/astropy/utils/metadata.py
@@ -73,7 +73,7 @@ def dtype(arr):
dtype_bytes_or_chars(arr.dtype)]
arr_common = np.array([arr[0] for arr in arrs])
- return arr_common.dtype.str
+ retur... | diff --git a/astropy/table/tests/test_operations.py b/astropy/table/tests/test_operations.py
--- a/astropy/table/tests/test_operations.py
+++ b/astropy/table/tests/test_operations.py
@@ -789,6 +789,21 @@ def test_keys_left_right_exceptions(self):
with pytest.raises(ValueError, match=msg):
table.jo... | ["astropy/table/tests/test_operations.py::TestJoin::test_join_structured_column", "astropy/table/tests/test_operations.py::TestVStack::test_vstack_structured_column", "astropy/table/tests/test_operations.py::TestDStack::test_dstack_structured_column"] | ["astropy/table/tests/test_operations.py::TestJoin::test_table_meta_merge[Table]", "astropy/table/tests/test_operations.py::TestJoin::test_table_meta_merge[QTable]", "astropy/table/tests/test_operations.py::TestJoin::test_table_meta_merge_conflict[Table]", "astropy/table/tests/test_operations.py::TestJoin::test_table_m... | null | true | 2022-06-05T15:18:24Z | 1 | 2 | 3 | 1,267 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.217833 | 75.3285 | |
9,986 | swe_bench::test::1043 | swe_bench | test | 1,043 | matplotlib__matplotlib-24403 | matplotlib/matplotlib | matplotlib/matplotlib | python | 8d8ae7fe5b129af0fef45aefa0b3e11394fcbe51 | [ENH]: Use `repr` instead of `str` in the error message
### Problem
I mistakenly supplied `"blue\n"` as the argument `c` for [`matplotlib.axes.Axes.scatter
`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.scatter.html#matplotlib-axes-axes-scatter), then `matplitlib` claimed for illegal color name like... | Labeling this as a good first issue as this is a straight forward change that should not bring up any API design issues (yes technically changing the wording of an error message may break someone, but that is so brittle I am not going to worry about that). Will need a test (the new line example is a good one!).
@e5f6b... | diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -4416,7 +4416,7 @@ def invalid_shape_exception(csize, xsize):
# severe failure => one may appreciate a verbose feedback.
raise Value... | diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -8290,3 +8290,17 @@ def test_extent_units():
with pytest.raises(ValueError,
match="set_extent did not consume all of the kwar... | ["lib/matplotlib/tests/test_axes.py::test_scatter_color_repr_error"] | ["lib/matplotlib/tests/test_axes.py::test_invisible_axes[png]", "lib/matplotlib/tests/test_axes.py::test_get_labels", "lib/matplotlib/tests/test_axes.py::test_repr", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[png]", "lib/matplotlib/tests/test_axes.py::test_label_loc_vertical[pdf]", "lib/matplotlib/test... | null | true | 2022-11-08T19:05:49Z | 1 | 2 | 1 | 1,243 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.213833 | 75.3165 | |
9,987 | swe_bench::test::1650 | swe_bench | test | 1,650 | scikit-learn__scikit-learn-14732 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | ad0e9a97a6a1e844dafb3ec2b31f3b22b8119c91 | median_absolute_error multioutput
Multioutput is not currently supported in `median_absolute_error`. Is this a design choice or has it just not been implemented yet? In case of the latter, I am happy to submit a PR. | pretty sure it's just not implemented
Thanks @amueller -- I will have a stab at it soon. | diff --git a/sklearn/metrics/regression.py b/sklearn/metrics/regression.py
--- a/sklearn/metrics/regression.py
+++ b/sklearn/metrics/regression.py
@@ -330,23 +330,38 @@ def mean_squared_log_error(y_true, y_pred,
sample_weight, multioutput)
-def median_absolute_error(y_true, y_pred):
+... | diff --git a/sklearn/metrics/tests/test_common.py b/sklearn/metrics/tests/test_common.py
--- a/sklearn/metrics/tests/test_common.py
+++ b/sklearn/metrics/tests/test_common.py
@@ -426,8 +426,8 @@ def precision_recall_curve_padded_thresholds(*args, **kwargs):
# Regression metrics with "multioutput-continuous" format s... | ["sklearn/metrics/tests/test_common.py::test_sample_order_invariance_multilabel_and_multioutput", "sklearn/metrics/tests/test_common.py::test_single_sample_multioutput[median_absolute_error]", "sklearn/metrics/tests/test_common.py::test_multioutput_regression_invariance_to_dimension_shuffling[median_absolute_error]", "... | ["sklearn/metrics/tests/test_common.py::test_symmetry_consistency", "sklearn/metrics/tests/test_common.py::test_symmetric_metric[accuracy_score]", "sklearn/metrics/tests/test_common.py::test_symmetric_metric[cohen_kappa_score]", "sklearn/metrics/tests/test_common.py::test_symmetric_metric[f1_score]", "sklearn/metrics/t... | null | true | 2019-08-22T21:59:40Z | 1 | 50 | 5 | 215 | 0 | 0.8 | 1 | 0.35 | 1 | 0.2025 | 75.2825 | |
9,988 | swe_bench::test::7 | swe_bench | test | 7 | astropy__astropy-12891 | astropy/astropy | astropy/astropy | python | 691ceab8aea8f7c37ee89b1b806801239bb2dc69 | The `where` keyword argument of `np.mean` is not supported for `astropy.units.Quantity` instances.
### Description
Apologies if there is a duplicate somewhere, I scoured all the issues for this problem and I couldn't find it mentioned yet.
The `where` keyword argument was added to `np.mean` and all the other `np.red... | diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py
--- a/astropy/units/quantity.py
+++ b/astropy/units/quantity.py
@@ -18,6 +18,7 @@
# LOCAL
from astropy import config as _config
+from astropy.utils.compat import NUMPY_LT_1_20, NUMPY_LT_1_22
from astropy.utils.compat.misc import override__dir__
fr... | diff --git a/astropy/units/tests/test_quantity_array_methods.py b/astropy/units/tests/test_quantity_array_methods.py
--- a/astropy/units/tests/test_quantity_array_methods.py
+++ b/astropy/units/tests/test_quantity_array_methods.py
@@ -7,7 +7,7 @@
from numpy.testing import assert_array_equal
from astropy import unit... | ["astropy/units/tests/test_quantity_array_methods.py::TestQuantityStatsFuncs::test_mean_where", "astropy/units/tests/test_quantity_array_methods.py::TestQuantityStatsFuncs::test_std_where", "astropy/units/tests/test_quantity_array_methods.py::TestQuantityStatsFuncs::test_var_where", "astropy/utils/masked/tests/test_mas... | ["astropy/units/tests/test_quantity_array_methods.py::TestQuantityArrayCopy::test_copy_on_creation", "astropy/units/tests/test_quantity_array_methods.py::TestQuantityArrayCopy::test_to_copies", "astropy/units/tests/test_quantity_array_methods.py::TestQuantityArrayCopy::test_si_copies", "astropy/units/tests/test_quantit... | null | true | 2022-02-24T23:49:13Z | 2 | 83 | 48 | 682 | 0 | 0.8 | 1 | 0.4 | 1 | 0.390333 | 75.271 | ||
9,989 | swe_bench::test::1600 | swe_bench | test | 1,600 | scikit-learn__scikit-learn-13454 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 85206250ceac6341c0ca1d4fd89dfd127e3e8e6b | Confusing error message in OrdinalEncoder when passing single list of categories
Small example:
```py
In [38]: from sklearn.preprocessing import OrdinalEncoder
In [39]: X = np.array([['L', 'M', 'S', 'M', 'L']], dtype=object).T
In [40]: ohe = OrdinalEncoder(categories=['S', 'M', 'L'])
In [41]: ohe.fit(X)
...
ValueEr... | Just out of curiosity. First timer here! Are you looking for a fix just on writing up an error message similar to the more recently updated error messages in other parts of the same file?
Hi, I'd like to take this one up. This is my first time contributing. Will make the change and submit a PR. | diff --git a/sklearn/preprocessing/_encoders.py b/sklearn/preprocessing/_encoders.py
--- a/sklearn/preprocessing/_encoders.py
+++ b/sklearn/preprocessing/_encoders.py
@@ -81,7 +81,7 @@ def _fit(self, X, handle_unknown='error'):
if self._categories != 'auto':
if len(self._categories) != n_feature... | diff --git a/sklearn/preprocessing/tests/test_encoders.py b/sklearn/preprocessing/tests/test_encoders.py
--- a/sklearn/preprocessing/tests/test_encoders.py
+++ b/sklearn/preprocessing/tests/test_encoders.py
@@ -693,6 +693,16 @@ def test_ordinal_encoder_raise_missing(X):
ohe.transform(X)
+def test_ordinal_e... | ["sklearn/preprocessing/tests/test_encoders.py::test_ordinal_encoder_raise_categories_shape"] | ["sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_sparse", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_dense", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_deprecationwarnings", "sklearn/preprocessing/tests/test_encoders.py::test_one_hot_encoder_force_ne... | null | true | 2019-03-16T00:04:44Z | 1 | 2 | 1 | 1,047 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.181167 | 75.2185 | |
9,990 | swe_bench::test::1110 | swe_bench | test | 1,110 | matplotlib__matplotlib-26160 | matplotlib/matplotlib | matplotlib/matplotlib | python | 9fdf6adf70819c8d34e9f47eeb8470aea35d78c0 | [ENH]: Add setters for _AxLine._xy1, ._xy2, ._slope
### Problem
Currently the control points / slope of the artist returned by axline() cannot be (publically) modified after being instantiated. It would be nice if the relevant properties (xy1, xy2, slope) had setters (following normal Artist design).
For simplicity ... | diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -925,7 +925,7 @@ def axline(self, xy1, xy2=None, *, slope=None, **kwargs):
# data limits should not be adjusted.
datalim = []
- line = mlin... | diff --git a/lib/matplotlib/tests/test_lines.py b/lib/matplotlib/tests/test_lines.py
--- a/lib/matplotlib/tests/test_lines.py
+++ b/lib/matplotlib/tests/test_lines.py
@@ -409,3 +409,30 @@ def test_markevery_prop_cycle(fig_test, fig_ref):
ax = fig_test.add_subplot()
for i, _ in enumerate(cases):
ax.pl... | ["lib/matplotlib/tests/test_lines.py::test_axline_setters"] | ["lib/matplotlib/tests/test_lines.py::test_segment_hits", "lib/matplotlib/tests/test_lines.py::test_invisible_Line_rendering", "lib/matplotlib/tests/test_lines.py::test_set_line_coll_dash", "lib/matplotlib/tests/test_lines.py::test_invalid_line_data", "lib/matplotlib/tests/test_lines.py::test_line_dashes[png]", "lib/ma... | null | true | 2023-06-21T08:22:38Z | 2 | 74 | 1 | 724 | 0 | 0.8 | 1 | 0.4 | 1 | 0.367333 | 75.202 | ||
9,991 | swe_bench::dev::25 | swe_bench | dev | 25 | pvlib__pvlib-python-1181 | pvlib/pvlib-python | pvlib/pvlib-python | python | 8b98768818ee5ad85d9479877533651a2e9dc2cd | remove ModelChain.orientation_strategy
I don't like that `ModelChain(system, location, orientation_strategy='flat`|`south_at_latitude_tilt`) modifies the `system` object. It's not something we do anywhere else in pvlib. `orientation_strategy` only supports flat and south_at_latitude_tilt, neither of which are commonly ... | diff --git a/pvlib/modelchain.py b/pvlib/modelchain.py
--- a/pvlib/modelchain.py
+++ b/pvlib/modelchain.py
@@ -63,11 +63,10 @@
def basic_chain(times, latitude, longitude,
+ surface_tilt, surface_azimuth,
module_parameters, temperature_model_parameters,
inverter_para... | diff --git a/pvlib/tests/test_modelchain.py b/pvlib/tests/test_modelchain.py
--- a/pvlib/tests/test_modelchain.py
+++ b/pvlib/tests/test_modelchain.py
@@ -333,22 +333,6 @@ def test_with_pvwatts(pvwatts_dc_pvwatts_ac_system, location, weather):
mc.run_model(weather)
-@pytest.mark.parametrize('strategy, expected... | ["pvlib/tests/test_modelchain.py::test_basic_chain_alt_az", "pvlib/tests/test_modelchain.py::test_basic_chain_altitude_pressure"] | ["pvlib/tests/test_modelchain.py::test_ModelChain_creation", "pvlib/tests/test_modelchain.py::test_with_sapm", "pvlib/tests/test_modelchain.py::test_with_pvwatts", "pvlib/tests/test_modelchain.py::test_run_model_with_irradiance", "pvlib/tests/test_modelchain.py::test_run_model_from_irradiance_arrays_no_loss", "pvlib/te... | null | true | 2021-02-28T23:03:01Z | 1 | 85 | 2 | 493 | 0 | 0.8 | 1 | 0.4 | 1 | 0.3655 | 75.1965 | ||
9,992 | swe_bench::test::1470 | swe_bench | test | 1,470 | pytest-dev__pytest-8516 | pytest-dev/pytest | pytest-dev/pytest | python | 9c151a65c86b4e780cc6b50ec2174b9b23af96de | Minor temporary directory security issue in pytest versions before 6.2.3
A minor temporary directory security issue was found in pytest versions before 6.2.3. This issue is fixed in pytest 6.2.3.
pytest used to create directories under ``/tmp`` with world-readable
permissions. This means that any user in the system wa... | diff --git a/src/_pytest/pathlib.py b/src/_pytest/pathlib.py
--- a/src/_pytest/pathlib.py
+++ b/src/_pytest/pathlib.py
@@ -62,13 +62,6 @@ def get_lock_path(path: _AnyPurePath) -> _AnyPurePath:
return path.joinpath(".lock")
-def ensure_reset_dir(path: Path) -> None:
- """Ensure the given path is an empty dir... | diff --git a/testing/test_tmpdir.py b/testing/test_tmpdir.py
--- a/testing/test_tmpdir.py
+++ b/testing/test_tmpdir.py
@@ -454,3 +454,44 @@ def test_tmp_path_factory_handles_invalid_dir_characters(
monkeypatch.setattr(tmp_path_factory, "_given_basetemp", None)
p = tmp_path_factory.getbasetemp()
assert "p... | ["testing/test_tmpdir.py::test_tmp_path_factory_create_directory_with_safe_permissions", "testing/test_tmpdir.py::test_tmp_path_factory_fixes_up_world_readable_permissions"] | ["testing/test_tmpdir.py::TestTmpPathHandler::test_mktemp", "testing/test_tmpdir.py::TestTmpPathHandler::test_tmppath_relative_basetemp_absolute", "testing/test_tmpdir.py::test_get_user_uid_not_found", "testing/test_tmpdir.py::TestNumberedDir::test_make", "testing/test_tmpdir.py::TestNumberedDir::test_cleanup_lock_crea... | null | true | 2021-04-03T21:15:38Z | 3 | 70 | 2 | 781 | 0 | 0.8 | 1 | 0.4 | 1 | 0.3635 | 75.1905 | ||
9,993 | swe_bench::dev::217 | swe_bench | dev | 217 | sqlfluff__sqlfluff-4997 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 50bbffd4672aa17af2651f40d533cf55048b7524 | Validate layout configurations on load
### Search before asking
- [X] I searched the [issues](https://github.com/sqlfluff/sqlfluff/issues) and found no similar issues.
### Description
As raised in this comment: https://github.com/sqlfluff/sqlfluff/pull/4558#discussion_r1142745101
At the moment, the layout configs a... | diff --git a/src/sqlfluff/cli/commands.py b/src/sqlfluff/cli/commands.py
--- a/src/sqlfluff/cli/commands.py
+++ b/src/sqlfluff/cli/commands.py
@@ -1356,7 +1356,7 @@ def render(
fname = path
# Get file specific config
- file_config.process_raw_file_for_config(raw_sql)
+ file_config.process_raw_... | diff --git a/test/core/config_test.py b/test/core/config_test.py
--- a/test/core/config_test.py
+++ b/test/core/config_test.py
@@ -459,6 +459,50 @@ def test__config__validate_configs_indirect():
)
+@pytest.mark.parametrize(
+ "raw_sql",
+ [
+ (
+ # "types" not "type"
+ "-... | ["test/core/config_test.py::test__config__validate_configs_inline_layout[--", "test/core/config_test.py::test__config__validate_configs_inline_layout[--sqlfluff:layout:type:comma:foo:bar\\nSELECT", "test/core/config_test.py::test__process_inline_config"] | ["test/core/config_test.py::test__config__nested_combine", "test/core/config_test.py::test__config__dict_diff", "test/core/config_test.py::test__config__load_file_dir", "test/core/config_test.py::test__config__load_file_f", "test/core/config_test.py::test__config__load_nested", "test/core/config_test.py::test__config__... | null | true | 2023-07-24T14:00:41Z | 3 | 65 | 3 | 740 | 0 | 0.8 | 1 | 0.4 | 1 | 0.34 | 75.12 | ||
9,994 | swe_bench::test::1502 | swe_bench | test | 1,502 | scikit-learn__scikit-learn-10452 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 3e5469eda719956c076ae8e685ec1183bfd98569 | Polynomial Features for sparse data
I'm not sure if that came up before but PolynomialFeatures doesn't support sparse data, which is not great. Should be easy but I haven't checked ;) | I'll take this up.
@dalmia @amueller any news on this feature? We're eagerly anticipating it ;-)
See also #3512, #3514
For the benefit of @amueller, my [comment](https://github.com/scikit-learn/scikit-learn/pull/8380#issuecomment-299164291) on #8380:
> [@jnothman] closed both #3512 and #3514 at the time, in favor... | diff --git a/sklearn/preprocessing/data.py b/sklearn/preprocessing/data.py
--- a/sklearn/preprocessing/data.py
+++ b/sklearn/preprocessing/data.py
@@ -1325,7 +1325,7 @@ def fit(self, X, y=None):
-------
self : instance
"""
- n_samples, n_features = check_array(X).shape
+ n_sampl... | diff --git a/sklearn/preprocessing/tests/test_data.py b/sklearn/preprocessing/tests/test_data.py
--- a/sklearn/preprocessing/tests/test_data.py
+++ b/sklearn/preprocessing/tests/test_data.py
@@ -7,10 +7,12 @@
import warnings
import re
+
import numpy as np
import numpy.linalg as la
from scipy import sparse, stats... | ["sklearn/preprocessing/tests/test_data.py::test_polynomial_features_sparse_X[1-True-False-int]", "sklearn/preprocessing/tests/test_data.py::test_polynomial_features_sparse_X[2-True-False-int]", "sklearn/preprocessing/tests/test_data.py::test_polynomial_features_sparse_X[2-True-False-float32]", "sklearn/preprocessing/t... | ["sklearn/preprocessing/tests/test_data.py::test_polynomial_features", "sklearn/preprocessing/tests/test_data.py::test_polynomial_feature_names", "sklearn/preprocessing/tests/test_data.py::test_standard_scaler_1d", "sklearn/preprocessing/tests/test_data.py::test_scale_1d", "sklearn/preprocessing/tests/test_data.py::tes... | null | true | 2018-01-11T06:56:51Z | 1 | 29 | 6 | 183 | 0 | 0.8 | 1 | 0.35 | 1 | 0.127167 | 75.0565 | |
9,995 | swe_bench::test::1724 | swe_bench | test | 1,724 | sphinx-doc__sphinx-10097 | sphinx-doc/sphinx | sphinx-doc/sphinx | python | ce6803a18679f7085561b66ec1945ed4005e2d1d | Latex: long option name overflows in Index
### Describe the bug
Let's consider something like:
```rst
.. option:: -Wauggest-attribute=[pure|const|noreturn|format|cold|malloc]
Suggest it.
```
Leads to the following with `xelatex`.
 % currprogram
else:
descr = _('co... | diff --git a/tests/test_domain_std.py b/tests/test_domain_std.py
--- a/tests/test_domain_std.py
+++ b/tests/test_domain_std.py
@@ -97,6 +97,9 @@ def test_cmd_option_with_optional_value(app):
[desc, ([desc_signature, ([desc_name, '-j'],
[des... | ["tests/test_domain_std.py::test_cmd_option_with_optional_value", "tests/test_domain_std.py::test_multiple_cmdoptions"] | ["tests/test_domain_std.py::test_process_doc_handle_figure_caption", "tests/test_domain_std.py::test_process_doc_handle_table_title", "tests/test_domain_std.py::test_get_full_qualified_name", "tests/test_domain_std.py::test_cmd_option_starting_with_bracket", "tests/test_domain_std.py::test_glossary", "tests/test_domain... | null | true | 2022-01-13T17:27:25Z | 1 | 2 | 2 | 706 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.124333 | 75.048 | |
9,996 | swe_bench::test::1679 | swe_bench | test | 1,679 | scikit-learn__scikit-learn-24677 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 530dfc9631b2135412a048b5ec7cf01d155b6067 | [MRG] Fixes sklearn.metrics.silhouette_samples for sparse matrices
#### Reference Issues/PRs
Fixes #18524
#### What does this implement/fix? Explain your changes.
The changes update the reduce function used for computing the intra-cluster and inter-cluster distances. The current version is failing at,
a) the pre-comp... | diff --git a/sklearn/metrics/cluster/_unsupervised.py b/sklearn/metrics/cluster/_unsupervised.py
--- a/sklearn/metrics/cluster/_unsupervised.py
+++ b/sklearn/metrics/cluster/_unsupervised.py
@@ -9,6 +9,7 @@
import functools
import numpy as np
+from scipy.sparse import issparse
from ...utils import check_random_s... | diff --git a/sklearn/metrics/cluster/tests/test_unsupervised.py b/sklearn/metrics/cluster/tests/test_unsupervised.py
--- a/sklearn/metrics/cluster/tests/test_unsupervised.py
+++ b/sklearn/metrics/cluster/tests/test_unsupervised.py
@@ -1,14 +1,17 @@
import warnings
import numpy as np
-import scipy.sparse as sp
impo... | ["sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_samples_precomputed_sparse[csr_matrix]", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_samples_precomputed_sparse[csc_matrix]", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_samples_precomputed_sparse[dok... | ["sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_cluster_size_1", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_silhouette_paper_example", "sklearn/metrics/cluster/tests/test_unsupervised.py::test_correct_labelsize", "sklearn/m... | null | true | 2022-10-16T10:10:38Z | 1 | 69 | 7 | 492 | 0 | 0.8 | 1 | 0.4 | 1 | 0.312 | 75.036 | ||
9,997 | swe_bench::test::1590 | swe_bench | test | 1,590 | scikit-learn__scikit-learn-13302 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 4de404d46d24805ff48ad255ec3169a5155986f0 | [WIP] EHN: Ridge with solver SAG/SAGA does not cast to float64
closes #11642
build upon #11155
TODO:
- [ ] Merge #11155 to reduce the diff.
- [ ] Ensure that the casting rule is clear between base classes, classes and functions. I suspect that we have some copy which are not useful. | diff --git a/sklearn/linear_model/ridge.py b/sklearn/linear_model/ridge.py
--- a/sklearn/linear_model/ridge.py
+++ b/sklearn/linear_model/ridge.py
@@ -226,9 +226,17 @@ def _solve_svd(X, y, alpha):
return np.dot(Vt.T, d_UT_y).T
+def _get_valid_accept_sparse(is_X_sparse, solver):
+ if is_X_sparse and solver i... | diff --git a/sklearn/linear_model/tests/test_ridge.py b/sklearn/linear_model/tests/test_ridge.py
--- a/sklearn/linear_model/tests/test_ridge.py
+++ b/sklearn/linear_model/tests/test_ridge.py
@@ -1,3 +1,4 @@
+import os
import numpy as np
import scipy.sparse as sp
from scipy import linalg
@@ -6,6 +7,7 @@
import pytes... | ["sklearn/linear_model/tests/test_ridge.py::test_dtype_match[sag]", "sklearn/linear_model/tests/test_ridge.py::test_dtype_match[saga]", "sklearn/linear_model/tests/test_ridge.py::test_ridge_regression_dtype_stability[sag]", "sklearn/linear_model/tests/test_ridge.py::test_ridge_regression_dtype_stability[saga]"] | ["sklearn/linear_model/tests/test_ridge.py::test_ridge[svd]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[sparse_cg]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[cholesky]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[lsqr]", "sklearn/linear_model/tests/test_ridge.py::test_ridge[sag]", "s... | null | true | 2019-02-27T10:28:25Z | 1 | 79 | 4 | 286 | 0 | 0.8 | 1 | 0.4 | 1 | 0.311 | 75.033 | ||
9,998 | swe_bench::test::1663 | swe_bench | test | 1,663 | scikit-learn__scikit-learn-15086 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | 21fc1d97452d4e3a6d744d0eef95ecaf7e87859c | MultiTaskLassoCV with fit_intercept=True returns wrong results
There is something wrong with `MultiTaskLassoCV` and binary features. It always returns the same mse for all the alphas and hence chooses a huge regularization zeroing out all coefficients. The same holds for `MultiTaskElasticNet` too. However, this doesn't... | diff --git a/sklearn/linear_model/coordinate_descent.py b/sklearn/linear_model/coordinate_descent.py
--- a/sklearn/linear_model/coordinate_descent.py
+++ b/sklearn/linear_model/coordinate_descent.py
@@ -1112,7 +1112,8 @@ def fit(self, X, y):
# Let us not impose fortran ordering so far: it is
#... | diff --git a/sklearn/linear_model/tests/test_coordinate_descent.py b/sklearn/linear_model/tests/test_coordinate_descent.py
--- a/sklearn/linear_model/tests/test_coordinate_descent.py
+++ b/sklearn/linear_model/tests/test_coordinate_descent.py
@@ -888,3 +888,13 @@ def fit(self, X, y):
clf = LassoCV(precompute=preco... | ["sklearn/linear_model/tests/test_coordinate_descent.py::test_multi_task_lasso_cv_dtype"] | ["sklearn/linear_model/tests/test_coordinate_descent.py::test_lasso_zero", "sklearn/linear_model/tests/test_coordinate_descent.py::test_lasso_toy", "sklearn/linear_model/tests/test_coordinate_descent.py::test_enet_toy", "sklearn/linear_model/tests/test_coordinate_descent.py::test_lasso_cv", "sklearn/linear_model/tests/... | null | true | 2019-09-24T20:11:18Z | 1 | 3 | 1 | 2,722 | 0 | 0.8 | 1 | 0.55 | 0.8 | 0.463667 | 75.016 | ||
9,999 | swe_bench::dev::177 | swe_bench | dev | 177 | sqlfluff__sqlfluff-1625 | sqlfluff/sqlfluff | sqlfluff/sqlfluff | python | 14e1a23a3166b9a645a16de96f694c77a5d4abb7 | TSQL - L031 incorrectly triggers "Avoid using aliases in join condition" when no join present
## Expected Behaviour
Both of these queries should pass, the only difference is the addition of a table alias 'a':
1/ no alias
```
SELECT [hello]
FROM
mytable
```
2/ same query with alias
```
SELECT a.[hello]
FROM
... | Actually, re-reading the docs I think this is the intended behaviour... closing | diff --git a/src/sqlfluff/rules/L031.py b/src/sqlfluff/rules/L031.py
--- a/src/sqlfluff/rules/L031.py
+++ b/src/sqlfluff/rules/L031.py
@@ -211,7 +211,7 @@ def _lint_aliases_in_join(
violation_buff.append(
LintResult(
anchor=alias_info.alias_identifier_ref,
- ... | diff --git a/test/cli/commands_test.py b/test/cli/commands_test.py
--- a/test/cli/commands_test.py
+++ b/test/cli/commands_test.py
@@ -49,7 +49,7 @@ def invoke_assert_code(
expected_output = """== [test/fixtures/linter/indentation_error_simple.sql] FAIL
L: 2 | P: 4 | L003 | Indentation not hanging or a multiple o... | ["test/cli/commands_test.py::test__cli__command_directed"] | ["test/cli/commands_test.py::test__cli__command_dialect", "test/cli/commands_test.py::test__cli__command_dialect_legacy", "test/cli/commands_test.py::test__cli__command_lint_stdin[command0]", "test/cli/commands_test.py::test__cli__command_lint_stdin[command1]", "test/cli/commands_test.py::test__cli__command_lint_stdin[... | null | true | 2021-10-13T11:35:29Z | 1 | 2 | 1 | 592 | 0 | 0.8 | 1 | 0.85 | 0.4 | 0.105333 | 74.991 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.