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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5,700 | swe_smith::train::48410 | swe_smith | train | 48,410 | sqlfluff__sqlfluff.50a1c4b6.func_pm_remove_assign__ubsfqvfo | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | NameError in lexer after removing variable assignments
#### Description
The lexer is throwing a `NameError` when processing SQL strings. Variables that were previously defined and used in the lexing logic are now undefined, causing the lexer to fail on basic operations.
#### Steps/Code to Reproduce
```python
from s... | diff --git a/src/sqlfluff/core/parser/lexer.py b/src/sqlfluff/core/parser/lexer.py
index 1fbf312..3663b8a 100644
--- a/src/sqlfluff/core/parser/lexer.py
+++ b/src/sqlfluff/core/parser/lexer.py
@@ -501,20 +501,6 @@ def _iter_segments(
# Output the slice as we lex.
lexer_logger.debug(" %s: %s. [tfs_i... | ["test/core/parser/lexer_test.py::test__parser__lexer_obj[b.c-res1]", "test/core/parser/lexer_test.py::test__parser__lexer_obj[*-+bd/-res8]", "test/core/parser/lexer_test.py::test__parser__lexer_fail", "test/core/parser/lexer_test.py::test__parser__lexer_fail_via_parse"] | ["test/core/parser/lexer_test.py::test__parser__lexer_string[.fsaljk-.]", "test/core/parser/lexer_test.py::test__parser__lexer_string[fsaljk-None]", "test/core/parser/lexer_test.py::test__parser__lexer_regex[fsaljk-f-f0]", "test/core/parser/lexer_test.py::test__parser__lexer_regex[fsaljk-f-f1]", "test/core/parser/lexer... | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 32 | 4 | 1,094 | 0 | 0.6 | 1 | 0.75 | 1 | 0.289 | 81.142 | |||
5,701 | swe_smith::train::21483 | swe_smith | train | 21,483 | rubik__radon.54b88e58.func_pm_ctrl_shuffle__ohfeo0v6 | swesmith/rubik__radon.54b88e58 | rubik/radon | python | null | # CCHarvester.to_terminal() calculates average complexity incorrectly
## Description
I found an issue with the `to_terminal()` method in the `CCHarvester` class. The method is incorrectly calculating the average complexity because the variables `average_cc` and `analyzed` are initialized at the wrong place.
## Steps... | diff --git a/radon/cli/harvest.py b/radon/cli/harvest.py
index ac14fe5..62d9196 100644
--- a/radon/cli/harvest.py
+++ b/radon/cli/harvest.py
@@ -217,9 +217,6 @@ class CCHarvester(Harvester):
return dict_to_codeclimate_issues(self._to_dicts(), self.config.min)
def to_terminal(self):
- '''Yield lin... | ["radon/tests/test_cli.py::test_encoding", "radon/tests/test_cli_harvest.py::test_cc_to_terminal"] | ["radon/tests/test_cli.py::test_config_base_behavior", "radon/tests/test_cli.py::test_config_exceptions", "radon/tests/test_cli.py::test_config_str", "radon/tests/test_cli.py::test_config_eq", "radon/tests/test_cli.py::test_config_for", "radon/tests/test_cli.py::test_config_converts_types", "radon/tests/test_cli.py::te... | jyangballin/swesmith.x86_64.rubik_1776_radon.54b88e58 | true | null | 1 | 7 | 2 | 1,593 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288833 | 81.1415 | |||
5,702 | swe_smith::train::1054 | swe_smith | train | 1,054 | jd__tenacity.0d40e76f.combine_file__oicq97rw | swesmith/jd__tenacity.0d40e76f | jd/tenacity | python | null | stop_any and stop_all logic inverted, stop conditions not working correctly
#### Description
The stop conditions `stop_any` and `stop_all` appear to have inverted logic. When using `stop_any`, it requires ALL conditions to be true instead of ANY, and `stop_all` requires ANY condition to be true instead of ALL.
Addit... | diff --git a/tenacity/stop.py b/tenacity/stop.py
index 5cda59a..73af071 100644
--- a/tenacity/stop.py
+++ b/tenacity/stop.py
@@ -48,7 +48,7 @@ class stop_any(stop_base):
self.stops = stops
def __call__(self, retry_state: "RetryCallState") -> bool:
- return any(x(retry_state) for x in self.stops)
... | ["tests/test_asyncio.py::TestContextManager::test_do_max_attempts", "tests/test_asyncio.py::TestContextManager::test_sleeps", "tests/test_asyncio.py::TestDecoratorWrapper::test_retry_function_attributes", "tests/test_tenacity.py::TestStopConditions::test_stop_after_attempt", "tests/test_tenacity.py::TestStopConditions:... | ["tests/test_after.py::TestAfterLogFormat::test_01_default", "tests/test_after.py::TestAfterLogFormat::test_02_custom_sec_format", "tests/test_asyncio.py::TestAsyncio::test_attempt_number_is_correct_for_interleaved_coroutines", "tests/test_asyncio.py::TestAsyncio::test_iscoroutinefunction", "tests/test_asyncio.py::Test... | jyangballin/swesmith.x86_64.jd_1776_tenacity.0d40e76f | true | null | 1 | 10 | 25 | 1,533 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288833 | 81.1415 | |||
5,703 | swe_smith::train::10888 | swe_smith | train | 10,888 | paramiko__paramiko.23f92003.lm_rewrite__0y9gd4wp | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | [Bug]: Newline character in public key comment field
### Bug summary
When loading a public key certificate, the comment field contains an extra newline character at the end. This causes issues when comparing the comment field with expected values.
### Code for reproduction
```python
from paramiko import RSAKey
# L... | diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index f0b2d6d..467e23a 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -907,26 +907,13 @@ class PublicBlob:
"""
fields = string.split(None, 2)
if len(fields) < 2:
- msg = "Not enough fields for public blob: {}"
- r... | ["tests/pkey.py::PKey_::load_certificate::rsa_public_cert_blobs"] | ["tests/agent.py::AgentKey_::str_is_repr", "tests/agent.py::AgentKey_::init::needs_at_least_two_arguments", "tests/agent.py::AgentKey_::init::sets_attributes_and_parses_blob", "tests/agent.py::AgentKey_::init::comment_optional", "tests/agent.py::AgentKey_::init::sets_inner_key_when_known_type[rsa]", "tests/agent.py::Ag... | jyangballin/swesmith.x86_64.paramiko_1776_paramiko.23f92003 | true | null | 1 | 21 | 1 | 1,313 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288833 | 81.1415 | |||
5,704 | swe_smith::train::20945 | swe_smith | train | 20,945 | tobymao__sqlglot.036601ba.func_pm_remove_cond__4cirzuzz | swesmith/tobymao__sqlglot.036601ba | tobymao/sqlglot | python | null | Column qualification fails with AttributeError after removing alias expansion logic
#### Description
When running SQL optimization with column qualification, the optimizer throws an `AttributeError: 'NoneType' object has no attribute 'find'` error. This appears to be related to the alias expansion functionality in th... | diff --git a/sqlglot/optimizer/qualify_columns.py b/sqlglot/optimizer/qualify_columns.py
index 3ab987d..3b6e24b 100644
--- a/sqlglot/optimizer/qualify_columns.py
+++ b/sqlglot/optimizer/qualify_columns.py
@@ -283,8 +283,6 @@ def _expand_alias_refs(
) -> None:
is_group_by = isinstance(node, exp.Group)
... | ["tests/test_optimizer.py::TestOptimizer::test_canonicalize", "tests/test_optimizer.py::TestOptimizer::test_expand_alias_refs", "tests/test_optimizer.py::TestOptimizer::test_file_schema", "tests/test_optimizer.py::TestOptimizer::test_lateral_annotation", "tests/test_optimizer.py::TestOptimizer::test_merge_subqueries", ... | ["tests/test_optimizer.py::TestOptimizer::test_aggfunc_annotation", "tests/test_optimizer.py::TestOptimizer::test_annotate_funcs", "tests/test_optimizer.py::TestOptimizer::test_annotate_types", "tests/test_optimizer.py::TestOptimizer::test_binary_annotation", "tests/test_optimizer.py::TestOptimizer::test_bracket_annota... | jyangballin/swesmith.x86_64.tobymao_1776_sqlglot.036601ba | true | null | 1 | 26 | 18 | 1,213 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288833 | 81.1415 | |||
5,705 | swe_bench::test::1510 | swe_bench | test | 1,510 | scikit-learn__scikit-learn-10581 | scikit-learn/scikit-learn | scikit-learn/scikit-learn | python | b27e285ea39450550fc8c81f308a91a660c03a56 | ElasticNet overwrites X even with copy_X=True
The `fit` function of an `ElasticNet`, called with `check_input=False`, overwrites X, even when `copy_X=True`:
```python
import numpy as np
from sklearn.linear_model import ElasticNet
rng = np.random.RandomState(0)
n_samples, n_features = 20, 2
X = rng.randn(n_samples, n_f... | I think this will be easy to fix. The culprit is this line https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/linear_model/coordinate_descent.py#L715 which passes `copy=False`, instead of `copy=self.copy_X`. That'll probably fix the issue.
Thanks for reporting it.
Thanks for the diagnosis, @gxyd!
@jnot... | 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
@@ -700,19 +700,23 @@ def fit(self, X, y, check_input=True):
raise ValueError('precompute should be one of T... | 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
@@ -3,6 +3,7 @@
# License: BSD 3 clause
import numpy as np
+import pytest... | ["sklearn/linear_model/tests/test_coordinate_descent.py::test_enet_copy_X_True[False]"] | ["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 | 2018-02-03T15:23:17Z | 1 | 10 | 1 | 1,332 | 0 | 0.8 | 1 | 0.55 | 1 | 0.255333 | 81.141 | |
5,706 | swe_smith::train::1153 | swe_smith | train | 1,153 | jd__tenacity.0d40e76f.func_pm_ctrl_invert_if__tv8qotg5 | swesmith/jd__tenacity.0d40e76f | jd/tenacity | python | null | # Bug: Context manager exception handling is reversed in AttemptManager
## Description
I found a bug in the `AttemptManager` class where the exception handling logic appears to be reversed. When using tenacity with context managers, exceptions are not being handled correctly.
## Steps to reproduce
Here's a simple e... | diff --git a/tenacity/__init__.py b/tenacity/__init__.py
index 72eba04..dc02aa3 100644
--- a/tenacity/__init__.py
+++ b/tenacity/__init__.py
@@ -205,13 +205,12 @@ class AttemptManager:
traceback: t.Optional["types.TracebackType"],
) -> t.Optional[bool]:
if exc_type is not None and exc_value is no... | ["tests/test_asyncio.py::TestContextManager::test_do_max_attempts", "tests/test_asyncio.py::TestContextManager::test_retry_with_async_exc", "tests/test_asyncio.py::TestContextManager::test_retry_with_async_result_or", "tests/test_asyncio.py::TestContextManager::test_retry_with_async_result_ror", "tests/test_asyncio.py:... | ["tests/test_after.py::TestAfterLogFormat::test_01_default", "tests/test_after.py::TestAfterLogFormat::test_02_custom_sec_format", "tests/test_asyncio.py::TestAsyncio::test_attempt_number_is_correct_for_interleaved_coroutines", "tests/test_asyncio.py::TestAsyncio::test_iscoroutinefunction", "tests/test_asyncio.py::Test... | jyangballin/swesmith.x86_64.jd_1776_tenacity.0d40e76f | true | null | 1 | 7 | 7 | 1,592 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288667 | 81.141 | |||
5,707 | swe_smith::train::43814 | swe_smith | train | 43,814 | pydata__patsy.a5d16484.combine_file__pq7q62es | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | NAAction constructor swaps on_NA parameter values
#### Description
When creating an NAAction object, the `on_NA` parameter gets its value swapped - passing "drop" results in "raise" behavior and vice versa. Additionally, the NA_types parameter validation is inverted, expecting a string when it should expect a list/tu... | diff --git a/patsy/missing.py b/patsy/missing.py
index b4d8a01..a2969e2 100644
--- a/patsy/missing.py
+++ b/patsy/missing.py
@@ -105,17 +105,17 @@ class NAAction(object):
.. versionadded:: 0.2.0
"""
- self.on_NA = on_NA
+ self.on_NA = "raise" if on_NA == "drop" else "drop"
if ... | ["patsy/build.py::test__eval_factor_numerical", "patsy/build.py::test__eval_factor_categorical", "patsy/build.py::test__examine_factor_types", "patsy/categorical.py::test_CategoricalSniffer", "patsy/categorical.py::test_categorical_to_int", "patsy/mgcv_cubic_splines.py::test_crs_with_specific_constraint", "patsy/mgcv_c... | ["patsy/build.py::test__max_allowed_dim", "patsy/build.py::test__column_combinations", "patsy/build.py::test__subterm_column_names_iter_and__build_subterm", "patsy/build.py::test__factors_memorize", "patsy/builtins.py::test_I", "patsy/builtins.py::test_Q", "patsy/categorical.py::test_C", "patsy/categorical.py::test_gue... | jyangballin/swesmith.x86_64.pydata_1776_patsy.a5d16484 | true | null | 1 | 16 | 43 | 1,411 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2885 | 81.1405 | |||
5,708 | swe_smith::train::977 | swe_smith | train | 977 | pytest-dev__iniconfig.16793ead.combine_file__mntnwwxj | swesmith/pytest-dev__iniconfig.16793ead | pytest-dev/iniconfig | python | null | # SectionWrapper.items() returns items in wrong order and with swapped key/value
## Description
I found an issue with the `SectionWrapper.items()` method in iniconfig. It's returning items in the wrong order and with the key and value swapped.
Here's what's happening:
1. The `items()` method is returning values in ... | diff --git a/src/iniconfig/__init__.py b/src/iniconfig/__init__.py
index 3c40bc9..e72914b 100644
--- a/src/iniconfig/__init__.py
+++ b/src/iniconfig/__init__.py
@@ -98,8 +98,8 @@ class SectionWrapper:
yield from sorted(section, key=lineof)
def items(self) -> Iterator[tuple[str, str]]:
- for name ... | ["testing/test_iniconfig.py::test_iniconfig_lineof", "testing/test_iniconfig.py::test_section_get", "testing/test_iniconfig.py::test_section_getitem", "testing/test_iniconfig.py::test_section_iter", "testing/test_iniconfig.py::test_iter_file_order"] | ["testing/test_iniconfig.py::test_tokenize[comment]", "testing/test_iniconfig.py::test_tokenize[comment2]", "testing/test_iniconfig.py::test_tokenize[section]", "testing/test_iniconfig.py::test_tokenize[value]", "testing/test_iniconfig.py::test_parse_empty", "testing/test_iniconfig.py::test_ParseError", "testing/test_i... | jyangballin/swesmith.x86_64.pytest-dev_1776_iniconfig.16793ead | true | null | 1 | 6 | 5 | 1,611 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2885 | 81.1405 | |||
5,709 | swe_smith::train::28191 | swe_smith | train | 28,191 | Mimino666__langdetect.a1598f1a.combine_module__64pm3fqh | swesmith/Mimino666__langdetect.a1598f1a | mimino666/langdetect | python | null | Unicode block detection fails with UnboundLocalError
#### Description
The unicode block detection function is throwing an `UnboundLocalError` when trying to determine the Unicode block for characters. This affects language detection functionality.
#### Steps/Code to Reproduce
```python
from langdetect.utils import ... | diff --git a/langdetect/utils/ngram.py b/langdetect/utils/ngram.py
index ee82e38..4bac93f 100644
--- a/langdetect/utils/ngram.py
+++ b/langdetect/utils/ngram.py
@@ -65,35 +65,34 @@ class NGram(object):
def normalize(cls, ch):
block = unicode_block(ch)
if block == UNICODE_BASIC_LATIN:
- ... | ["langdetect/tests/test_detector.py::DetectorTest::test_detector1", "langdetect/tests/test_detector.py::DetectorTest::test_detector4", "langdetect/tests/utils/test_ngram.py::NGramTest::test_ngram", "langdetect/tests/utils/test_ngram.py::NGramTest::test_normalize_for_romanian", "langdetect/tests/utils/test_ngram.py::NGr... | ["langdetect/tests/test_detector.py::DetectorTest::test_detector2", "langdetect/tests/test_detector.py::DetectorTest::test_detector3", "langdetect/tests/test_detector.py::DetectorTest::test_factory_from_json_string", "langdetect/tests/test_detector.py::DetectorTest::test_lang_list", "langdetect/tests/test_language.py::... | jyangballin/swesmith.x86_64.mimino666_1776_langdetect.a1598f1a | true | null | 2 | 40 | 8 | 931 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2885 | 81.1405 | |||
5,710 | swe_smith::train::9479 | swe_smith | train | 9,479 | marshmallow-code__webargs.dbde72fe.combine_file__b7meszaq | swesmith/marshmallow-code__webargs.dbde72fe | marshmallow-code/webargs | python | null | MultiDictProxy constructor arguments swapped causing AttributeError
#### Description
The MultiDictProxy class has its constructor arguments mixed up, causing AttributeError when trying to access data from web request parsing.
#### Steps/Code to Reproduce
```python
from webargs.multidictproxy import MultiDictProxy
f... | diff --git a/src/webargs/multidictproxy.py b/src/webargs/multidictproxy.py
index de9b82b..296142d 100644
--- a/src/webargs/multidictproxy.py
+++ b/src/webargs/multidictproxy.py
@@ -25,9 +25,10 @@ class MultiDictProxy(MutableMapping):
ma.fields.Tuple,
),
):
- self.data = multidict
- ... | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_querystring_args", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_form", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_or_form", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_querystring_default", "tests/test_aioh... | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_missing", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_with_charset", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_with_vendor_media_type", "tests/... | jyangballin/swesmith.x86_64.marshmallow-code_1776_webargs.dbde72fe | true | null | 1 | 23 | 172 | 1,271 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2885 | 81.1405 | |||
5,711 | swe_smith::train::1897 | swe_smith | train | 1,897 | agronholm__typeguard.b6a7e438.func_pm_remove_assign__nszc0i2r | swesmith/agronholm__typeguard.b6a7e438 | agronholm/typeguard | python | null | Protocol signature checking broken due to undefined variables
#### Description
When checking protocol compatibility, the signature validation fails with `UnboundLocalError` for several variables that are referenced before assignment. This affects protocol checking for methods with various argument patterns including ... | diff --git a/src/typeguard/_checkers.py b/src/typeguard/_checkers.py
index 5e34036..19fc89e 100644
--- a/src/typeguard/_checkers.py
+++ b/src/typeguard/_checkers.py
@@ -649,15 +649,13 @@ def check_io(
def check_signature_compatible(subject: type, protocol: type, attrname: str) -> None:
subject_sig = inspect.sig... | ["tests/test_checkers.py::TestIntersectingProtocol::test_valid_member_passes[empty_tuple_unspecialized]", "tests/test_checkers.py::TestIntersectingProtocol::test_valid_member_passes[range]", "tests/test_checkers.py::TestIntersectingProtocol::test_valid_member_passes[empty_tuple_int_specialized]", "tests/test_checkers.p... | ["tests/mypy/test_type_annotations.py::test_positive", "tests/mypy/test_type_annotations.py::test_negative", "tests/test_checkers.py::TestAnyStr::test_valid[str]", "tests/test_checkers.py::TestAnyStr::test_valid[bytes]", "tests/test_checkers.py::TestAnyStr::test_bad_type", "tests/test_checkers.py::TestBytesLike::test_v... | jyangballin/swesmith.x86_64.agronholm_1776_typeguard.b6a7e438 | true | null | 1 | 18 | 19 | 1,370 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288333 | 81.14 | |||
5,712 | swe_smith::train::3134 | swe_smith | train | 3,134 | Suor__funcy.207a7810.func_basic__l1k52ldw | swesmith/Suor__funcy.207a7810 | suor/funcy | python | null | autocurry function incorrectly handles keyword arguments with TypeError exceptions
#### Description
The `autocurry` function is not properly handling functions with keyword arguments when a `TypeError` is raised during function execution. Instead of continuing to curry the function, it's returning the result immediat... | diff --git a/funcy/funcs.py b/funcy/funcs.py
index 0a235bb..67f5fd9 100644
--- a/funcy/funcs.py
+++ b/funcy/funcs.py
@@ -77,15 +77,16 @@ def autocurry(func, n=EMPTY, _spec=None, _args=(), _kwargs={}):
kwargs = _kwargs.copy()
kwargs.update(kw)
- if not spec.varkw and len(args) + len(kwargs) >=... | ["tests/test_funcs.py::test_autocurry_named", "tests/test_funcs.py::test_autocurry_kwargs", "tests/test_funcs.py::test_autocurry_posonly", "tests/test_funcs.py::test_autocurry_builtin"] | ["tests/test_calc.py::test_memoize", "tests/test_calc.py::test_memoize_args_kwargs", "tests/test_calc.py::test_memoize_skip", "tests/test_calc.py::test_memoize_memory", "tests/test_calc.py::test_memoize_key_func", "tests/test_calc.py::test_make_lookuper", "tests/test_calc.py::test_make_lookuper_nested", "tests/test_cal... | jyangballin/swesmith.x86_64.suor_1776_funcy.207a7810 | true | null | 1 | 9 | 4 | 1,550 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288333 | 81.14 | |||
5,713 | swe_smith::train::1726 | swe_smith | train | 1,726 | agronholm__typeguard.b6a7e438.combine_module__sdy8vh50 | swesmith/agronholm__typeguard.b6a7e438 | agronholm/typeguard | python | null | Type name formatting broken for generic types and literals
#### Description
The type name formatting in error messages is producing incorrect output for generic types and literals. Generic type arguments are being reversed, and literal values are being converted to strings instead of using their repr format.
#### St... | diff --git a/src/typeguard/_decorators.py b/src/typeguard/_decorators.py
index a6c20cb..d38df50 100644
--- a/src/typeguard/_decorators.py
+++ b/src/typeguard/_decorators.py
@@ -30,7 +30,7 @@ else:
def make_cell(value: object) -> _Cell:
- return (lambda: value).__closure__[0] # type: ignore[index]
+ return (... | ["tests/test_checkers.py::TestLiteral::test_literal_union", "tests/test_checkers.py::TestMapping::test_bad_key_type", "tests/test_checkers.py::TestMapping::test_bad_value_type", "tests/test_checkers.py::TestMapping::test_bad_key_type_full_check", "tests/test_checkers.py::TestMapping::test_bad_value_type_full_check", "t... | ["tests/mypy/test_type_annotations.py::test_positive", "tests/mypy/test_type_annotations.py::test_negative", "tests/test_checkers.py::TestAnyStr::test_valid[str]", "tests/test_checkers.py::TestAnyStr::test_valid[bytes]", "tests/test_checkers.py::TestAnyStr::test_bad_type", "tests/test_checkers.py::TestBytesLike::test_v... | jyangballin/swesmith.x86_64.agronholm_1776_typeguard.b6a7e438 | true | null | 2 | 28 | 77 | 1,170 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288333 | 81.14 | |||
5,714 | swe_smith::train::47238 | swe_smith | train | 47,238 | python-trio__trio.cfbbe2c1.lm_rewrite__15dap547 | swesmith/python-trio__trio.cfbbe2c1 | python-trio/trio | python | null | # name_asyncgen function breaks for async generators
I noticed that the `name_asyncgen` function in `trio._util` is not working correctly anymore. When trying to get the name of an async generator, I'm getting incorrect results or errors.
## Reproduction
I created a simple async generator and tried to get its name:
... | diff --git a/src/trio/_util.py b/src/trio/_util.py
index 994a465..c5cb406 100644
--- a/src/trio/_util.py
+++ b/src/trio/_util.py
@@ -331,18 +331,27 @@ def name_asyncgen(agen: AsyncGeneratorType[object, NoReturn]) -> str:
"""Return the fully-qualified name of the async generator function
that produced the asyn... | ["src/trio/_core/_tests/test_asyncgen.py::test_asyncgen_basics", "src/trio/_core/_tests/test_asyncgen.py::test_interdependent_asyncgen_cleanup_order"] | ["src/trio/_core/_tests/test_asyncgen.py::test_asyncgen_throws_during_finalization", "src/trio/_core/_tests/test_asyncgen.py::test_firstiter_after_closing", "src/trio/_core/_tests/test_asyncgen.py::test_last_minute_gc_edge_case", "src/trio/_core/_tests/test_asyncgen.py::test_fallback_when_no_hook_claims_it", "src/trio/... | jyangballin/swesmith.x86_64.python-trio_1776_trio.cfbbe2c1 | true | null | 1 | 33 | 2 | 1,070 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288333 | 81.14 | |||
5,715 | swe_smith::train::42860 | swe_smith | train | 42,860 | python-jsonschema__jsonschema.93e0caa5.lm_rewrite__xkxdd55t | swesmith/python-jsonschema__jsonschema.93e0caa5 | python-jsonschema/jsonschema | python | null | # Bug: check_schema method doesn't respect custom metaschema validators
## Description
I found an issue with the `check_schema` method in the `jsonschema` library. When creating a custom validator with a different metaschema, the `check_schema` method doesn't use the correct validator for validating against the metas... | diff --git a/jsonschema/validators.py b/jsonschema/validators.py
index b8ca3bd..0ab65c3 100644
--- a/jsonschema/validators.py
+++ b/jsonschema/validators.py
@@ -306,16 +306,22 @@ def create(
@classmethod
def check_schema(cls, schema, format_checker=_UNSET):
- Validator = validator_for(cls... | ["jsonschema/tests/test_validators.py::TestCreateAndExtend::test_check_schema_with_different_metaschema"] | ["jsonschema/tests/test_cli.py::TestCLI::test_custom_error_format", "jsonschema/tests/test_cli.py::TestCLI::test_custom_error_format_applies_to_schema_errors", "jsonschema/tests/test_cli.py::TestCLI::test_instance_does_not_exist", "jsonschema/tests/test_cli.py::TestCLI::test_instance_does_not_exist_pretty_output", "jso... | jyangballin/swesmith.x86_64.python-jsonschema_1776_jsonschema.93e0caa5 | true | null | 1 | 14 | 1 | 1,450 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288333 | 81.14 | |||
5,716 | swe_smith::train::880 | swe_smith | train | 880 | oauthlib__oauthlib.1fd52536.lm_rewrite__fujllcja | swesmith/oauthlib__oauthlib.1fd52536 | oauthlib/oauthlib | python | null | # AuthorizationCodeGrant.create_authorization_code breaks when state is None
## Description
The `create_authorization_code` method in `AuthorizationCodeGrant` class throws an error when the request doesn't have a state parameter. This happens because the new implementation always tries to access `request.state` direc... | diff --git a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
index 09dc619..b81dafa 100644
--- a/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
+++ b/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py
@@ -164,13 +164,23 @@ class Aut... | ["tests/oauth2/rfc6749/grant_types/test_authorization_code.py::AuthorizationCodeGrantTest::test_create_authorization_response", "tests/oauth2/rfc6749/test_server.py::AuthorizationEndpointTest::test_authorization_grant", "tests/openid/connect/core/endpoints/test_openid_connect_params_handling.py::OpenIDConnectEndpointTe... | ["tests/oauth1/rfc5849/endpoints/test_access_token.py::AccessTokenEndpointTest::test_check_request_token", "tests/oauth1/rfc5849/endpoints/test_access_token.py::AccessTokenEndpointTest::test_check_verifier", "tests/oauth1/rfc5849/endpoints/test_access_token.py::AccessTokenEndpointTest::test_valid_request", "tests/oauth... | jyangballin/swesmith.x86_64.oauthlib_1776_oauthlib.1fd52536 | true | null | 1 | 22 | 23 | 1,288 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288 | 81.139 | |||
5,717 | swe_smith::train::1140 | swe_smith | train | 1,140 | jd__tenacity.0d40e76f.func_basic__v2m7t81x | swesmith/jd__tenacity.0d40e76f | jd/tenacity | python | null | RetryCallState initialization broken - args and kwargs swapped
#### Description
The RetryCallState constructor is incorrectly swapping the args and kwargs parameters, causing retry operations to fail with incorrect function arguments.
#### Steps/Code to Reproduce
```python
import tenacity
@tenacity.retry(stop=tena... | diff --git a/tenacity/__init__.py b/tenacity/__init__.py
index 72eba04..fe8cfff 100644
--- a/tenacity/__init__.py
+++ b/tenacity/__init__.py
@@ -528,29 +528,17 @@ class RetryCallState:
args: t.Any,
kwargs: t.Any,
) -> None:
- #: Retry call start timestamp
- self.start_time = time.mo... | ["tests/test_after.py::TestAfterLogFormat::test_01_default", "tests/test_after.py::TestAfterLogFormat::test_02_custom_sec_format", "tests/test_asyncio.py::TestAsyncio::test_attempt_number_is_correct_for_interleaved_coroutines", "tests/test_asyncio.py::TestContextManager::test_do_max_attempts", "tests/test_asyncio.py::T... | ["tests/test_asyncio.py::TestAsyncio::test_iscoroutinefunction", "tests/test_asyncio.py::TestAsyncio::test_repr", "tests/test_asyncio.py::TestAsyncio::test_retry", "tests/test_asyncio.py::TestAsyncio::test_retry_attributes", "tests/test_asyncio.py::TestAsyncio::test_retry_preserves_argument_defaults", "tests/test_async... | jyangballin/swesmith.x86_64.jd_1776_tenacity.0d40e76f | true | null | 1 | 30 | 30 | 1,128 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288 | 81.139 | |||
5,718 | swe_smith::train::55548 | swe_smith | train | 55,548 | RoaringBitmap__roaring.09c46a0a.func_pm_flip_operators__r46l5qf1 | swesmith/RoaringBitmap__roaring.09c46a0a | roaringbitmap/roaring | go | null | Index out of range panic in roaringArray64.advanceUntil method
#### Description
When using BSI operations with negative values, the code panics with "runtime error: index out of range [-1]". This appears to be related to the `advanceUntil` method in `roaringArray64` which is producing negative indices that cause arra... | diff --git a/roaring64/roaringarray64.go b/roaring64/roaringarray64.go
index 09c366f..924ebb4 100644
--- a/roaring64/roaringarray64.go
+++ b/roaring64/roaringarray64.go
@@ -344,15 +344,15 @@ func (ra *roaringArray64) hasRunCompression() bool {
* min, or size if it is not possible.
*/
func (ra *roaringArray... | ["TestSumWithNegative"] | ["TestParAggregations", "TestParAggregations/par1", "TestParAggregations/par1/simple_case", "TestParAggregations/par1/aggregate_nothing", "TestParAggregations/par1/single_bitmap", "TestParAggregations/par1/empty_and_single_elem_bitmaps", "TestParAggregations/par1/two_single_elem_disjoint_sets", "TestParAggregations/par... | jyangballin/swesmith.x86_64.roaringbitmap_1776_roaring.09c46a0a | true | null | 1 | 12 | 1 | 1,488 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288 | 81.139 | |||
5,719 | swe_smith::train::25121 | swe_smith | train | 25,121 | pylint-dev__astroid.b114f6b5.combine_file__w4rwriv5 | swesmith/pylint-dev__astroid.b114f6b5 | pylint-dev/astroid | python | null | Function argument registration broken after recent changes
#### Description
After some recent changes to the raw building module, function argument registration is completely broken. Functions that should have their arguments properly registered in their local scope are failing to do so, causing inference issues thro... | diff --git a/astroid/raw_building.py b/astroid/raw_building.py
index c1f7ec1..cf85c0b 100644
--- a/astroid/raw_building.py
+++ b/astroid/raw_building.py
@@ -45,20 +45,21 @@ TYPE_ELLIPSIS = type(...)
def _attach_local_node(parent, node, name: str) -> None:
- node.name = name # needed by add_local_node
+ node... | ["tests/brain/numpy/test_core_einsumfunc.py::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/test_attr.py::AttrsTest::test_attr_transform", "tests/brain/test_brain.py::CollectionsDequeTests::test_deque", "tests/brain/test_brain.py::CollectionsDequeTests::test_deque_py35methods", "tests/brain/test_brain.py:... | ["tests/brain/numpy/test_core_einsumfunc.py::test_function_parameters", "tests/brain/numpy/test_core_fromnumeric.py::BrainNumpyCoreFromNumericTest::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_function_base.py::BrainNumpyCoreFunctionBaseTest::test_numpy_function_calls_inferred_as_ndarray... | jyangballin/swesmith.x86_64.pylint-dev_1776_astroid.b114f6b5 | true | null | 1 | 27 | 65 | 1,188 | 0 | 0.6 | 1 | 0.75 | 1 | 0.288 | 81.139 | |||
5,720 | swe_smith::train::24233 | swe_smith | train | 24,233 | sunpy__sunpy.f8edfd5c.func_pm_remove_assign__hsp9beek | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | WCS coordinate mapping broken for solar coordinate frames
#### Description
When converting solar coordinate frames to WCS objects, several coordinate types are not being properly set, causing `UnboundLocalError` exceptions and incorrect unit assignments.
#### Steps/Code to Reproduce
```python
import astropy.units a... | diff --git a/sunpy/coordinates/wcs_utils.py b/sunpy/coordinates/wcs_utils.py
index 72706d7..5456550 100644
--- a/sunpy/coordinates/wcs_utils.py
+++ b/sunpy/coordinates/wcs_utils.py
@@ -170,20 +170,17 @@ def solar_frame_to_wcs_mapping(frame, projection='TAN'):
if isinstance(frame.observer, BaseCoordinateFrame):... | ["sunpy/coordinates/tests/test_wcs_utils.py::test_hpc_frame_to_wcs", "sunpy/coordinates/tests/test_wcs_utils.py::test_hgs_frame_to_wcs", "sunpy/coordinates/tests/test_wcs_utils.py::test_hgc_frame_to_wcs", "sunpy/coordinates/tests/test_wcs_utils.py::test_hcc_frame_to_wcs", "sunpy/coordinates/tests/test_wcs_utils.py::tes... | ["sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping[ctype0-Helioprojective]", "sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping[ctype1-Helioprojective]", "sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping[ctype2-HeliographicStonyhurst]", "sunpy/coordinates/tests/test_wcs... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 11 | 5 | 1,507 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287833 | 81.1385 | |||
5,721 | swe_smith::train::3306 | swe_smith | train | 3,306 | pygments__pygments.27649ebb.combine_file__5qtxjczz | swesmith/pygments__pygments.27649ebb | pygments/pygments | python | null | LassoLexer initialization fails with AttributeError on builtinshighlighting
#### Description
The LassoLexer class fails to initialize properly, causing an AttributeError when trying to access the `builtinshighlighting` attribute during initialization. This affects lexer guessing and basic lexer functionality.
#### S... | diff --git a/pygments/lexers/javascript.py b/pygments/lexers/javascript.py
index 891e48e..e606e80 100644
--- a/pygments/lexers/javascript.py
+++ b/pygments/lexers/javascript.py
@@ -750,21 +750,20 @@ class LassoLexer(RegexLexer):
}
def __init__(self, **options):
- self.builtinshighlighting = get_bool_... | ["tests/test_cmdline.py::test_C_opt", "tests/test_cmdline.py::test_stdin", "tests/test_basic_api.py::test_lexer_options[LassoHtmlLexer]", "tests/test_basic_api.py::test_lexer_options[LassoJavascriptLexer]", "tests/test_basic_api.py::test_random_input[LassoHtmlLexer]", "tests/test_basic_api.py::test_random_input[LassoCs... | ["tests/test_rtf_formatter.py::test_hl_linenostart_lines_highlighted", "tests/test_rtf_formatter.py::test_rtf_footer", "tests/test_rtf_formatter.py::test_rtf_header", "tests/test_rtf_formatter.py::test_lineno_color_style_specify_hex", "tests/test_rtf_formatter.py::test_linenos_newline_characters", "tests/test_rtf_forma... | jyangballin/swesmith.x86_64.pygments_1776_pygments.27649ebb | true | null | 1 | 30 | 28 | 1,127 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287833 | 81.1385 | |||
5,722 | r2e_gym::train::5009 | r2e_gym | train | 5,009 | datalad__ade51ea0dab18977814b9f09beedc77b52f2e9e0 | datalad | datalad/datalad | python | ade51ea0dab18977814b9f09beedc77b52f2e9e0 | **Title:** Suggestion Message Uses "Any" Instead of "One", Causing Output Inconsistencies
**Description:**
After updating the suggestion message to use "any" instead of "one" when providing suggestions for unknown arguments, the output no longer matches the expected format. This change leads to inconsistencies, especi... | diff --git a/datalad/cmdline/main.py b/datalad/cmdline/main.py
--- a/datalad/cmdline/main.py
+++ b/datalad/cmdline/main.py
@@ -31,9 +31,13 @@
from datalad.support.exceptions import IncompleteResultsError
from datalad.support.exceptions import CommandError
from .helpers import strip_arg_from_argv
-from ..utils import... | 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
@@ -268,7 +268,7 @@
assert_equal(out.getvalue(),
"error: Failed badly\n"
"datalad: Unknown parent 'muther'. See... | null | null | namanjain12/datalad_final:ade51ea0dab18977814b9f09beedc77b52f2e9e0 | true | null | 2 | 37 | null | 1,699 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.4065 | 81.13825 | ||
5,723 | swe_smith::train::18567 | swe_smith | train | 18,567 | HIPS__autograd.ac044f0d.lm_rewrite__vfh8mcit | swesmith/HIPS__autograd.ac044f0d | hips/autograd | python | null | Shape Mismatch in `np.tensordot` with Custom Axes
Hello everyone,
I've stumbled upon a peculiar issue when using `np.tensordot` with custom axes. It seems that when specifying axes as lists or tuples, a shape mismatch error is triggered. This is particularly evident when the axes are nested or involve negative indice... | diff --git a/autograd/numpy/numpy_vjps.py b/autograd/numpy/numpy_vjps.py
index 08d4e1b..93b2189 100644
--- a/autograd/numpy/numpy_vjps.py
+++ b/autograd/numpy/numpy_vjps.py
@@ -661,32 +661,46 @@ defvjp(
@primitive
def tensordot_adjoint_0(B, G, axes, A_ndim, B_ndim):
- # The adjoint of the operator
- # A |--> ... | ["tests/test_numpy.py::test_tensordot_kwargs_by_position", "tests/test_systematic.py::test_kron", "tests/test_systematic.py::test_inner", "tests/test_systematic.py::test_tensordot_6", "tests/test_systematic.py::test_tensordot_7", "tests/test_systematic.py::test_tensordot_8", "tests/test_systematic.py::test_tensordot_1"... | ["tests/test_core.py::test_sub", "tests/test_direct.py::test_grad", "tests/test_fft.py::test_rfftn_odd_not_implemented", "tests/test_core.py::test_div", "tests/test_direct.py::test_deriv", "tests/test_linalg.py::test_norm_axis[shape0-2]", "tests/test_linalg.py::test_inv_3d", "tests/test_core.py::test_mul", "tests/test_... | jyangballin/swesmith.x86_64.hips_1776_autograd.ac044f0d | true | null | 1 | 34 | 13 | 1,046 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287667 | 81.138 | |||
5,724 | swe_smith::train::24920 | swe_smith | train | 24,920 | marshmallow-code__marshmallow.9716fc62.lm_rewrite__cj9mdaku | swesmith/marshmallow-code__marshmallow.9716fc62 | marshmallow-code/marshmallow | python | null | It seems there's an issue with the `set_hook` function when using the `VALIDATES` tag. When attempting to validate fields, a `TypeError: string indices must be integers` is raised. This error occurs when the `field_name` is being processed, which suggests that the handling of the `field_name` parameter might be incorre... | diff --git a/src/marshmallow/decorators.py b/src/marshmallow/decorators.py
index 965edb6..2d7bbfd 100644
--- a/src/marshmallow/decorators.py
+++ b/src/marshmallow/decorators.py
@@ -201,9 +201,8 @@ def post_load(
return set_hook(fn, POST_LOAD, many=pass_many, pass_original=pass_original)
-def set_hook(
- fn:... | ["tests/test_decorators.py::TestValidatesDecorator::test_validates", "tests/test_decorators.py::TestValidatesDecorator::test_validates_with_attribute", "tests/test_decorators.py::TestValidatesDecorator::test_validates_decorator", "tests/test_decorators.py::TestValidatesDecorator::test_field_not_present", "tests/test_de... | ["tests/test_decorators.py::test_decorated_processors[True]", "tests/test_decorators.py::test_decorated_processors[False]", "tests/test_decorators.py::test_decorated_processor_returning_none[exclude]", "tests/test_decorators.py::test_decorated_processor_returning_none[include]", "tests/test_decorators.py::test_decorate... | jyangballin/swesmith.x86_64.marshmallow-code_1776_marshmallow.9716fc62 | true | null | 1 | 34 | 10 | 1,046 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287667 | 81.138 | |||
5,725 | swe_smith::train::28066 | swe_smith | train | 28,066 | jsvine__pdfplumber.02ff4313.lm_rewrite__r648ffcj | swesmith/jsvine__pdfplumber.02ff4313 | jsvine/pdfplumber | python | null | ### Text Extraction Fails with AttributeError
#### Description
After the recent changes, there seems to be an issue with text extraction from PDF pages. The `extract_text` method is throwing an `AttributeError` when attempting to access certain attributes of the `PDF` object. This is affecting multiple functionalitie... | diff --git a/pdfplumber/page.py b/pdfplumber/page.py
index 71330d8..2c63f3f 100644
--- a/pdfplumber/page.py
+++ b/pdfplumber/page.py
@@ -523,16 +523,15 @@ class Page(Container):
return table.extract(**(tset.text_settings or {}))
def _get_textmap(self, **kwargs: Any) -> TextMap:
- defaults: Di... | ["tests/test_basics.py::Test::test_outside_bbox", "tests/test_basics.py::Test::test_unicode_normalization", "tests/test_convert.py::Test::test_cli_text", "tests/test_dedupe_chars.py::Test::test_extra_attrs", "tests/test_dedupe_chars.py::Test::test_extract_text", "tests/test_dedupe_chars.py::Test::test_extract_text2", "... | ["tests/test_basics.py::Test::test_annots", "tests/test_basics.py::Test::test_annots_cropped", "tests/test_basics.py::Test::test_annots_rotated", "tests/test_basics.py::Test::test_bad_fileobj", "tests/test_basics.py::Test::test_colors", "tests/test_basics.py::Test::test_crop_and_filter", "tests/test_basics.py::Test::te... | jyangballin/swesmith.x86_64.jsvine_1776_pdfplumber.02ff4313 | true | null | 1 | 19 | 29 | 1,346 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287667 | 81.138 | |||
5,726 | swe_smith::train::6509 | swe_smith | train | 6,509 | mahmoud__boltons.3bfcfdd0.func_pm_remove_wrapper__lr76l2fe | swesmith/mahmoud__boltons.3bfcfdd0 | mahmoud/boltons | python | null | wrap_trace fails to create traced instances for certain object types
Description
The `wrap_trace` function in `debugutils.py` is unable to create traced instances for several built-in types and custom objects, raising `TypeError: unable to wrap_trace` errors.
Steps/Code to Reproduce
```python
from boltons.debugutil... | diff --git a/boltons/debugutils.py b/boltons/debugutils.py
index 16d18d4..2a303dd 100644
--- a/boltons/debugutils.py
+++ b/boltons/debugutils.py
@@ -218,11 +218,6 @@ def wrap_trace(obj, hook=trace_print_hook,
wrapped.__module__ = func.__module__
except Exception:
pass
- try:
- ... | ["tests/test_debugutils_trace.py::test_trace_dict", "tests/test_debugutils_trace.py::test_trace_bytes", "tests/test_debugutils_trace.py::test_trace_exc", "tests/test_debugutils_trace.py::test_trace_which", "tests/test_debugutils_trace.py::test_trace_namedtuple", "tests/test_debugutils_trace.py::test_trace_oldstyle"] | ["tests/test_cacheutils.py::test_lru_add", "tests/test_cacheutils.py::test_lri", "tests/test_cacheutils.py::test_lri_cache_eviction", "tests/test_cacheutils.py::test_cache_sizes_on_repeat_insertions", "tests/test_cacheutils.py::test_lru_basic", "tests/test_cacheutils.py::test_lru_dict_replacement[LRU]", "tests/test_cac... | jyangballin/swesmith.x86_64.mahmoud_1776_boltons.3bfcfdd0 | true | null | 1 | 11 | 6 | 1,506 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287667 | 81.138 | |||
5,727 | swe_smith::train::10131 | swe_smith | train | 10,131 | paramiko__paramiko.23f92003.combine_file__iji0kw1s | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | SFTP posix_rename and get operations have swapped parameters
Description
The SFTP client's `posix_rename` method appears to have its oldpath and newpath parameters swapped, causing files to be renamed in the wrong direction. Additionally, the `get` method is trying to open the remote path locally instead of the local... | diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index 066cd83..c9a050e 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -437,11 +437,11 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
:versionadded: 2.2
"""
- oldpath = self._adjust_cwd(oldpath)
... | ["tests/test_sftp.py::TestSFTP::testa_posix_rename", "tests/test_sftp.py::TestSFTP::test_get_put", "tests/test_sftp.py::TestSFTP::test_get_without_prefetch"] | ["tests/agent.py::AgentKey_::str_is_repr", "tests/agent.py::AgentKey_::init::needs_at_least_two_arguments", "tests/agent.py::AgentKey_::init::sets_attributes_and_parses_blob", "tests/agent.py::AgentKey_::init::comment_optional", "tests/agent.py::AgentKey_::init::sets_inner_key_when_known_type[rsa]", "tests/agent.py::Ag... | jyangballin/swesmith.x86_64.paramiko_1776_paramiko.23f92003 | true | null | 1 | 12 | 3 | 1,486 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287667 | 81.138 | |||
5,728 | swe_smith::train::22466 | swe_smith | train | 22,466 | tweepy__tweepy.91a41c6e.func_pm_ctrl_invert_if__vjg293h0 | swesmith/tweepy__tweepy.91a41c6e | tweepy/tweepy | python | null | ### FileCache Initialization Fails with FileNotFoundError
#### Description
After applying the recent changes, it seems that the `FileCache` initialization is encountering a `FileNotFoundError`. This issue arises when attempting to lock a file in the cache directory. The error can be reproduced consistently under the ... | diff --git a/tweepy/cache.py b/tweepy/cache.py
index bfb87b3..ce6ce56 100644
--- a/tweepy/cache.py
+++ b/tweepy/cache.py
@@ -167,16 +167,15 @@ class FileCache(Cache):
def _lock_file_posix(self, path, exclusive=True):
lock_path = path + '.lock'
if exclusive is True:
- f_lock = open(lock... | ["tests/test_api.py::TweepyCacheTests::testfilecache"] | ["tests/test_api.py::TweepyAPITests::test_indicate_direct_message_typing", "tests/test_api.py::TweepyAPITests::testaddremovelistmember", "tests/test_api.py::TweepyAPITests::testaddremovelistmembers", "tests/test_api.py::TweepyAPITests::testcachedifferentqueryparameters", "tests/test_api.py::TweepyAPITests::testcachedre... | jyangballin/swesmith.x86_64.tweepy_1776_tweepy.91a41c6e | true | null | 1 | 7 | 1 | 1,585 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,729 | swe_smith::train::39604 | swe_smith | train | 39,604 | pallets__jinja.ada0a9a6.lm_rewrite__kx1fo4xs | swesmith/pallets__jinja.ada0a9a6 | pallets/jinja | python | null | ### SecurityError not raised for restricted attribute access
#### Description
It seems that the `attr` filter is not correctly handling restricted attribute access in a sandboxed environment. Specifically, when attempting to access the `__subclasses__` attribute of a class, the expected `SecurityError` is not being r... | diff --git a/src/jinja2/filters.py b/src/jinja2/filters.py
index 1420877..860bf72 100644
--- a/src/jinja2/filters.py
+++ b/src/jinja2/filters.py
@@ -1396,9 +1396,8 @@ def do_reverse(value: t.Union[str, t.Iterable[V]]) -> t.Union[str, t.Iterable[V]
@pass_environment
-def do_attr(
- environment: "Environment", ob... | ["tests/test_security.py::TestSandbox::test_attr_filter"] | ["tests/test_api.py::TestExtendedAPI::test_item_and_attribute", "tests/test_api.py::TestExtendedAPI::test_finalize", "tests/test_api.py::TestExtendedAPI::test_finalize_constant_expression", "tests/test_api.py::TestExtendedAPI::test_no_finalize_template_data", "tests/test_api.py::TestExtendedAPI::test_context_finalize",... | jyangballin/swesmith.x86_64.pallets_1776_jinja.ada0a9a6 | true | null | 1 | 27 | 1 | 1,185 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,730 | swe_smith::train::35690 | swe_smith | train | 35,690 | stanfordnlp__dspy.651a4c71.func_pm_remove_assign__alk5n4dy | swesmith/stanfordnlp__dspy.651a4c71 | stanfordnlp/dspy | python | null | # Synthesizer fails to generate data due to missing variables
## Description
I'm trying to use the `Synthesizer` class to generate synthetic data, but it's failing with an error. The issue appears to be in the `generate` method where some variables are referenced but not defined.
## To Reproduce
Here's a minimal ex... | diff --git a/dspy/experimental/synthesizer/synthesizer.py b/dspy/experimental/synthesizer/synthesizer.py
index e1184c5..2a0d493 100644
--- a/dspy/experimental/synthesizer/synthesizer.py
+++ b/dspy/experimental/synthesizer/synthesizer.py
@@ -170,7 +170,7 @@ class Synthesizer:
if self.config.num_example_for_op... | ["tests/signatures/test_adapter_image.py::test_pdf_url_support", "tests/signatures/test_adapter_image.py::test_different_mime_types", "tests/signatures/test_adapter_image.py::test_mime_type_from_response_headers", "tests/signatures/test_adapter_image.py::test_pdf_from_file"] | ["tests/adapters/test_chat_adapter.py::test_chat_adapter_sync_call", "tests/adapters/test_chat_adapter.py::test_chat_adapter_async_call", "tests/adapters/test_json_adapter.py::test_json_adapter_with_structured_outputs_does_not_mutate_original_signature", "tests/adapters/test_json_adapter.py::test_json_adapter_sync_call... | jyangballin/swesmith.x86_64.stanfordnlp_1776_dspy.651a4c71 | true | null | 1 | 17 | 4 | 1,385 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,731 | swe_smith::train::43703 | swe_smith | train | 43,703 | sloria__environs.73c372df.func_basic__psy77r99 | swesmith/sloria__environs.73c372df | sloria/environs | python | null | # JSON parsing in environs silently returns None instead of raising ValidationError
## Description
I've discovered an issue with the JSON parsing functionality in environs. When invalid JSON is provided, the library silently returns `None` instead of raising a validation error as expected.
## Reproduction
```python... | diff --git a/src/environs/__init__.py b/src/environs/__init__.py
index 00f6072..c0c29c2 100644
--- a/src/environs/__init__.py
+++ b/src/environs/__init__.py
@@ -294,12 +294,12 @@ def _preprocess_json(value: str | typing.Mapping | list, **kwargs):
try:
if isinstance(value, str):
return pyjson.... | ["tests/test_environs.py::TestCasting::test_invalid_json_raises_error", "tests/test_environs.py::TestCasting::test_json_default"] | ["tests/test_environs.py::TestCasting::test_call", "tests/test_environs.py::TestCasting::test_call_with_default", "tests/test_environs.py::TestCasting::test_basic", "tests/test_environs.py::TestCasting::test_empty_str", "tests/test_environs.py::TestCasting::test_int_cast", "tests/test_environs.py::TestCasting::test_inv... | jyangballin/swesmith.x86_64.sloria_1776_environs.73c372df | true | null | 1 | 6 | 2 | 1,605 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,732 | swe_smith::train::24358 | swe_smith | train | 24,358 | sunpy__sunpy.f8edfd5c.func_pm_remove_loop__chrst8az | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | TimeSeries _repr_html_ method fails with IndexError when accessing histogram data
#### Description
The `_repr_html_` method in `GenericTimeSeries` is throwing an `IndexError: list index out of range` when trying to access elements from an empty `hlist2` list. This appears to be related to the histogram generation cod... | diff --git a/sunpy/timeseries/timeseriesbase.py b/sunpy/timeseries/timeseriesbase.py
index 80e5d20..a1b5b65 100644
--- a/sunpy/timeseries/timeseriesbase.py
+++ b/sunpy/timeseries/timeseriesbase.py
@@ -325,28 +325,12 @@ class GenericTimeSeries:
# created using the Astropy hist method that uses Scott's rule
... | ["sunpy/timeseries/tests/test_timeseriesbase.py::test_repr_html", "sunpy/timeseries/tests/test_timeseriesbase.py::test_repr_html_", "sunpy/timeseries/tests/test_timeseriesbase.py::test_quicklook"] | ["sunpy/timeseries/tests/test_timeseriesbase.py::test_units_type[eve_test_ts]", "sunpy/timeseries/tests/test_timeseriesbase.py::test_units_type[esp_test_ts]", "sunpy/timeseries/tests/test_timeseriesbase.py::test_units_type[fermi_gbm_test_ts]", "sunpy/timeseries/tests/test_timeseriesbase.py::test_units_type[norh_test_ts... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 17 | 3 | 1,385 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,733 | swe_smith::train::48687 | swe_smith | train | 48,687 | facebookresearch__hydra.0f03eb60.combine_module__bo2cbkzx | swesmith/facebookresearch__hydra.0f03eb60 | facebookresearch/hydra | python | null | Function argument validation and string unquoting broken in grammar functions
#### Description
The `sort()` function and other grammar functions are not working correctly. When calling `sort()` with no arguments, it should raise a `ValueError` but instead returns `None`. Additionally, quoted string arguments are not ... | diff --git a/hydra/_internal/grammar/functions.py b/hydra/_internal/grammar/functions.py
index 6e84a1a..ea9bd39 100644
--- a/hydra/_internal/grammar/functions.py
+++ b/hydra/_internal/grammar/functions.py
@@ -47,8 +47,6 @@ class Functions:
# Unquote strings in kwargs values
kwargs = {}
for ke... | ["tests/test_hydra_cli_errors.py::test_cli_error[empty_sort]", "tests/test_overrides_parser.py::test_value[sort(3,2,1)]", "tests/test_overrides_parser.py::test_value[sort(a,c,b,reverse=true)]", "tests/test_overrides_parser.py::test_value[float(sort(3,2,1))]", "tests/test_overrides_parser.py::test_value[sort(3,2,str(1))... | ["build_helpers/test_helpers.py::test_find[none]", "build_helpers/test_helpers.py::test_find[all]", "build_helpers/test_helpers.py::test_find[filter_a]", "build_helpers/test_helpers.py::test_find[include_a]", "build_helpers/test_helpers.py::test_find[include_a,exclude_file1]", "build_helpers/test_helpers.py::test_find[... | jyangballin/swesmith.x86_64.facebookresearch_1776_hydra.0f03eb60 | true | null | 2 | 16 | 9 | 1,405 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,734 | swe_smith::train::44006 | swe_smith | train | 44,006 | pydata__patsy.a5d16484.func_basic__eh340fvg | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | [Bug]: ContrastMatrix column_suffixes comparison fails and wrong exception type
### Bug summary
There appears to be an issue with the `ContrastMatrix` class where the column suffixes are not being properly compared and the wrong exception type is being raised when there's a mismatch between matrix dimensions and colu... | diff --git a/patsy/contrasts.py b/patsy/contrasts.py
index 0ac9ac7..831b378 100644
--- a/patsy/contrasts.py
+++ b/patsy/contrasts.py
@@ -56,13 +56,13 @@ class ContrastMatrix:
def test_ContrastMatrix():
cm = ContrastMatrix([[1, 0], [0, 1]], ["a", "b"])
assert np.array_equal(cm.matrix, np.eye(2))
- assert c... | ["patsy/contrasts.py::test_ContrastMatrix"] | ["patsy/build.py::test__max_allowed_dim", "patsy/build.py::test__eval_factor_numerical", "patsy/build.py::test__eval_factor_categorical", "patsy/build.py::test__column_combinations", "patsy/build.py::test__subterm_column_names_iter_and__build_subterm", "patsy/build.py::test__factors_memorize", "patsy/build.py::test__ex... | jyangballin/swesmith.x86_64.pydata_1776_patsy.a5d16484 | true | null | 1 | 6 | 1 | 1,605 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2875 | 81.1375 | |||
5,735 | swe_smith::train::9569 | swe_smith | train | 9,569 | marshmallow-code__webargs.dbde72fe.combine_module__y5o08b51 | swesmith/marshmallow-code__webargs.dbde72fe | marshmallow-code/webargs | python | null | TornadoParser error handling changed - validation error messages not propagated correctly
#### Description
The TornadoParser's error handling has been modified and now validation error messages are not being propagated correctly. When validation fails, the specific error message is replaced with a generic "Invalid re... | diff --git a/src/webargs/testing.py b/src/webargs/testing.py
index 0d7bf0f..fd58018 100644
--- a/src/webargs/testing.py
+++ b/src/webargs/testing.py
@@ -85,7 +85,7 @@ class CommonTestCase:
).json == {"name": "World"}
def test_parse_json_empty(self, testapp):
- assert testapp.post_json("/echo_json... | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_empty", "tests/test_bottleparser.py::TestBottleParser::test_parse_json_empty", "tests/test_djangoparser.py::TestDjangoParser::test_parse_json_empty", "tests/test_falconparser.py::TestFalconParser::test_parse_json_empty", "tests/test_flaskparser.py::TestF... | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_querystring_args", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_form", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_missing", "tests/test_aiohttpparser.py::T... | jyangballin/swesmith.x86_64.marshmallow-code_1776_webargs.dbde72fe | true | null | 2 | 25 | 9 | 1,224 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287333 | 81.137 | |||
5,736 | swe_smith::train::27188 | swe_smith | train | 27,188 | tkrajina__gpxpy.09fc46b3.func_pm_ctrl_shuffle__kqrhr4it | swesmith/tkrajina__gpxpy.09fc46b3 | tkrajina/gpxpy | python | null | Length calculation returns undefined variable instead of computed distance
#### Description
The `length()` function in `gpxpy.geo` module is returning an undefined variable instead of the calculated total distance between locations.
#### Steps/Code to Reproduce
```python
import gpxpy
import gpxpy.geo
# Create some... | diff --git a/gpxpy/geo.py b/gpxpy/geo.py
index 00fa3bb..f8516de 100644
--- a/gpxpy/geo.py
+++ b/gpxpy/geo.py
@@ -93,6 +93,17 @@ def get_course(latitude_1: float, longitude_1: float, latitude_2: float, longitu
def length(locations: List["Location"]=[], _3d: bool=False) -> float:
+ if not locations:
+ retu... | ["test.py::GPXTests::test_clone_and_smooth", "test.py::GPXTests::test_moving_stopped_times", "test.py::GPXTests::test_reduce_by_min_distance", "test.py::GPXTests::test_reduce_gpx_file", "test.py::GPXTests::test_simplify", "test.py::GPXTests::test_track_points_data"] | ["test.py::GPXTests::test_10_to_11_conversion", "test.py::GPXTests::test_add_elevation", "test.py::GPXTests::test_add_missing_data_no_intervals", "test.py::GPXTests::test_add_missing_data_one_interval", "test.py::GPXTests::test_add_missing_data_one_interval_and_empty_points_on_start_and_end", "test.py::GPXTests::test_a... | jyangballin/swesmith.x86_64.tkrajina_1776_gpxpy.09fc46b3 | true | null | 1 | 23 | 6 | 1,264 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287333 | 81.137 | |||
5,737 | r2e_gym::train::5287 | r2e_gym | train | 5,287 | aiohttp__f569894caa7cfbc2ec03fb5eed6021b9899dc4b4 | aiohttp | aio-libs/aiohttp | python | f569894caa7cfbc2ec03fb5eed6021b9899dc4b4 | **Title:** Authorization Header Not Dropped on Redirect to Different Origin with Base URL Set
**Description:**
When a client session is configured with a base URL and global authentication, the `Authorization` header is not removed when a redirect leads to a different origin. This can result in unintended exposure of ... | diff --git a/CHANGES/8966.feature.rst b/CHANGES/8966.feature.rst
--- a/CHANGES/8966.feature.rst
+++ b/CHANGES/8966.feature.rst
@@ -0,0 +1 @@
+Updated ClientSession's auth logic to include default auth only if the request URL's origin matches _base_url; otherwise, the auth will not be included -- by :user:`MaximZemskov`... | diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py
--- a/tests/test_client_functional.py
+++ b/tests/test_client_functional.py
@@ -2961,6 +2961,138 @@
assert resp.status == 200
+async def test_auth_persist_on_redirect_to_other_host_with_global_auth(
+ create_server_for_url_an... | null | null | namanjain12/aiohttp_final:f569894caa7cfbc2ec03fb5eed6021b9899dc4b4 | true | null | 3 | 14 | null | 2,156 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.406 | 81.13675 | ||
5,738 | swe_smith::train::28427 | swe_smith | train | 28,427 | encode__starlette.db5063c2.combine_module__eqwdds37 | swesmith/encode__starlette.db5063c2 | encode/starlette | python | null | # Server error middleware returns incorrect status code and content type
## Description
I've found a bug in the error handling middleware that causes incorrect responses when errors occur.
Steps to reproduce:
1. Create a simple app that raises an exception
2. Use ServerErrorMiddleware with debug=True
3. Make a reque... | diff --git a/starlette/middleware/errors.py b/starlette/middleware/errors.py
index 76ad776..dce79df 100644
--- a/starlette/middleware/errors.py
+++ b/starlette/middleware/errors.py
@@ -250,11 +250,11 @@ class ServerErrorMiddleware:
def debug_response(self, request: Request, exc: Exception) -> Response:
ac... | ["tests/middleware/test_errors.py::test_debug_text[asyncio]", "tests/middleware/test_errors.py::test_debug_html[asyncio]", "tests/middleware/test_errors.py::test_debug_text[trio]", "tests/middleware/test_errors.py::test_debug_html[trio]", "tests/test_exceptions.py::test_not_modified[asyncio]", "tests/test_exceptions.py... | ["tests/middleware/test_base.py::test_custom_middleware[asyncio]", "tests/middleware/test_base.py::test_state_data_across_multiple_middlewares[asyncio]", "tests/middleware/test_base.py::test_app_middleware_argument[asyncio]", "tests/middleware/test_base.py::test_fully_evaluated_response[asyncio]", "tests/middleware/tes... | jyangballin/swesmith.x86_64.encode_1776_starlette.db5063c2 | true | null | 2 | 7 | 6 | 1,583 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287167 | 81.1365 | |||
5,739 | swe_smith::train::21364 | swe_smith | train | 21,364 | rubik__radon.54b88e58.combine_module__i86af074 | swesmith/rubik__radon.54b88e58 | rubik/radon | python | null | # XML output broken in CCHarvester and fingerprint generation issues
## Description
I've found two issues with the latest version:
1. The `as_xml()` method in `CCHarvester` class is calling a non-existent method `_to_dict()` instead of `_to_dicts()`, causing errors when trying to export results as XML.
2. The finge... | diff --git a/radon/cli/harvest.py b/radon/cli/harvest.py
index ac14fe5..abfc452 100644
--- a/radon/cli/harvest.py
+++ b/radon/cli/harvest.py
@@ -206,7 +206,7 @@ class CCHarvester(Harvester):
'''Format the results as XML. This is meant to be compatible with
Jenkin's CCM plugin. Therefore not all the fi... | ["radon/tests/test_cli_harvest.py::test_cc_as_json_xml", "radon/tests/test_cli_tools.py::test_cc_error_to_codeclimate", "radon/tests/test_cli_tools.py::test_cc_to_codeclimate"] | ["radon/tests/test_cli.py::test_config_base_behavior", "radon/tests/test_cli.py::test_config_exceptions", "radon/tests/test_cli.py::test_config_str", "radon/tests/test_cli.py::test_config_eq", "radon/tests/test_cli.py::test_config_for", "radon/tests/test_cli.py::test_config_converts_types", "radon/tests/test_cli.py::te... | jyangballin/swesmith.x86_64.rubik_1776_radon.54b88e58 | true | null | 2 | 8 | 3 | 1,563 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287167 | 81.1365 | |||
5,740 | swe_smith::train::37959 | swe_smith | train | 37,959 | kayak__pypika.1c9646f0.func_pm_remove_cond__tqcjjmg3 | swesmith/kayak__pypika.1c9646f0 | kayak/pypika | python | null | Interval expressions broken for weeks and complex date/time units
#### Description
When using `Interval` with weeks or complex date/time expressions (like days + seconds), the SQL generation fails with an `UnboundLocalError`. This affects basic interval operations that were previously working.
#### Steps/Code to Rep... | diff --git a/pypika/terms.py b/pypika/terms.py
index a277e1a..7c4bb3a 100644
--- a/pypika/terms.py
+++ b/pypika/terms.py
@@ -1683,41 +1683,8 @@ class Interval(Node):
expr = getattr(self, "quarters")
unit = "QUARTER"
- elif hasattr(self, "weeks"):
- expr = getattr(self, "wee... | ["pypika/tests/test_date_math.py::AddIntervalTests::test_add_day", "pypika/tests/test_date_math.py::AddIntervalTests::test_add_default", "pypika/tests/test_date_math.py::AddIntervalTests::test_add_minute", "pypika/tests/test_date_math.py::AddIntervalTests::test_add_month", "pypika/tests/test_date_math.py::AddIntervalTe... | ["pypika/tests/clickhouse/test_array.py::TestArray::test_get_sql_0__ridley_scott_jimi_hendrix_", "pypika/tests/clickhouse/test_array.py::TestArray::test_get_sql_1__1_2_3_4_", "pypika/tests/clickhouse/test_array.py::TestArray::test_get_sql_2__toInt64_1_toInt64_2_toInt64_3_toInt64_4_", "pypika/tests/clickhouse/test_array... | jyangballin/swesmith.x86_64.kayak_1776_pypika.1c9646f0 | true | null | 1 | 33 | 33 | 1,063 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287167 | 81.1365 | |||
5,741 | swe_smith::train::9773 | swe_smith | train | 9,773 | marshmallow-code__webargs.dbde72fe.lm_rewrite__wcse135b | swesmith/marshmallow-code__webargs.dbde72fe | marshmallow-code/webargs | python | null | # Request not found in web.View handler methods
## Description
I found a bug in the `AIOHTTPParser.get_request_from_view_args` method. When using `use_args` or `use_kwargs` decorators with a method handler in a web.View class, the request object is not properly extracted.
The current implementation doesn't properly ... | diff --git a/src/webargs/aiohttpparser.py b/src/webargs/aiohttpparser.py
index d266986..c1dd923 100644
--- a/src/webargs/aiohttpparser.py
+++ b/src/webargs/aiohttpparser.py
@@ -130,24 +130,20 @@ class AIOHTTPParser(AsyncParser[web.Request]):
"""Load the request's ``match_info``."""
return req.match_in... | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_use_args_on_method_handler"] | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_querystring_args", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_form", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_missing", "tests/test_aiohttpparser.py::T... | jyangballin/swesmith.x86_64.marshmallow-code_1776_webargs.dbde72fe | true | null | 1 | 22 | 1 | 1,283 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287167 | 81.1365 | |||
5,742 | swe_smith::train::24824 | swe_smith | train | 24,824 | marshmallow-code__marshmallow.9716fc62.func_pm_class_rm_funcs__hs1ll9jr | swesmith/marshmallow-code__marshmallow.9716fc62 | marshmallow-code/marshmallow | python | null | List field deserialization broken - no validation errors raised
#### Description
The List field is not properly deserializing values anymore. When invalid data is passed to a List field, it should raise ValidationError but instead it's not raising any errors at all.
#### Steps/Code to Reproduce
```python
from marsh... | diff --git a/src/marshmallow/fields.py b/src/marshmallow/fields.py
index e83ba19..c870924 100644
--- a/src/marshmallow/fields.py
+++ b/src/marshmallow/fields.py
@@ -781,24 +781,6 @@ class List(Field):
return None
return [self.inner._serialize(each, attr, obj, **kwargs) for each in value]
- de... | ["tests/test_deserialization.py::TestDeserializingNone::test_list_of_nested_non_allow_none_deserialize_none_to_validation_error", "tests/test_deserialization.py::TestFieldDeserialization::test_structured_dict_value_deserialization", "tests/test_deserialization.py::TestFieldDeserialization::test_datetime_list_field_dese... | ["tests/test_decorators.py::test_decorated_processors[True]", "tests/test_decorators.py::test_decorated_processors[False]", "tests/test_decorators.py::test_decorated_processor_returning_none[exclude]", "tests/test_decorators.py::test_decorated_processor_returning_none[include]", "tests/test_decorators.py::test_decorate... | jyangballin/swesmith.x86_64.marshmallow-code_1776_marshmallow.9716fc62 | true | null | 1 | 18 | 19 | 1,363 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287167 | 81.1365 | |||
5,743 | swe_smith::train::24700 | swe_smith | train | 24,700 | marshmallow-code__marshmallow.9716fc62.func_basic__ggmngpld | swesmith/marshmallow-code__marshmallow.9716fc62 | marshmallow-code/marshmallow | python | null | URL validator incorrectly accepts invalid URLs
#### Description
The URL validator is not properly rejecting invalid URLs that should fail validation. URLs with malformed IPv6 addresses, invalid userinfo sections, and relative URLs are being accepted when they should be rejected.
#### Steps/Code to Reproduce
```pyth... | diff --git a/src/marshmallow/validate.py b/src/marshmallow/validate.py
index e4536d8..4509710 100644
--- a/src/marshmallow/validate.py
+++ b/src/marshmallow/validate.py
@@ -110,33 +110,21 @@ class URL(Validator):
self, relative: bool, absolute: bool, require_tld: bool
) -> typing.Pattern:
... | ["tests/test_deserialization.py::TestFieldDeserialization::test_url_field_deserialization", "tests/test_deserialization.py::TestFieldDeserialization::test_relative_url_field_deserialization", "tests/test_deserialization.py::TestSchemaDeserialization::test_multiple_errors_can_be_stored_for_a_url_field", "tests/test_sche... | ["tests/test_decorators.py::test_decorated_processors[True]", "tests/test_decorators.py::test_decorated_processors[False]", "tests/test_decorators.py::test_decorated_processor_returning_none[exclude]", "tests/test_decorators.py::test_decorated_processor_returning_none[include]", "tests/test_decorators.py::test_decorate... | jyangballin/swesmith.x86_64.marshmallow-code_1776_marshmallow.9716fc62 | true | null | 1 | 26 | 48 | 1,202 | 0 | 0.6 | 1 | 0.75 | 1 | 0.287 | 81.136 | |||
5,744 | swe_smith::train::38506 | swe_smith | train | 38,506 | amueller__word_cloud.ec24191c.func_pm_ctrl_shuffle__ou1jw31k | swesmith/amueller__word_cloud.ec24191c | amueller/word_cloud | python | null | CLI argument parsing broken - UnboundLocalError when using command line interface
#### Description
The wordcloud command line interface is completely broken and throws `UnboundLocalError: local variable 'args' referenced before assignment` when trying to use any CLI arguments.
#### Steps/Code to Reproduce
```python... | diff --git a/wordcloud/wordcloud_cli.py b/wordcloud/wordcloud_cli.py
index 4ddd3db..1c888f6 100644
--- a/wordcloud/wordcloud_cli.py
+++ b/wordcloud/wordcloud_cli.py
@@ -220,38 +220,38 @@ def make_parser():
def parse_args(arguments):
+
+ if args['stopwords']:
+ with args.pop('stopwords') as f:
+ ... | ["test/test_wordcloud_cli.py::test_parse_args_are_passed_along[option0]", "test/test_wordcloud_cli.py::test_parse_args_are_passed_along[option1]", "test/test_wordcloud_cli.py::test_parse_args_are_passed_along[option2]", "test/test_wordcloud_cli.py::test_parse_args_are_passed_along[option3]", "test/test_wordcloud_cli.py... | ["test/test_wordcloud.py::test_collocations", "test/test_wordcloud.py::test_collocation_stopwords", "test/test_wordcloud.py::test_collocation_stopwords_uppercase", "test/test_wordcloud.py::test_plurals_numbers", "test/test_wordcloud.py::test_multiple_s", "test/test_wordcloud.py::test_empty_text", "test/test_wordcloud.p... | jyangballin/swesmith.x86_64.amueller_1776_word_cloud.ec24191c | true | null | 1 | 40 | 37 | 921 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286833 | 81.1355 | |||
5,745 | swe_smith::train::131 | swe_smith | train | 131 | oauthlib__oauthlib.1fd52536.combine_file__rbi9xp74 | swesmith/oauthlib__oauthlib.1fd52536 | oauthlib/oauthlib | python | null | OpenID Connect grant types missing proxy methods after __getattr__ removal
#### Description
After recent changes, OpenID Connect grant types are no longer properly proxying method calls to their underlying OAuth2 grant type handlers. This breaks the inheritance chain and causes AttributeError exceptions when trying t... | diff --git a/oauthlib/openid/connect/core/grant_types/base.py b/oauthlib/openid/connect/core/grant_types/base.py
index 29d583e..7c9e4c3 100644
--- a/oauthlib/openid/connect/core/grant_types/base.py
+++ b/oauthlib/openid/connect/core/grant_types/base.py
@@ -13,12 +13,6 @@ log = logging.getLogger(__name__)
class Grant... | ["tests/oauth2/rfc6749/endpoints/test_metadata.py::MetadataEndpointTest::test_openid_oauth2_preconfigured", "tests/openid/connect/core/endpoints/test_claims_handling.py::TestClaimsHandling::test_claims_stored_on_code_creation", "tests/openid/connect/core/endpoints/test_claims_handling.py::TestClaimsHandling::test_inval... | ["tests/oauth1/rfc5849/endpoints/test_access_token.py::AccessTokenEndpointTest::test_check_request_token", "tests/oauth1/rfc5849/endpoints/test_access_token.py::AccessTokenEndpointTest::test_check_verifier", "tests/oauth1/rfc5849/endpoints/test_access_token.py::AccessTokenEndpointTest::test_valid_request", "tests/oauth... | jyangballin/swesmith.x86_64.oauthlib_1776_oauthlib.1fd52536 | true | null | 1 | 23 | 169 | 1,260 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286667 | 81.135 | |||
5,746 | swe_smith::train::4775 | swe_smith | train | 4,775 | bottlepy__bottle.a8dfef30.func_basic__epniobzc | swesmith/bottlepy__bottle.a8dfef30 | bottlepy/bottle | python | null | Multipart header parsing broken with colon-separated headers
#### Description
When parsing multipart form data, headers containing colons are being incorrectly parsed, causing multipart uploads to fail. The parser seems to be looking for commas instead of colons in header lines and is also swapping header name/value ... | diff --git a/bottle.py b/bottle.py
index 286b5bc..74c136c 100755
--- a/bottle.py
+++ b/bottle.py
@@ -3350,21 +3350,21 @@ class _MultipartPart(object):
def write_header(self, line, nl):
line = line.decode(self.charset)
- if not nl:
- raise MultipartError("Unexpected end of line in heade... | ["test/test_environ.py::TestRequest::test_multipart", "test/test_multipart.py::TestMultipartParser::test_big_file", "test/test_multipart.py::TestMultipartParser::test_file_seek", "test/test_multipart.py::TestMultipartParser::test_multiline_header", "test/test_multipart.py::TestMultipartParser::test_unicode_value", "tes... | ["test/test_app.py::TestApplicationObject::test_setattr", "test/test_auth.py::TestBasicAuth::test__header", "test/test_config.py::TestConfDict::test_gc_overlays", "test/test_config.py::TestConfDict::test_isadict", "test/test_config.py::TestConfDict::test_load_dict", "test/test_config.py::TestConfDict::test_load_module"... | jyangballin/swesmith.x86_64.bottlepy_1776_bottle.a8dfef30 | true | null | 1 | 14 | 9 | 1,439 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2865 | 81.1345 | |||
5,747 | swe_smith::train::24506 | swe_smith | train | 24,506 | sunpy__sunpy.f8edfd5c.combine_module__hjo744sb | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | # UnboundLocalError in resample function when using any resampling method
### Describe the bug
When trying to use the `resample` function from `sunpy.image.resample`, I get an `UnboundLocalError` saying that the variable `offset` cannot be accessed where it is not associated with a value. This happens with all resamp... | diff --git a/sunpy/image/resample.py b/sunpy/image/resample.py
index c7b72f5..82e7d5e 100644
--- a/sunpy/image/resample.py
+++ b/sunpy/image/resample.py
@@ -50,18 +50,8 @@ def resample(orig, dimensions, method='linear', center=False, minusone=False):
https://scipy-cookbook.readthedocs.io/items/Rebinning.html
... | ["sunpy/image/tests/test_resample.py::test_resample_nearest", "sunpy/image/tests/test_resample.py::test_resample_linear", "sunpy/image/tests/test_resample.py::test_resample_spline", "sunpy/image/tests/test_transform.py::test_endian[0-opencv]", "sunpy/image/tests/test_transform.py::test_endian[1-opencv]", "sunpy/image/t... | ["sunpy/image/tests/test_resample.py::test_reshape", "sunpy/image/tests/test_transform.py::test_rotation[90.0-1]", "sunpy/image/tests/test_transform.py::test_rotation[-90.0--1]", "sunpy/image/tests/test_transform.py::test_rotation[-270.0-1]", "sunpy/image/tests/test_transform.py::test_rotation[-90.0-3]", "sunpy/image/t... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 2 | 24 | 6 | 1,239 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2865 | 81.1345 | |||
5,748 | swe_smith::train::24313 | swe_smith | train | 24,313 | sunpy__sunpy.f8edfd5c.func_pm_remove_cond__ceqt2dmh | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | solar_wcs_frame_mapping returns None instead of coordinate frame
#### Description
The `solar_wcs_frame_mapping` function is returning `None` instead of the expected coordinate frame object when processing WCS headers.
#### Steps/Code to Reproduce
```python
import sunpy
import numpy as np
from astropy.wcs import WCS... | diff --git a/sunpy/coordinates/wcs_utils.py b/sunpy/coordinates/wcs_utils.py
index 72706d7..25d3abc 100644
--- a/sunpy/coordinates/wcs_utils.py
+++ b/sunpy/coordinates/wcs_utils.py
@@ -61,18 +61,6 @@ def solar_wcs_frame_mapping(wcs):
observer = None
for frame, attr_names in required_attrs.items():
at... | ["sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping[ctype0-Helioprojective]", "sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping[ctype1-Helioprojective]", "sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping[ctype2-HeliographicStonyhurst]", "sunpy/coordinates/tests/test_wcs... | ["sunpy/coordinates/tests/test_wcs_utils.py::test_wcs_frame_mapping_none", "sunpy/coordinates/tests/test_wcs_utils.py::test_non_sunpy_frame_to_wcs", "sunpy/coordinates/tests/test_wcs_utils.py::test_attribute_errors", "sunpy/coordinates/tests/test_wcs_utils.py::test_set_wcs_aux", "sunpy/coordinates/tests/test_wcs_utils.... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 23 | 13 | 1,258 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286333 | 81.134 | |||
5,749 | swe_smith::train::47242 | swe_smith | train | 47,242 | python-trio__trio.cfbbe2c1.lm_rewrite__2owrhioy | swesmith/python-trio__trio.cfbbe2c1 | python-trio/trio | python | null | SSLStream attribute access before handshake
Description:
It seems there's an issue with accessing certain SSLStream attributes before the handshake is completed. When trying to access attributes like `selected_alpn_protocol`, `selected_npn_protocol`, or `get_channel_binding` before the handshake, it should raise a `N... | diff --git a/src/trio/_ssl.py b/src/trio/_ssl.py
index 0a0419f..eb9c586 100644
--- a/src/trio/_ssl.py
+++ b/src/trio/_ssl.py
@@ -424,18 +424,15 @@ class SSLStream(Stream, Generic[T_Stream]):
}
# Explicit "Any" is not allowed
- def __getattr__( # type: ignore[misc]
- self,
- name: str,
- ... | ["src/trio/_tests/test_ssl.py::test_selected_alpn_protocol_before_handshake[tls13]", "src/trio/_tests/test_ssl.py::test_selected_npn_protocol_before_handshake[tls13]", "src/trio/_tests/test_ssl.py::test_get_channel_binding_before_handshake[tls13]", "src/trio/_tests/test_ssl.py::test_selected_alpn_protocol_before_handsh... | ["src/trio/_core/_tests/test_asyncgen.py::test_asyncgen_basics", "src/trio/_core/_tests/test_asyncgen.py::test_asyncgen_throws_during_finalization", "src/trio/_core/_tests/test_asyncgen.py::test_firstiter_after_closing", "src/trio/_core/_tests/test_asyncgen.py::test_interdependent_asyncgen_cleanup_order", "src/trio/_co... | jyangballin/swesmith.x86_64.python-trio_1776_trio.cfbbe2c1 | true | null | 1 | 19 | 6 | 1,338 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286333 | 81.134 | |||
5,750 | swe_smith::train::38858 | swe_smith | train | 38,858 | pallets__jinja.ada0a9a6.func_basic__52xli2g6 | swesmith/pallets__jinja.ada0a9a6 | pallets/jinja | python | null | #### Description
The `npgettext` function in Jinja2's i18n extension is not working correctly when using context-aware plural translations. The function appears to be mixing up parameters and producing unexpected results.
#### Steps/Code to Reproduce
```python
from jinja2 import Environment, DictLoader
# Set up env... | diff --git a/src/jinja2/ext.py b/src/jinja2/ext.py
index 9fad0aa..ca52de0 100644
--- a/src/jinja2/ext.py
+++ b/src/jinja2/ext.py
@@ -230,15 +230,14 @@ def _make_new_npgettext(
__num: int,
**variables: t.Any,
) -> str:
- variables.setdefault("context", __string_ctx)
- variables.setde... | ["tests/test_ext.py::TestNewstyleInternationalization::test_context_plural", "tests/test_ext.py::TestNewstyleInternationalization::test_context_plural_block"] | ["tests/test_api.py::TestExtendedAPI::test_item_and_attribute", "tests/test_api.py::TestExtendedAPI::test_finalize", "tests/test_api.py::TestExtendedAPI::test_finalize_constant_expression", "tests/test_api.py::TestExtendedAPI::test_no_finalize_template_data", "tests/test_api.py::TestExtendedAPI::test_context_finalize",... | jyangballin/swesmith.x86_64.pallets_1776_jinja.ada0a9a6 | true | null | 1 | 11 | 2 | 1,497 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286167 | 81.1335 | |||
5,751 | swe_smith::train::25113 | swe_smith | train | 25,113 | pylint-dev__astroid.b114f6b5.combine_file__v0bdyeot | swesmith/pylint-dev__astroid.b114f6b5 | pylint-dev/astroid | python | null | Dunder method lookup returns empty list instead of raising AttributeInferenceError
#### Description
When looking up dunder methods on certain node types, the lookup function incorrectly returns an empty list instead of raising an AttributeInferenceError when the attribute is not found. This affects binary operations,... | diff --git a/astroid/interpreter/dunder_lookup.py b/astroid/interpreter/dunder_lookup.py
index 727c1ad..282b3dd 100644
--- a/astroid/interpreter/dunder_lookup.py
+++ b/astroid/interpreter/dunder_lookup.py
@@ -29,10 +29,10 @@ def _lookup_in_mro(node, name) -> list:
attrs = node.locals.get(name, [])
nodes = i... | ["tests/brain/test_brain.py::CollectionsBrain::test_collections_object_not_subscriptable", "tests/brain/test_brain.py::CollectionsBrain::test_collections_object_subscriptable", "tests/brain/test_brain.py::CollectionsBrain::test_collections_object_subscriptable_2", "tests/brain/test_brain.py::CollectionsBrain::test_coll... | ["tests/brain/numpy/test_core_einsumfunc.py::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_einsumfunc.py::test_function_parameters", "tests/brain/numpy/test_core_fromnumeric.py::BrainNumpyCoreFromNumericTest::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_fun... | jyangballin/swesmith.x86_64.pylint-dev_1776_astroid.b114f6b5 | true | null | 1 | 10 | 62 | 1,517 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286167 | 81.1335 | |||
5,752 | swe_smith::train::7129 | swe_smith | train | 7,129 | cantools__cantools.0c6a7871.combine_module__57e0a55q | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | CDD file parsing fails with AttributeError when loading diagnostics database
#### Description
When loading CDD files for diagnostics database, the parser fails with `AttributeError: 'NoneType' object has no attribute 'find'`. This affects both big-endian and little-endian CDD files.
#### Steps/Code to Reproduce
```... | diff --git a/src/cantools/database/diagnostics/data.py b/src/cantools/database/diagnostics/data.py
index 3c97eec..5c4f19d 100644
--- a/src/cantools/database/diagnostics/data.py
+++ b/src/cantools/database/diagnostics/data.py
@@ -99,7 +99,7 @@ class Data:
@property
def offset(self) -> Union[int, float]:
... | ["tests/test_diagnostics_database.py::CanToolsDiagnosticsDatabaseTest::test_be_cdd_add", "tests/test_diagnostics_database.py::CanToolsDiagnosticsDatabaseTest::test_be_example_cdd", "tests/test_diagnostics_database.py::CanToolsDiagnosticsDatabaseTest::test_be_example_cdd_repr", "tests/test_diagnostics_database.py::CanTo... | ["tests/test_autosar.py::CanToolsAutosarTest::test_autosar3_e2e_profile2", "tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_e2e", "tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_e2e_profile5", "tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_secoc", "tests/test_command_line.py::CanToolsCo... | jyangballin/swesmith.x86_64.cantools_1776_cantools.0c6a7871 | true | null | 2 | 26 | 8 | 1,197 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286167 | 81.1335 | |||
5,753 | swe_smith::train::39933 | swe_smith | train | 39,933 | tornadoweb__tornado.d5ac65c1.lm_rewrite__8h8qbjm7 | swesmith/tornadoweb__tornado.d5ac65c1 | tornadoweb/tornado | python | null | SSLIOStream read_from_fd TypeError with memoryview
**Describe the bug**
When attempting to read from an SSLIOStream using a memoryview, a `TypeError` is raised. The error message indicates that the `read()` method requires a read-write bytes-like object, but a bytes object is being provided instead.
**To Reproduce**
... | diff --git a/tornado/iostream.py b/tornado/iostream.py
index dd2111e..4227d3f 100644
--- a/tornado/iostream.py
+++ b/tornado/iostream.py
@@ -1527,19 +1527,21 @@ class SSLIOStream(IOStream):
del data
def read_from_fd(self, buf: Union[bytearray, memoryview]) -> Optional[int]:
+ """Attempts to r... | ["test_many_mixed_reads (tornado.test.iostream_test.TestIOStreamSSL)", "test_read_into (tornado.test.iostream_test.TestIOStreamSSL)", "test_read_into_partial (tornado.test.iostream_test.TestIOStreamSSL)", "test_many_mixed_reads (tornado.test.iostream_test.TestIOStreamSSLContext)", "test_read_into (tornado.test.iostream... | ["Doctest: tornado.httputil.HTTPHeaders", "Doctest: tornado.httputil.HTTPHeaders.parse", "Doctest: tornado.httputil.HTTPHeaders.parse_line", "Doctest: tornado.httputil._encode_header", "Doctest: tornado.httputil._get_content_range", "Doctest: tornado.httputil._normalize_header", "Doctest: tornado.httputil._parse_header... | jyangballin/swesmith.x86_64.tornadoweb_1776_tornado.d5ac65c1 | true | null | 1 | 26 | 6 | 1,197 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286167 | 81.1335 | |||
5,754 | swe_smith::train::22954 | swe_smith | train | 22,954 | graphql-python__graphene.82903263.func_pm_ctrl_shuffle__pjb07psj | swesmith/graphql-python__graphene.82903263 | graphql-python/graphene | python | null | Node.get_node_from_global_id fails with NameError when graphene_type is None
#### Description
When calling `Node.get_node_from_global_id` with a global ID that references a type not found in the schema, the method raises a `NameError: name 'graphene_type' is not defined` instead of the expected exception about the ty... | diff --git a/graphene/relay/node.py b/graphene/relay/node.py
index 5443828..d41bd0a 100644
--- a/graphene/relay/node.py
+++ b/graphene/relay/node.py
@@ -109,27 +109,26 @@ class Node(AbstractNode):
def get_node_from_global_id(cls, info, global_id, only_type=None):
_type, _id = cls.resolve_global_id(info, g... | ["examples/starwars_relay/tests/test_objectidentification.py::test_correctly_refetches_rebels", "examples/starwars_relay/tests/test_objectidentification.py::test_correctly_refetches_empire", "examples/starwars_relay/tests/test_objectidentification.py::test_correctly_refetches_xwing", "graphene/relay/tests/test_custom_g... | ["examples/starwars/tests/test_query.py::test_hero_name_query", "examples/starwars/tests/test_query.py::test_hero_name_and_friends_query", "examples/starwars/tests/test_query.py::test_nested_query", "examples/starwars/tests/test_query.py::test_fetch_luke_query", "examples/starwars/tests/test_query.py::test_fetch_some_i... | jyangballin/swesmith.x86_64.graphql-python_1776_graphene.82903263 | true | null | 1 | 21 | 15 | 1,297 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286167 | 81.1335 | |||
5,755 | swe_smith::train::1670 | swe_smith | train | 1,670 | agronholm__typeguard.b6a7e438.combine_file__l6xpw0sc | swesmith/agronholm__typeguard.b6a7e438 | agronholm/typeguard | python | null | Type checking fails silently when typecheck_fail_callback is None
#### Description
When `typecheck_fail_callback` is set to `None` in the configuration, type checking errors are being silently ignored instead of raising exceptions. This breaks the expected behavior where type violations should raise `TypeCheckError` ... | diff --git a/src/typeguard/_functions.py b/src/typeguard/_functions.py
index ca21c14..9088945 100644
--- a/src/typeguard/_functions.py
+++ b/src/typeguard/_functions.py
@@ -128,20 +128,20 @@ def check_argument_types(
exc = TypeCheckError(
f"{func_name}() was declared never to be called but... | ["tests/test_importhook.py::test_blanket_import", "tests/test_instrumentation.py::test_type_checked_func_error[typechecked]", "tests/test_instrumentation.py::test_type_checked_method[typechecked]", "tests/test_instrumentation.py::test_type_checked_classmethod[typechecked]", "tests/test_instrumentation.py::test_type_che... | ["tests/mypy/test_type_annotations.py::test_positive", "tests/mypy/test_type_annotations.py::test_negative", "tests/test_checkers.py::TestAnyStr::test_valid[str]", "tests/test_checkers.py::TestAnyStr::test_valid[bytes]", "tests/test_checkers.py::TestAnyStr::test_bad_type", "tests/test_checkers.py::TestBytesLike::test_v... | jyangballin/swesmith.x86_64.agronholm_1776_typeguard.b6a7e438 | true | null | 1 | 20 | 50 | 1,316 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286 | 81.133 | |||
5,756 | swe_smith::train::52609 | swe_smith | train | 52,609 | pydicom__pydicom.7d361b3d.func_pm_remove_cond__u7k3vnt4 | swesmith/pydicom__pydicom.7d361b3d | pydicom/pydicom | python | null | Missing validation for Bits Allocated and Planar Configuration in RunnerBase
#### Description
The `RunnerBase._validate_options()` method is not properly validating required DICOM elements. When creating a runner without setting `bits_allocated`, no error is raised even though this is a required element. Similarly, i... | diff --git a/src/pydicom/pixels/common.py b/src/pydicom/pixels/common.py
index 10a4a93..f3c37ae 100644
--- a/src/pydicom/pixels/common.py
+++ b/src/pydicom/pixels/common.py
@@ -571,16 +571,6 @@ class RunnerBase:
def _validate_options(self) -> None:
"""Validate the supplied options to ensure they meet requ... | ["tests/pixels/test_common.py::TestRunnerBase::test_validate_options"] | ["tests/pixels/test_common.py::TestRunnerBase::test_init", "tests/pixels/test_common.py::TestRunnerBase::test_del_option", "tests/pixels/test_common.py::TestRunnerBase::test_option_properties", "tests/pixels/test_common.py::TestRunnerBase::test_planar_configuration", "tests/pixels/test_common.py::TestRunnerBase::test_s... | jyangballin/swesmith.x86_64.pydicom_1776_pydicom.7d361b3d | true | null | 1 | 17 | 1 | 1,376 | 0 | 0.6 | 1 | 0.75 | 1 | 0.286 | 81.133 | |||
5,757 | swe_smith::train::43730 | swe_smith | train | 43,730 | sloria__environs.73c372df.lm_rewrite__hqy2wjw8 | swesmith/sloria__environs.73c372df | sloria/environs | python | null | JSON parsing fails with non-string/non-mapping values
When using the json parser, it fails to properly validate and handle certain types of input values. The parser now accepts any value type without proper validation, which can lead to unexpected behavior.
Good:
```python
# This should raise a validation error
env.j... | diff --git a/src/environs/__init__.py b/src/environs/__init__.py
index 00f6072..c3a4d14 100644
--- a/src/environs/__init__.py
+++ b/src/environs/__init__.py
@@ -291,16 +291,14 @@ def _preprocess_dict(
def _preprocess_json(value: str | typing.Mapping | list, **kwargs):
- try:
- if isinstance(value, str):
... | ["tests/test_environs.py::TestCasting::test_invalid_json_raises_error", "tests/test_environs.py::TestCasting::test_json_default"] | ["tests/test_environs.py::TestCasting::test_call", "tests/test_environs.py::TestCasting::test_call_with_default", "tests/test_environs.py::TestCasting::test_basic", "tests/test_environs.py::TestCasting::test_empty_str", "tests/test_environs.py::TestCasting::test_int_cast", "tests/test_environs.py::TestCasting::test_inv... | jyangballin/swesmith.x86_64.sloria_1776_environs.73c372df | true | null | 1 | 18 | 2 | 1,355 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285833 | 81.1325 | |||
5,758 | swe_smith::train::51723 | swe_smith | train | 51,723 | pydicom__pydicom.7d361b3d.func_basic__2wwozktl | swesmith/pydicom__pydicom.7d361b3d | pydicom/pydicom | python | null | Dataset.setdefault() returns existing values instead of defaults when tag exists
#### Description
The `setdefault()` method on Dataset objects is behaving incorrectly - it's returning existing values when a tag is already present in the dataset, but it should only return the existing value when the tag exists and ret... | diff --git a/src/pydicom/dataset.py b/src/pydicom/dataset.py
index e7abffd..bd6da4c 100644
--- a/src/pydicom/dataset.py
+++ b/src/pydicom/dataset.py
@@ -1640,18 +1640,18 @@ class Dataset:
``RAISE`` and `key` is an unknown non-private tag.
"""
tag = Tag(key)
- if tag in self:
- ... | ["tests/test_dataset.py::TestDataset::test_setdefault", "tests/test_dataset.py::TestDataset::test_setdefault_unknown_tag", "tests/test_dataset.py::TestDataset::test_setdefault_tuple", "tests/test_dataset.py::TestDataset::test_setdefault_unknown_tuple", "tests/test_dataset.py::TestDataset::test_setdefault_use_value", "t... | ["tests/pixels/test_common.py::TestRunnerBase::test_init", "tests/pixels/test_common.py::TestRunnerBase::test_del_option", "tests/pixels/test_common.py::TestRunnerBase::test_option_properties", "tests/pixels/test_common.py::TestRunnerBase::test_planar_configuration", "tests/pixels/test_common.py::TestRunnerBase::test_s... | jyangballin/swesmith.x86_64.pydicom_1776_pydicom.7d361b3d | true | null | 1 | 10 | 7 | 1,515 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285833 | 81.1325 | |||
5,759 | swe_smith::train::2959 | swe_smith | train | 2,959 | madzak__python-json-logger.5f85723f.pr_160 | swesmith/madzak__python-json-logger.5f85723f | madzak/python-json-logger | python | null | **Issue Text**
Field renaming in JsonFormatter doesn't work for non-existent fields
**Describe the bug**
After updating to the latest version, field renaming in JsonFormatter doesn't work correctly when trying to rename fields that don't exist in the log record. Also, when renaming fields like 'exc_info', both the ori... | diff --git a/src/pythonjsonlogger/jsonlogger.py b/src/pythonjsonlogger/jsonlogger.py
index 519a64d..f7d98d2 100644
--- a/src/pythonjsonlogger/jsonlogger.py
+++ b/src/pythonjsonlogger/jsonlogger.py
@@ -210,7 +210,10 @@ class JsonFormatter(logging.Formatter):
Override this method to implement custom logic for ad... | ["tests/test_jsonlogger.py::TestJsonLogger::test_exc_info_renamed", "tests/test_jsonlogger.py::TestJsonLogger::test_rename_nonexistent_field"] | ["tests/test_jsonlogger.py::TestJsonLogger::test_add_static_fields", "tests/test_jsonlogger.py::TestJsonLogger::test_custom_object_serialization", "tests/test_jsonlogger.py::TestJsonLogger::test_default_format", "tests/test_jsonlogger.py::TestJsonLogger::test_ensure_ascii_false", "tests/test_jsonlogger.py::TestJsonLogg... | jyangballin/swesmith.x86_64.madzak_1776_python-json-logger.5f85723f | true | null | 1 | 14 | 2 | 1,435 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285833 | 81.1325 | |||
5,760 | swe_smith::train::43942 | swe_smith | train | 43,942 | pydata__patsy.a5d16484.func_basic__8ektr78e | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | LookupFactor validation logic inverted for force_categorical parameter
#### Description
When creating a LookupFactor with `force_categorical=True` and providing `contrast` or `levels` parameters, the validation incorrectly raises ValueError claiming these parameters require `force_categorical=True`, even when it's al... | diff --git a/patsy/user_util.py b/patsy/user_util.py
index 080af84..262eda2 100644
--- a/patsy/user_util.py
+++ b/patsy/user_util.py
@@ -201,14 +201,14 @@ class LookupFactor(object):
self, varname, force_categorical=False, contrast=None, levels=None, origin=None
):
self._varname = varname
- ... | ["patsy/test_build.py::test_simple", "patsy/test_build.py::test_R_bugs", "patsy/test_build.py::test_redundancy_thoroughly", "patsy/test_build.py::test_data_types", "patsy/test_build.py::test_NA_action", "patsy/test_build.py::test_NA_drop_preserves_levels", "patsy/test_build.py::test_data_mismatch", "patsy/test_build.py... | ["patsy/build.py::test__max_allowed_dim", "patsy/build.py::test__eval_factor_numerical", "patsy/build.py::test__eval_factor_categorical", "patsy/build.py::test__column_combinations", "patsy/build.py::test__subterm_column_names_iter_and__build_subterm", "patsy/build.py::test__factors_memorize", "patsy/build.py::test__ex... | jyangballin/swesmith.x86_64.pydata_1776_patsy.a5d16484 | true | null | 1 | 6 | 12 | 1,595 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285833 | 81.1325 | |||
5,761 | swe_smith::train::29584 | swe_smith | train | 29,584 | django__channels.a144b4b8.func_basic__gsd400kd | swesmith/django__channels.a144b4b8 | django/channels | python | null | SessionMiddleware fails when session not already in scope
#### Description
The SessionMiddleware is not working correctly when there's no existing session middleware above it. The middleware fails to initialize sessions properly, causing KeyError exceptions when trying to access session data.
#### Steps/Code to Repr... | diff --git a/channels/sessions.py b/channels/sessions.py
index f1d51d4..8e7f02c 100644
--- a/channels/sessions.py
+++ b/channels/sessions.py
@@ -144,23 +144,19 @@ class InstanceSessionWrapper:
self.scope = dict(scope)
- if "session" in self.scope:
- # There's already session middleware of... | ["tests/test_generic_websocket.py::test_multiple_websocket_consumers_with_sessions", "tests/test_http.py::test_sessions", "tests/test_http.py::test_session_samesite[Strict]", "tests/test_http.py::test_session_samesite[None]", "tests/test_http.py::test_session_samesite_invalid", "tests/test_http.py::test_multiple_sessio... | ["tests/test_database.py::ConnectionClosingTests::test_http", "tests/test_database.py::ConnectionClosingTests::test_websocket", "tests/test_generic_websocket.py::test_websocket_consumer", "tests/test_generic_websocket.py::test_websocket_consumer_subprotocol", "tests/test_generic_websocket.py::test_websocket_consumer_gr... | jyangballin/swesmith.x86_64.django_1776_channels.a144b4b8 | true | null | 1 | 16 | 8 | 1,395 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285833 | 81.1325 | |||
5,762 | swe_smith::train::1589 | swe_smith | train | 1,589 | Cog-Creators__Red-DiscordBot.33e0eac7.func_pm_ctrl_shuffle__59wyc3lv | swesmith/Cog-Creators__Red-DiscordBot.33e0eac7 | cog-creators/red-discordbot | python | null | #### Description
Function crashes with `TypeError: 'UseDefault' object is not iterable` when processing Python version information in JSON files.
#### Steps/Code to Reproduce
```python
from pathlib import Path
from redbot.cogs.downloader.info_schemas import ensure_python_version_info, USE_DEFAULT
# This should work... | diff --git a/redbot/cogs/downloader/info_schemas.py b/redbot/cogs/downloader/info_schemas.py
index 8033d13..c7144e6 100644
--- a/redbot/cogs/downloader/info_schemas.py
+++ b/redbot/cogs/downloader/info_schemas.py
@@ -98,40 +98,39 @@ def ensure_red_version_info(
def ensure_python_version_info(
info_file: Path, key... | ["tests/cogs/downloader/test_downloader.py::test_update_available_modules"] | ["tests/cogs/test_alias.py::test_is_valid_alias_name", "tests/cogs/test_alias.py::test_empty_guild_aliases", "tests/cogs/test_alias.py::test_empty_global_aliases", "tests/cogs/test_alias.py::test_add_guild_alias", "tests/cogs/test_alias.py::test_translate_alias_message", "tests/cogs/test_alias.py::test_delete_guild_ali... | jyangballin/swesmith.x86_64.cog-creators_1776_red-discordbot.33e0eac7 | true | null | 1 | 43 | 1 | 854 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285667 | 81.132 | |||
5,763 | swe_smith::train::49125 | swe_smith | train | 49,125 | mozilla__bleach.73871d76.combine_file__i15cz4co | swesmith/mozilla__bleach.73871d76 | mozilla/bleach | python | null | HTML tree builder initialization broken after recent changes
#### Description
The HTML tree builder is not working correctly - it seems like the initialization is messed up. When trying to parse HTML content, I'm getting AttributeError exceptions about NoneType objects not having expected methods.
#### Steps/Code to... | diff --git a/bleach/_vendor/html5lib/treebuilders/base.py b/bleach/_vendor/html5lib/treebuilders/base.py
index 2869da0..cae0e0f 100644
--- a/bleach/_vendor/html5lib/treebuilders/base.py
+++ b/bleach/_vendor/html5lib/treebuilders/base.py
@@ -185,13 +185,13 @@ class TreeBuilder(object):
self.openElements = []
... | ["tests/test_clean.py::test_clean_idempotent[text<em>]", "tests/test_clean.py::test_clean_idempotent_img", "tests/test_clean.py::test_only_text_is_cleaned", "tests/test_clean.py::test_content_has_no_html", "tests/test_clean.py::test_html_is_lowercased", "tests/test_clean.py::test_comments[<!--comment-->text-True-text]"... | ["tests/test_callbacks.py::TestNofollowCallback::test_blank", "tests/test_callbacks.py::TestNofollowCallback::test_no_href", "tests/test_callbacks.py::TestNofollowCallback::test_basic", "tests/test_callbacks.py::TestNofollowCallback::test_mailto", "tests/test_callbacks.py::TestNofollowCallback::test_has_nofollow_alread... | jyangballin/swesmith.x86_64.mozilla_1776_bleach.73871d76 | true | null | 1 | 26 | 183 | 1,194 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285667 | 81.132 | |||
5,764 | swe_smith::train::46047 | swe_smith | train | 46,047 | conan-io__conan.86f29e13.pr_12780 | swesmith/conan-io__conan.86f29e13 | conan-io/conan | python | null | ### Issue with `ConanOutput` Method Chaining
#### Description
It seems that the recent changes to the `ConanOutput` class have affected the method chaining functionality. Previously, methods like `trace`, `debug`, `verbose`, and others returned `self`, allowing for chaining multiple calls together. However, after the... | diff --git a/conan/api/output.py b/conan/api/output.py
index 6989abc..3dd0710 100644
--- a/conan/api/output.py
+++ b/conan/api/output.py
@@ -158,23 +158,19 @@ class ConanOutput:
return hasattr(self.stream, "isatty") and self.stream.isatty()
def writeln(self, data, fg=None, bg=None):
- return self... | ["test/integration/py_requires/python_requires_test.py::PyRequiresExtendTest::test_build_id", "test/integration/py_requires/python_requires_test.py::PyRequiresExtendTest::test_failure_init_method", "test/integration/py_requires/python_requires_test.py::PyRequiresExtendTest::test_local_import", "test/integration/py_requ... | ["test/integration/py_requires/python_requires_test.py::PyRequiresExtendTest::test_duplicate_pyreq", "test/integration/py_requires/python_requires_test.py::PyRequiresExtendTest::test_local_build", "test/integration/py_requires/python_requires_test.py::PyRequiresExtendTest::test_options_default_update", "test/integratio... | jyangballin/swesmith.x86_64.conan-io_1776_conan.86f29e13 | true | null | 1 | 22 | 23 | 1,273 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2855 | 81.1315 | |||
5,765 | swe_smith::train::6594 | swe_smith | train | 6,594 | joke2k__faker.8b401a7d.combine_module__q3vkn0kx | swesmith/joke2k__faker.8b401a7d | joke2k/faker | python | null | # Finnish and Hungarian SSN generation is broken
### Current problem
When trying to generate Finnish or Hungarian SSNs (social security numbers), the code fails with errors.
### Reproduction
For Finnish SSN:
```python
from faker import Faker
fake = Faker('fi_FI')
print(fake.ssn()) # Raises UnboundLocalError: loca... | diff --git a/faker/providers/ssn/fi_FI/__init__.py b/faker/providers/ssn/fi_FI/__init__.py
index 016782c..a87df6c 100644
--- a/faker/providers/ssn/fi_FI/__init__.py
+++ b/faker/providers/ssn/fi_FI/__init__.py
@@ -5,6 +5,15 @@ from .. import Provider as SsnProvider
class Provider(SsnProvider):
def ssn(self, min_... | ["tests/providers/test_ssn.py::TestFiFI::test_artifical_ssn", "tests/providers/test_ssn.py::TestFiFI::test_ssn_sanity", "tests/providers/test_ssn.py::TestFiFI::test_ssn_without_age_range", "tests/providers/test_ssn.py::TestFiFI::test_valid_ssn", "tests/providers/test_ssn.py::TestHuHU::test_ssn"] | ["tests/providers/__init__.py::TestBaseProvider::test_locale", "tests/providers/__init__.py::TestBaseProvider::test_language_code", "tests/providers/__init__.py::TestBaseProvider::test_random_digit", "tests/providers/__init__.py::TestBaseProvider::test_random_digit_not_null", "tests/providers/__init__.py::TestBaseProvi... | jyangballin/swesmith.x86_64.joke2k_1776_faker.8b401a7d | true | null | 2 | 36 | 5 | 993 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2855 | 81.1315 | |||
5,766 | swe_smith::train::26679 | swe_smith | train | 26,679 | pylint-dev__astroid.b114f6b5.pr_2268 | swesmith/pylint-dev__astroid.b114f6b5 | pylint-dev/astroid | python | null | # PartialFunction.as_string() fails with AttributeError
## Description
I'm having an issue with the `as_string()` method for `PartialFunction` objects. When trying to convert a partial function to a string representation, I get an error because the `visit_partialfunction` method seems to be missing.
## Reproducer
T... | diff --git a/astroid/nodes/as_string.py b/astroid/nodes/as_string.py
index d063350..1c8f109 100644
--- a/astroid/nodes/as_string.py
+++ b/astroid/nodes/as_string.py
@@ -13,7 +13,6 @@ from typing import TYPE_CHECKING
from astroid import nodes
if TYPE_CHECKING:
- from astroid import objects
from astroid.nodes... | ["tests/brain/test_brain.py::TestFunctoolsPartial::test_infer_partial"] | ["tests/brain/numpy/test_core_einsumfunc.py::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_einsumfunc.py::test_function_parameters", "tests/brain/numpy/test_core_fromnumeric.py::BrainNumpyCoreFromNumericTest::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_fun... | jyangballin/swesmith.x86_64.pylint-dev_1776_astroid.b114f6b5 | true | null | 2 | 18 | 1 | 1,352 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285333 | 81.131 | |||
5,767 | swe_smith::train::36727 | swe_smith | train | 36,727 | lincolnloop__python-qrcode.456b01d4.lm_rewrite__tnxc8rrm | swesmith/lincolnloop__python-qrcode.456b01d4 | lincolnloop/python-qrcode | python | null | # QR code version validation raises TypeError instead of ValueError
## Description
I noticed that when trying to create a QR code with an invalid version number, the library now raises a TypeError instead of a ValueError. This is a breaking change that affects my code.
In my application, I have error handling that s... | diff --git a/qrcode/util.py b/qrcode/util.py
index 02fe11d..afe9fda 100644
--- a/qrcode/util.py
+++ b/qrcode/util.py
@@ -181,9 +181,16 @@ def length_in_bits(mode, version):
def check_version(version):
- if version < 1 or version > 40:
- raise ValueError(f"Invalid version (was {version}, expected 1 to 40)... | ["qrcode/tests/test_qrcode.py::test_invalid_version", "qrcode/tests/test_util.py::test_check_wrong_version"] | ["qrcode/tests/test_example.py::test_example", "qrcode/tests/test_qrcode.py::test_basic", "qrcode/tests/test_qrcode.py::test_large", "qrcode/tests/test_qrcode.py::test_invalid_border", "qrcode/tests/test_qrcode.py::test_overflow", "qrcode/tests/test_qrcode.py::test_add_qrdata", "qrcode/tests/test_qrcode.py::test_fit", ... | jyangballin/swesmith.x86_64.lincolnloop_1776_python-qrcode.456b01d4 | true | null | 1 | 13 | 2 | 1,452 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285333 | 81.131 | |||
5,768 | swe_smith::train::33070 | swe_smith | train | 33,070 | django-money__django-money.835c1ab8.combine_file__sv6co3mq | swesmith/django-money__django-money.835c1ab8 | django-money/django-money | python | null | Money operations broken after recent changes
#### Description
Several Money operations are not working correctly. Basic arithmetic operations like multiplication, addition, and methods like `round()` and `abs()` are producing unexpected results or errors.
#### Steps/Code to Reproduce
```python
from djmoney.money im... | diff --git a/djmoney/money.py b/djmoney/money.py
index 51c436b..79a2ef8 100644
--- a/djmoney/money.py
+++ b/djmoney/money.py
@@ -66,10 +66,10 @@ class Money(DefaultMoney):
return result
def __mul__(self, other):
- if isinstance(other, F):
+ if not isinstance(other, F):
return ... | ["tests/test_models.py::TestDifferentCurrencies::test_add_default", "tests/test_models.py::TestDifferentCurrencies::test_sub_default", "tests/test_money.py::test_default_mul", "tests/test_money.py::test_add_decimal_places", "tests/test_money.py::test_add_decimal_places_zero", "tests/test_money.py::test_keep_decimal_pla... | ["tests/contrib/exchange/test_admin.py::test_last_update", "tests/contrib/exchange/test_backends.py::TestBackends::test_get_rates[setup0]", "tests/contrib/exchange/test_backends.py::TestBackends::test_get_rates[setup1]", "tests/contrib/exchange/test_backends.py::TestBackends::test_initial_update_rates[setup0]", "tests/... | jyangballin/swesmith.x86_64.django-money_1776_django-money.835c1ab8 | true | null | 1 | 22 | 16 | 1,272 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285333 | 81.131 | |||
5,769 | swe_smith::train::28030 | swe_smith | train | 28,030 | jsvine__pdfplumber.02ff4313.lm_rewrite__6zlnb3q9 | swesmith/jsvine__pdfplumber.02ff4313 | jsvine/pdfplumber | python | null | ### Issue: KeyError in `do_dict` Method When Filtering Attributes
While working with the `do_dict` method in the `Serializer` class, I encountered an issue where a `KeyError` is raised when attempting to filter attributes in JSON conversion. This seems to occur when specific attributes are included or excluded during ... | diff --git a/pdfplumber/convert.py b/pdfplumber/convert.py
index 9abfc87..2c79f0b 100644
--- a/pdfplumber/convert.py
+++ b/pdfplumber/convert.py
@@ -103,12 +103,9 @@ class Serializer:
def do_tuple(self, obj: Tuple[Any, ...]) -> Tuple[Any, ...]:
return tuple(self.serialize(x) for x in obj)
- def do_di... | ["tests/test_convert.py::Test::test_json_attr_filter"] | ["tests/test_basics.py::Test::test_annots", "tests/test_basics.py::Test::test_annots_cropped", "tests/test_basics.py::Test::test_annots_rotated", "tests/test_basics.py::Test::test_bad_fileobj", "tests/test_basics.py::Test::test_colors", "tests/test_basics.py::Test::test_crop_and_filter", "tests/test_basics.py::Test::te... | jyangballin/swesmith.x86_64.jsvine_1776_pdfplumber.02ff4313 | true | null | 1 | 9 | 1 | 1,532 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285333 | 81.131 | |||
5,770 | swe_smith::train::10487 | swe_smith | train | 10,487 | paramiko__paramiko.23f92003.func_basic__jkjjpdsj | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | BufferedFile initialization causes "File is closed" errors
#### Description
BufferedFile objects are being initialized in a closed state, causing "OSError: File is closed" errors when attempting to perform file operations.
#### Steps/Code to Reproduce
```python
import paramiko
from paramiko.file import BufferedFile... | diff --git a/paramiko/file.py b/paramiko/file.py
index a36abb9..c6163eb 100644
--- a/paramiko/file.py
+++ b/paramiko/file.py
@@ -49,19 +49,16 @@ class BufferedFile(ClosingContextManager):
FLAG_UNIVERSAL_NEWLINE = 0x80
def __init__(self):
- self.newlines = None
- self._flags = 0
- self._... | ["tests/test_channelfile.py::TestChannelFile::test_read_recvs_from_channel", "tests/test_channelfile.py::TestChannelFile::test_write_calls_channel_sendall", "tests/test_channelfile.py::TestChannelStderrFile::test_read_calls_channel_recv_stderr", "tests/test_channelfile.py::TestChannelStderrFile::test_write_calls_channe... | ["tests/agent.py::AgentKey_::str_is_repr", "tests/agent.py::AgentKey_::init::needs_at_least_two_arguments", "tests/agent.py::AgentKey_::init::sets_attributes_and_parses_blob", "tests/agent.py::AgentKey_::init::comment_optional", "tests/agent.py::AgentKey_::init::sets_inner_key_when_known_type[rsa]", "tests/agent.py::Ag... | jyangballin/swesmith.x86_64.paramiko_1776_paramiko.23f92003 | true | null | 1 | 19 | 78 | 1,332 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285333 | 81.131 | |||
5,771 | swe_smith::train::7107 | swe_smith | train | 7,107 | cantools__cantools.0c6a7871.combine_file__zk6hnwbw | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | DBC parsing fails with "list index out of range" error
#### Description
When loading DBC files, the parser crashes with "list index out of range" errors. This affects basic database loading functionality and prevents proper parsing of DBC files.
#### Steps/Code to Reproduce
```python
import cantools
# This will fa... | diff --git a/src/cantools/database/can/formats/dbc.py b/src/cantools/database/can/formats/dbc.py
index a5b6092..abdd184 100644
--- a/src/cantools/database/can/formats/dbc.py
+++ b/src/cantools/database/can/formats/dbc.py
@@ -1291,9 +1291,9 @@ def _load_message_senders(tokens, attributes):
message_senders = default... | ["tests/test_command_line.py::CanToolsCommandLineTest::test_decode_can_fd", "tests/test_command_line.py::CanToolsCommandLineTest::test_dump", "tests/test_command_line.py::CanToolsCommandLineTest::test_dump_j1939", "tests/test_command_line.py::CanToolsCommandLineTest::test_dump_with_comments_mux", "tests/test_command_li... | ["tests/test_autosar.py::CanToolsAutosarTest::test_autosar3_e2e_profile2", "tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_e2e", "tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_e2e_profile5", "tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_secoc", "tests/test_command_line.py::CanToolsCo... | jyangballin/swesmith.x86_64.cantools_1776_cantools.0c6a7871 | true | null | 1 | 38 | 44 | 952 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285333 | 81.131 | |||
5,772 | swe_smith::train::26677 | swe_smith | train | 26,677 | pylint-dev__astroid.b114f6b5.pr_2260 | swesmith/pylint-dev__astroid.b114f6b5 | pylint-dev/astroid | python | null | # LRU Cache decorator without parentheses not recognized
## Description
I found an issue with the `lru_cache` decorator from `functools`. When using the decorator without parentheses (i.e., `@functools.lru_cache` instead of `@functools.lru_cache()`), the decorator is not properly recognized. This causes problems when... | diff --git a/astroid/brain/brain_functools.py b/astroid/brain/brain_functools.py
index c11b856..408baa7 100644
--- a/astroid/brain/brain_functools.py
+++ b/astroid/brain/brain_functools.py
@@ -135,17 +135,15 @@ def _looks_like_lru_cache(node) -> bool:
if not node.decorators:
return False
for decorato... | ["tests/test_object_model.py::test_lru_cache[False]"] | ["tests/brain/numpy/test_core_einsumfunc.py::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_einsumfunc.py::test_function_parameters", "tests/brain/numpy/test_core_fromnumeric.py::BrainNumpyCoreFromNumericTest::test_numpy_function_calls_inferred_as_ndarray", "tests/brain/numpy/test_core_fun... | jyangballin/swesmith.x86_64.pylint-dev_1776_astroid.b114f6b5 | true | null | 1 | 8 | 1 | 1,551 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285167 | 81.1305 | |||
5,773 | swe_smith::train::44471 | swe_smith | train | 44,471 | pydata__patsy.a5d16484.func_pm_remove_loop__gt4px8ol | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | categorical_to_int returns empty array instead of converting data
When using categorical_to_int function, it returns an empty array instead of properly converting categorical data to integers. This affects various parts of the codebase that rely on categorical data conversion.
#### Steps/Code to Reproduce
```python
... | diff --git a/patsy/categorical.py b/patsy/categorical.py
index c88ecd5..36e529f 100644
--- a/patsy/categorical.py
+++ b/patsy/categorical.py
@@ -363,39 +363,10 @@ def categorical_to_int(data, levels, NA_action, origin=None):
if level_to_int[False] == 0 and level_to_int[True] == 1:
return data.asty... | ["patsy/build.py::test__eval_factor_categorical", "patsy/categorical.py::test_categorical_to_int", "patsy/test_build.py::test_simple", "patsy/test_build.py::test_R_bugs", "patsy/test_build.py::test_redundancy_thoroughly", "patsy/test_build.py::test_data_types", "patsy/test_build.py::test_NA_action", "patsy/test_build.p... | ["patsy/build.py::test__max_allowed_dim", "patsy/build.py::test__eval_factor_numerical", "patsy/build.py::test__column_combinations", "patsy/build.py::test__subterm_column_names_iter_and__build_subterm", "patsy/build.py::test__factors_memorize", "patsy/build.py::test__examine_factor_types", "patsy/builtins.py::test_I",... | jyangballin/swesmith.x86_64.pydata_1776_patsy.a5d16484 | true | null | 1 | 29 | 20 | 1,131 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285167 | 81.1305 | |||
5,774 | swe_smith::train::42693 | swe_smith | train | 42,693 | python-jsonschema__jsonschema.93e0caa5.func_pm_ctrl_invert_if__ztp2ift7 | swesmith/python-jsonschema__jsonschema.93e0caa5 | python-jsonschema/jsonschema | python | null | exclusiveMaximum validation logic inverted in Draft 3/4
#### Description
The validation logic for `exclusiveMaximum` in Draft 3 and Draft 4 schemas appears to be inverted. When `exclusiveMaximum` is `true`, values equal to the maximum should be invalid, but they're currently being accepted. Conversely, when `exclusiv... | diff --git a/jsonschema/_legacy_keywords.py b/jsonschema/_legacy_keywords.py
index c691589..5b21284 100644
--- a/jsonschema/_legacy_keywords.py
+++ b/jsonschema/_legacy_keywords.py
@@ -156,17 +156,16 @@ def maximum_draft3_draft4(validator, maximum, instance, schema):
return
if schema.get("exclusiveMaxim... | ["jsonschema/tests/test_jsonschema_test_suite.py::TestDraft3::test_bignum_float_comparison_with_high_precision_comparison_works_for_high_numbers", "jsonschema/tests/test_jsonschema_test_suite.py::TestDraft3::test_maximum_exclusiveMaximum_validation_boundary_point_is_invalid", "jsonschema/tests/test_jsonschema_test_suit... | ["jsonschema/tests/test_cli.py::TestCLI::test_custom_error_format", "jsonschema/tests/test_cli.py::TestCLI::test_custom_error_format_applies_to_schema_errors", "jsonschema/tests/test_cli.py::TestCLI::test_instance_does_not_exist", "jsonschema/tests/test_cli.py::TestCLI::test_instance_does_not_exist_pretty_output", "jso... | jyangballin/swesmith.x86_64.python-jsonschema_1776_jsonschema.93e0caa5 | true | null | 1 | 7 | 12 | 1,571 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285167 | 81.1305 | |||
5,775 | r2e_gym::train::5283 | r2e_gym | train | 5,283 | aiohttp__e74a4a02893c2b0a90ddcd8935ac9cdb946f2f1c | aiohttp | aio-libs/aiohttp | python | e74a4a02893c2b0a90ddcd8935ac9cdb946f2f1c | **Title:**
TCPConnector Fails to Cancel DNS Resolution Tasks on Closure
**Description:**
When closing a `TCPConnector` instance with ongoing DNS resolution tasks, the connector does not properly cancel these tasks. As a result, awaiting these tasks does not raise the expected `asyncio.CancelledError`, leading to unexp... | diff --git a/CHANGES/8163.bugfix.rst b/CHANGES/8163.bugfix.rst
--- a/CHANGES/8163.bugfix.rst
+++ b/CHANGES/8163.bugfix.rst
@@ -0,0 +1,5 @@
+Improved the DNS resolution performance on cache hit
+-- by :user:`bdraco`.
+
+This is achieved by avoiding an :mod:`asyncio` task creation
+in this case.
diff --git a/aiohttp/conn... | diff --git a/tests/test_connector.py b/tests/test_connector.py
--- a/tests/test_connector.py
+++ b/tests/test_connector.py
@@ -767,6 +767,7 @@
loop.create_task(conn._resolve_host("localhost", 8080))
loop.create_task(conn._resolve_host("localhost", 8080))
await asyncio.sleep(0)
+ await ... | null | null | namanjain12/aiohttp_final:e74a4a02893c2b0a90ddcd8935ac9cdb946f2f1c | true | null | 2 | 55 | null | 1,323 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.403833 | 81.13025 | ||
5,776 | swe_smith::train::9775 | swe_smith | train | 9,775 | marshmallow-code__webargs.dbde72fe.lm_rewrite__xwzv8hf2 | swesmith/marshmallow-code__webargs.dbde72fe | marshmallow-code/webargs | python | null | # parse_json fails with non-UTF-8 encoded bytes
### Bug description
I found an issue with the `parse_json` function when handling non-UTF-8 encoded bytes.
When trying to parse JSON data that contains non-UTF-8 characters, the function fails with a generic UnicodeDecodeError instead of providing a more helpful JSON-s... | diff --git a/src/webargs/core.py b/src/webargs/core.py
index 44294e9..44fbb78 100644
--- a/src/webargs/core.py
+++ b/src/webargs/core.py
@@ -101,20 +101,16 @@ def is_json(mimetype: str | None) -> bool:
return False
-def parse_json(s: typing.AnyStr, *, encoding: str = "utf-8") -> typing.Any:
- if isinstance(... | ["tests/test_djangoparser.py::TestDjangoParser::test_parse_json_with_nonutf8_chars"] | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_querystring_args", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_form", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json", "tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_missing", "tests/test_aiohttpparser.py::T... | jyangballin/swesmith.x86_64.marshmallow-code_1776_webargs.dbde72fe | true | null | 1 | 24 | 1 | 1,230 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285 | 81.13 | |||
5,777 | swe_smith::train::51162 | swe_smith | train | 51,162 | marshmallow-code__apispec.8b421526.func_basic__7xxnvnjf | swesmith/marshmallow-code__apispec.8b421526 | marshmallow-code/apispec | python | null | Parameter registration broken - returns None and swaps name/location fields
#### Description
When registering parameters using `spec.components.parameter()`, the method now returns `None` instead of the spec instance, breaking method chaining. Additionally, the parameter name and location fields are being swapped in ... | diff --git a/src/apispec/core.py b/src/apispec/core.py
index e9ccb40..c42fae1 100644
--- a/src/apispec/core.py
+++ b/src/apispec/core.py
@@ -222,27 +222,28 @@ class Components:
:param bool lazy: register component only when referenced in the spec
:param kwargs: plugin-specific arguments
"""
-... | ["tests/test_core.py::TestComponents::test_parameter[2.0]", "tests/test_core.py::TestComponents::test_parameter[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[2.0]", "tests/test_core.py::TestComponents::test_parameter_is_chainable[3.0.0]", "tests/test_core.py::TestComponents::test_parameter_d... | ["tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version", "tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]", "tests/test_core.py::TestTags::test_tag[... | jyangballin/swesmith.x86_64.marshmallow-code_1776_apispec.8b421526 | true | null | 1 | 13 | 30 | 1,450 | 0 | 0.6 | 1 | 0.75 | 1 | 0.285 | 81.13 | |||
5,778 | swe_smith::train::20874 | swe_smith | train | 20,874 | tobymao__sqlglot.036601ba.func_pm_remove_assign__bpx0vxov | swesmith/tobymao__sqlglot.036601ba | tobymao/sqlglot | python | null | NameError in unnest_subqueries optimizer after recent changes
#### Description
The unnest_subqueries optimizer is throwing NameError exceptions for undefined variables. Several variables that were previously defined in the decorrelate function are now missing, causing the optimizer to fail when processing subqueries.... | diff --git a/sqlglot/optimizer/unnest_subqueries.py b/sqlglot/optimizer/unnest_subqueries.py
index dcb2f59..7ad51cc 100644
--- a/sqlglot/optimizer/unnest_subqueries.py
+++ b/sqlglot/optimizer/unnest_subqueries.py
@@ -118,7 +118,6 @@ def unnest(select, parent_select, next_alias_name):
def decorrelate(select, parent... | ["tests/test_optimizer.py::TestOptimizer::test_lateral_annotation", "tests/test_optimizer.py::TestOptimizer::test_optimize", "tests/test_optimizer.py::TestOptimizer::test_tpcds", "tests/test_optimizer.py::TestOptimizer::test_tpch", "tests/test_optimizer.py::TestOptimizer::test_unnest_subqueries"] | ["tests/test_optimizer.py::TestOptimizer::test_aggfunc_annotation", "tests/test_optimizer.py::TestOptimizer::test_annotate_funcs", "tests/test_optimizer.py::TestOptimizer::test_annotate_types", "tests/test_optimizer.py::TestOptimizer::test_binary_annotation", "tests/test_optimizer.py::TestOptimizer::test_bracket_annota... | jyangballin/swesmith.x86_64.tobymao_1776_sqlglot.036601ba | true | null | 1 | 20 | 5 | 1,309 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284833 | 81.1295 | |||
5,779 | swe_smith::train::3234 | swe_smith | train | 3,234 | Suor__funcy.207a7810.lm_rewrite__0qqkv50w | swesmith/Suor__funcy.207a7810 | suor/funcy | python | null | # [Bug]: `keep()` function breaks `autocurry` functionality
## Bug summary
In the current version, when using `keep()` with `autocurry`, it fails with a TypeError. The `keep()` function implementation is causing issues with higher-order functions that rely on iterating over function results.
## Code for reproduction... | diff --git a/funcy/seqs.py b/funcy/seqs.py
index 9a96252..f94faff 100644
--- a/funcy/seqs.py
+++ b/funcy/seqs.py
@@ -153,10 +153,17 @@ def keep(f, seq=EMPTY):
"""Maps seq with f and iterates truthy results.
Simply iterates truthy values in one argument version."""
if seq is EMPTY:
- return _fil... | ["tests/test_funcs.py::test_autocurry_hard"] | ["tests/test_calc.py::test_memoize", "tests/test_calc.py::test_memoize_args_kwargs", "tests/test_calc.py::test_memoize_skip", "tests/test_calc.py::test_memoize_memory", "tests/test_calc.py::test_memoize_key_func", "tests/test_calc.py::test_make_lookuper", "tests/test_calc.py::test_make_lookuper_nested", "tests/test_cal... | jyangballin/swesmith.x86_64.suor_1776_funcy.207a7810 | true | null | 1 | 13 | 1 | 1,449 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284833 | 81.1295 | |||
5,780 | swe_smith::train::38304 | swe_smith | train | 38,304 | burnash__gspread.a8be3b96.func_pm_ctrl_shuffle__o621cgb3 | swesmith/burnash__gspread.a8be3b96 | burnash/gspread | python | null | A1 notation parsing fails with UnboundLocalError
When using A1 notation for cell references, the code throws an `UnboundLocalError: local variable 'm' referenced before assignment` error.
#### Steps/Code to Reproduce
```python
import gspread
from gspread import utils
# This will fail with UnboundLocalError
utils.a1... | diff --git a/gspread/utils.py b/gspread/utils.py
index 6daac86..72ab362 100644
--- a/gspread/utils.py
+++ b/gspread/utils.py
@@ -409,6 +409,25 @@ IntOrInf = Union[int, float]
def _a1_to_rowcol_unbounded(label: str) -> Tuple[IntOrInf, IntOrInf]:
+ if m:
+ column_label, row = m.groups()
+
+ col: Int... | ["tests/cell_test.py::CellTest::test_define_named_range", "tests/cell_test.py::CellTest::test_delete_named_range", "tests/cell_test.py::CellTest::test_merge_cells", "tests/utils_test.py::UtilsTest::test_a1_to_grid_range_improper_range", "tests/utils_test.py::UtilsTest::test_a1_to_grid_range_other_directions", "tests/ut... | ["tests/cell_test.py::CellTest::test_a1_value", "tests/cell_test.py::CellTest::test_equality", "tests/cell_test.py::CellTest::test_numeric_value", "tests/cell_test.py::CellTest::test_properties", "tests/client_test.py::ClientTest::test_access_non_existing_spreadsheet", "tests/client_test.py::ClientTest::test_access_pri... | jyangballin/swesmith.x86_64.burnash_1776_gspread.a8be3b96 | true | null | 1 | 39 | 43 | 929 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284833 | 81.1295 | |||
5,781 | swe_smith::train::24545 | swe_smith | train | 24,545 | sunpy__sunpy.f8edfd5c.combine_module__urmxyrfi | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | # Time parsing and TimeRange issues in sunpy
I've found two separate issues in the sunpy time module:
## Issue 1: Time parsing with microseconds and hour=24 is broken
When trying to parse times with microseconds that have excess trailing zeros, the parser fails. For example:
```python
from sunpy.time import parse_t... | diff --git a/sunpy/time/time.py b/sunpy/time/time.py
index 0d760c5..1109255 100644
--- a/sunpy/time/time.py
+++ b/sunpy/time/time.py
@@ -116,7 +116,7 @@ def _regex_parse_time(inp, format):
# Special handling to strip any excess zeros beyond the six digits of the microsecond field
if "microsecond" in found_gro... | ["sunpy/time/tests/test_time.py::test_parse_time_24", "sunpy/time/tests/test_time.py::test_parse_time_24_2", "sunpy/time/tests/test_time.py::test_parse_time_microseconds_excess_trailing_zeros", "sunpy/time/tests/test_timerange.py::test_timerange_inputs[inputs1]", "sunpy/time/tests/test_timerange.py::test_timerange_inpu... | ["sunpy/time/tests/test_time.py::test_parse_time_tuple", "sunpy/time/tests/test_time.py::test_parse_time_int", "sunpy/time/tests/test_time.py::test_parse_time_pandas_timestamp", "sunpy/time/tests/test_time.py::test_parse_time_nanoseconds", "sunpy/time/tests/test_time.py::test_parse_time_pandas_series", "sunpy/time/test... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 2 | 8 | 9 | 1,549 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284833 | 81.1295 | |||
5,782 | r2e_gym::train::5272 | r2e_gym | train | 5,272 | aiohttp__f4b5552c49a43359d3e2a14dc7d0d44262f9e41f | aiohttp | aio-libs/aiohttp | python | f4b5552c49a43359d3e2a14dc7d0d44262f9e41f | **Title:** Adding Route with Regex and Optional Trailing Slash Raises ValueError
**Description:**
When attempting to add a route that includes a regular expression with an optional trailing slash, the URL dispatcher raises a `ValueError`. This prevents the route from being registered correctly, disrupting the applicat... | diff --git a/aiohttp/web.py b/aiohttp/web.py
--- a/aiohttp/web.py
+++ b/aiohttp/web.py
@@ -1383,7 +1383,7 @@
DYN_WITH_RE = re.compile(
r'^\{(?P<var>[a-zA-Z][_a-zA-Z0-9]*):(?P<re>.+)\}$')
GOOD = r'[^{}/]+'
- PLAIN = re.compile('^' + GOOD + '$')
+ ROUTE_RE = re.compile(r'(\{[_a-zA-Z][^{}]*(?:\{[^... | diff --git a/tests/test_urldispatch.py b/tests/test_urldispatch.py
--- a/tests/test_urldispatch.py
+++ b/tests/test_urldispatch.py
@@ -112,11 +112,6 @@
with self.assertRaises(ValueError):
self.router.add_route('post', '/post/{id"}', handler)
- def test_add_url_invalid5(self):
- handler... | null | null | namanjain12/aiohttp_final:f4b5552c49a43359d3e2a14dc7d0d44262f9e41f | true | null | 1 | 70 | null | 1,021 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.4035 | 81.12925 | ||
5,783 | swe_smith::train::31195 | swe_smith | train | 31,195 | scrapy__scrapy.35212ec5.combine_module__t78o04e4 | swesmith/scrapy__scrapy.35212ec5 | scrapy/scrapy | python | null | `scrapy genspider --list` command fails with FileNotFoundError
#### Description
When trying to list available spider templates using `scrapy genspider --list`, the command fails with a FileNotFoundError. This appears to be related to changes in the command processing logic.
#### Steps/Code to Reproduce
```bash
scra... | diff --git a/scrapy/commands/genspider.py b/scrapy/commands/genspider.py
index 6d4aec3..2d75a2d 100644
--- a/scrapy/commands/genspider.py
+++ b/scrapy/commands/genspider.py
@@ -92,9 +92,6 @@ class Command(ScrapyCommand):
)
def run(self, args: list[str], opts: argparse.Namespace) -> None:
- if opt... | ["tests/test_commands.py::StartprojectTest::test_existing_project_dir", "tests/test_commands.py::StartprojectTest::test_startproject", "tests/test_commands.py::StartprojectTest::test_startproject_with_project_dir", "tests/test_commands.py::StartprojectTemplatesTest::test_startproject_permissions_from_read_only", "tests... | ["tests/test_commands.py::CommandSettings::test_help_formatter", "tests/test_commands.py::CommandSettings::test_settings_json_string", "tests/test_commands.py::GenspiderStandaloneCommandTest::test_generate_standalone_spider", "tests/test_commands.py::GenspiderStandaloneCommandTest::test_same_name_as_existing_file", "te... | jyangballin/swesmith.x86_64.scrapy_1776_scrapy.35212ec5 | true | null | 2 | 38 | 52 | 947 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2845 | 81.1285 | |||
5,784 | swe_smith::train::19507 | swe_smith | train | 19,507 | seperman__deepdiff.ed252022.lm_rewrite__ckh4ofx4 | swesmith/seperman__deepdiff.ed252022 | seperman/deepdiff | python | null | ### [BUG] Handling of Negative Significant Digits in DeepDiff
#### Description
When using the `DeepDiff` function with a negative value for `significant_digits`, the function does not raise an error as expected. This behavior is inconsistent with the intended functionality, where negative significant digits should tr... | diff --git a/deepdiff/base.py b/deepdiff/base.py
index d16bad5..89bc6e3 100644
--- a/deepdiff/base.py
+++ b/deepdiff/base.py
@@ -9,15 +9,14 @@ class Base:
numbers = numbers
strings = strings
- def get_significant_digits(self, significant_digits, ignore_numeric_type_changes):
- if significant_digit... | ["tests/test_diff_text.py::TestDeepDiffText::test_negative_significant_digits"] | ["tests/test_anyset.py::TestAnySet::test_anyset_init1", "tests/test_anyset.py::TestAnySet::test_anyset_init2", "tests/test_anyset.py::TestAnySet::test_anyset_init3_add", "tests/test_anyset.py::TestAnySet::test_anyset_pop1", "tests/test_anyset.py::TestAnySet::test_iter_anyset", "tests/test_cache.py::TestCache::test_cach... | jyangballin/swesmith.x86_64.seperman_1776_deepdiff.ed252022 | true | null | 1 | 17 | 1 | 1,367 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2845 | 81.1285 | |||
5,785 | swe_smith::train::10149 | swe_smith | train | 10,149 | paramiko__paramiko.23f92003.combine_file__lp0u3uyq | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | DSS key operations failing after recent changes
I'm encountering issues with DSS key operations that seem to have broken recently. When trying to load or use DSS keys, I'm getting various errors including `ValueError: p must be exactly...` and `SSHException` errors.
#### Steps to Reproduce
```python
from paramiko im... | diff --git a/paramiko/dsskey.py b/paramiko/dsskey.py
index 5215d28..bc3ac9f 100644
--- a/paramiko/dsskey.py
+++ b/paramiko/dsskey.py
@@ -67,20 +67,20 @@ class DSSKey(PKey):
self._from_private_key_file(filename, password)
return
if (msg is None) and (data is not None):
- msg... | ["tests/agent.py::AgentKey_::init::sets_inner_key_when_known_type[dss]", "tests/agent.py::AgentKey_::fields::defers_to_inner_key_when_present[dss]", "tests/agent.py::AgentKey_::get_bits::defers_to_inner_key_when_present[dss]", "tests/agent.py::AgentKey_::asbytes::defers_to_inner_key_when_present[dss]", "tests/pkey.py::... | ["tests/agent.py::AgentKey_::str_is_repr", "tests/agent.py::AgentKey_::init::needs_at_least_two_arguments", "tests/agent.py::AgentKey_::init::sets_attributes_and_parses_blob", "tests/agent.py::AgentKey_::init::comment_optional", "tests/agent.py::AgentKey_::init::sets_inner_key_when_known_type[rsa]", "tests/agent.py::Ag... | jyangballin/swesmith.x86_64.paramiko_1776_paramiko.23f92003 | true | null | 1 | 18 | 15 | 1,346 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284333 | 81.128 | |||
5,786 | swe_smith::train::48160 | swe_smith | train | 48,160 | sqlfluff__sqlfluff.50a1c4b6.func_pm_ctrl_invert_if__pd357sf6 | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | RawSegment initialization logic inverted causing AttributeError
#### Description
When creating RawSegment instances, the initialization logic for handling `raw` and `instance_types` parameters appears to be inverted, causing segments to be initialized with incorrect values. This leads to AttributeError when trying to... | diff --git a/src/sqlfluff/core/parser/segments/raw.py b/src/sqlfluff/core/parser/segments/raw.py
index 05fcdbd..1ff7cea 100644
--- a/src/sqlfluff/core/parser/segments/raw.py
+++ b/src/sqlfluff/core/parser/segments/raw.py
@@ -47,10 +47,10 @@ class RawSegment(BaseSegment):
If pos_marker is not provided, it is as... | ["test/core/parser/segments/segments_base_test.py::test__parser__base_segments_descendant_type_set", "test/core/parser/segments/segments_base_test.py::test__parser__base_segments_to_tuple_a", "test/core/parser/segments/segments_base_test.py::test__parser__base_segments_to_tuple_b", "test/core/parser/segments/segments_b... | ["test/core/parser/segments/segments_base_test.py::test__parser__base_segments_type", "test/core/parser/segments/segments_base_test.py::test__parser__base_segments_class_types", "test/core/parser/segments/segments_base_test.py::test__parser__base_segments_direct_descendant_type_set", "test/core/parser/segments/segments... | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 11 | 20 | 1,484 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284 | 81.127 | |||
5,787 | swe_smith::train::44368 | swe_smith | train | 44,368 | pydata__patsy.a5d16484.func_pm_op_change__gjuhj9xo | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | TypeError in categorical_to_int when handling large level lists
#### Description
When processing categorical data with a large number of levels, the `categorical_to_int` function raises a `TypeError: unsupported operand type(s) for /: 'str' and 'str'` due to incorrect operator usage in error message formatting.
####... | diff --git a/patsy/categorical.py b/patsy/categorical.py
index c88ecd5..5683fec 100644
--- a/patsy/categorical.py
+++ b/patsy/categorical.py
@@ -342,8 +342,7 @@ def categorical_to_int(data, levels, NA_action, origin=None):
if isinstance(data, _CategoricalBox):
if data.levels is not None and tuple(data.lev... | ["patsy/build.py::test__eval_factor_categorical", "patsy/categorical.py::test_categorical_to_int", "patsy/test_build.py::test_data_mismatch", "patsy/test_regressions.py::test_issue_11"] | ["patsy/build.py::test__max_allowed_dim", "patsy/build.py::test__eval_factor_numerical", "patsy/build.py::test__column_combinations", "patsy/build.py::test__subterm_column_names_iter_and__build_subterm", "patsy/build.py::test__factors_memorize", "patsy/build.py::test__examine_factor_types", "patsy/builtins.py::test_I",... | jyangballin/swesmith.x86_64.pydata_1776_patsy.a5d16484 | true | null | 1 | 8 | 4 | 1,544 | 0 | 0.6 | 1 | 0.75 | 1 | 0.284 | 81.127 | |||
5,788 | swe_smith::train::36522 | swe_smith | train | 36,522 | lincolnloop__python-qrcode.456b01d4.combine_module__dp1px8eq | swesmith/lincolnloop__python-qrcode.456b01d4 | lincolnloop/python-qrcode | python | null | # Multiple issues with QR code generation in latest version
I've encountered several problems with QR code generation in the latest version:
## Issue 1: PyPNG image generation fails
When trying to generate QR codes using the PyPNG backend, I get an AttributeError. Here's a simple reproduction:
```python
import qrco... | diff --git a/qrcode/image/pure.py b/qrcode/image/pure.py
index 5a8b2c5..b0332cc 100644
--- a/qrcode/image/pure.py
+++ b/qrcode/image/pure.py
@@ -26,23 +26,23 @@ class PyPNGImage(BaseImage):
def save(self, stream, kind=None):
if isinstance(stream, str):
- stream = open(stream, "wb")
- s... | ["qrcode/tests/test_qrcode_pypng.py::test_render_pypng", "qrcode/tests/test_qrcode_pypng.py::test_render_pypng_to_str", "qrcode/tests/test_qrcode_svg.py::test_svg_circle_drawer", "qrcode/tests/test_script.py::test_factory_drawer"] | ["qrcode/tests/test_example.py::test_example", "qrcode/tests/test_qrcode.py::test_basic", "qrcode/tests/test_qrcode.py::test_large", "qrcode/tests/test_qrcode.py::test_invalid_version", "qrcode/tests/test_qrcode.py::test_invalid_border", "qrcode/tests/test_qrcode.py::test_overflow", "qrcode/tests/test_qrcode.py::test_a... | jyangballin/swesmith.x86_64.lincolnloop_1776_python-qrcode.456b01d4 | true | null | 2 | 20 | 4 | 1,303 | 0 | 0.6 | 1 | 0.75 | 1 | 0.283833 | 81.1265 | |||
5,789 | swe_smith::train::1708 | swe_smith | train | 1,708 | agronholm__typeguard.b6a7e438.combine_module__gctpviq9 | swesmith/agronholm__typeguard.b6a7e438 | agronholm/typeguard | python | null | Import hook fails to execute modules properly
#### Description
When using the import hook, modules are not being executed correctly. The import hook appears to be skipping module execution entirely, causing imported modules to have missing attributes and functionality.
#### Steps/Code to Reproduce
```python
import ... | diff --git a/src/typeguard/_importhook.py b/src/typeguard/_importhook.py
index 0d1c627..ba51384 100644
--- a/src/typeguard/_importhook.py
+++ b/src/typeguard/_importhook.py
@@ -95,7 +95,7 @@ class TypeguardLoader(SourceFileLoader):
"importlib._bootstrap_external.cache_from_source",
optimized_c... | ["tests/test_importhook.py::test_blanket_import", "tests/test_importhook.py::test_debug_instrumentation", "tests/test_instrumentation.py::test_pep_604_union_args[typechecked]", "tests/test_instrumentation.py::test_pep_604_union_retval[typechecked]", "tests/test_instrumentation.py::test_type_checked_func[importhook]", "... | ["tests/mypy/test_type_annotations.py::test_positive", "tests/mypy/test_type_annotations.py::test_negative", "tests/test_checkers.py::TestAnyStr::test_valid[str]", "tests/test_checkers.py::TestAnyStr::test_valid[bytes]", "tests/test_checkers.py::TestAnyStr::test_bad_type", "tests/test_checkers.py::TestBytesLike::test_v... | jyangballin/swesmith.x86_64.agronholm_1776_typeguard.b6a7e438 | true | null | 2 | 22 | 52 | 1,263 | 0 | 0.6 | 1 | 0.75 | 1 | 0.283833 | 81.1265 | |||
5,790 | swe_smith::train::10570 | swe_smith | train | 10,570 | paramiko__paramiko.23f92003.func_basic__plgm0zih | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | SFTP operations fail with EOFError after server connection drops
#### Description
When performing SFTP operations, some commands are failing with `EOFError` exceptions instead of proper error handling. This appears to happen when the server connection is dropped or encounters issues during packet reading.
#### Steps... | diff --git a/paramiko/sftp_client.py b/paramiko/sftp_client.py
index 066cd83..f2760fd 100644
--- a/paramiko/sftp_client.py
+++ b/paramiko/sftp_client.py
@@ -885,18 +885,15 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
while True:
try:
t, data = self._read_packet()
- ... | ["tests/test_sftp.py::TestSFTP::test_file", "tests/test_sftp.py::TestSFTP::test_write", "tests/test_sftp.py::TestSFTP::test_sftp_file_can_be_used_as_context_manager", "tests/test_sftp.py::TestSFTP::test_append", "tests/test_sftp.py::TestSFTP::test_rename", "tests/test_sftp.py::TestSFTP::testa_posix_rename", "tests/test... | ["tests/agent.py::AgentKey_::str_is_repr", "tests/agent.py::AgentKey_::init::needs_at_least_two_arguments", "tests/agent.py::AgentKey_::init::sets_attributes_and_parses_blob", "tests/agent.py::AgentKey_::init::comment_optional", "tests/agent.py::AgentKey_::init::sets_inner_key_when_known_type[rsa]", "tests/agent.py::Ag... | jyangballin/swesmith.x86_64.paramiko_1776_paramiko.23f92003 | true | null | 1 | 24 | 43 | 1,222 | 0 | 0.6 | 1 | 0.75 | 1 | 0.283667 | 81.126 | |||
5,791 | swe_smith::train::24496 | swe_smith | train | 24,496 | sunpy__sunpy.f8edfd5c.combine_module__fbmg6tus | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | # EVE and NOAA TimeSeries parsers not working properly
## Description
I found two issues with the TimeSeries parsers in sunpy:
1. The EVE parser is not reading the header information correctly. When trying to create a TimeSeries from an EVE file, it fails because the header lines are not being processed.
2. The NOAA... | diff --git a/sunpy/timeseries/sources/eve.py b/sunpy/timeseries/sources/eve.py
index c92060b..86c36a0 100644
--- a/sunpy/timeseries/sources/eve.py
+++ b/sunpy/timeseries/sources/eve.py
@@ -285,14 +285,6 @@ class EVESpWxTimeSeries(GenericTimeSeries):
fields = []
with codecs.open(filepath, mode='rb', en... | ["sunpy/timeseries/sources/tests/test_eve.py::test_eve", "sunpy/timeseries/sources/tests/test_noaa.py::test_noaa_pre_json"] | ["sunpy/timeseries/sources/tests/test_eve.py::test_implicit_esp", "sunpy/timeseries/sources/tests/test_eve.py::test_esp", "sunpy/timeseries/sources/tests/test_eve.py::test_esp_plot_column", "sunpy/timeseries/sources/tests/test_noaa.py::test_noaa_ind_json", "sunpy/timeseries/sources/tests/test_noaa.py::test_noaa_json_in... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 2 | 12 | 2 | 1,462 | 0 | 0.6 | 1 | 0.75 | 1 | 0.283667 | 81.126 | |||
5,792 | r2e_gym::train::6369 | r2e_gym | train | 6,369 | pillow__e341fbfc059b7b33179c6213b07541afa1a87add | pillow | python-pillow/pillow | python | e341fbfc059b7b33179c6213b07541afa1a87add | **Issue 1**
[ISSUE]
**Title:** Using Generators with `append_images` Raises TypeError When Saving GIFs
**Description:**
When attempting to save a GIF image with `append_images` provided as a generator, a `TypeError` is raised because the code tries to concatenate a list with a generator. This prevents the GIF from be... | diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py
--- a/PIL/GifImagePlugin.py
+++ b/PIL/GifImagePlugin.py
@@ -395,7 +395,7 @@
im_frames = []
frame_count = 0
- for imSequence in [im]+im.encoderinfo.get("append_images", []):
+ for imSequence in itertools.chain([im], im.encoderinfo.get("append_i... | diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py
--- a/Tests/test_file_gif.py
+++ b/Tests/test_file_gif.py
@@ -410,8 +410,18 @@
# Test appending single frame images
im = Image.new('RGB', (100, 100), '#f00')
- ims = [Image.new('RGB', (100, 100), color) for color in ['#0f0', '#00f']... | null | null | namanjain12/pillow_final:e341fbfc059b7b33179c6213b07541afa1a87add | true | null | 2 | 6 | null | 2,294 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.402333 | 81.12575 | ||
5,793 | swe_smith::train::18208 | swe_smith | train | 18,208 | msiemens__tinydb.10644a0e.combine_file__yhs3584c | swesmith/msiemens__tinydb.10644a0e | msiemens/tinydb | python | null | JSONStorage ignores custom kwargs and MemoryStorage initialization broken
#### Description
When using JSONStorage with custom kwargs (like `indent` for pretty printing), the kwargs are completely ignored during write operations. Additionally, MemoryStorage fails to initialize properly, causing various operations to f... | diff --git a/tinydb/storages.py b/tinydb/storages.py
index d5a2db7..1701cac 100644
--- a/tinydb/storages.py
+++ b/tinydb/storages.py
@@ -136,24 +136,23 @@ class JSONStorage(Storage):
return json.load(self._handle)
def write(self, data: Dict[str, Dict[str, Any]]):
- # Move the cursor to the be... | ["tests/test_middlewares.py::test_caching_read", "tests/test_middlewares.py::test_caching_write_many", "tests/test_middlewares.py::test_caching_flush", "tests/test_storages.py::test_json_kwargs", "tests/test_storages.py::test_in_memory_close", "tests/test_tinydb.py::test_multiple_dbs", "tests/test_tinydb.py::test_inser... | ["tests/test_middlewares.py::test_caching", "tests/test_middlewares.py::test_caching_flush_manually", "tests/test_middlewares.py::test_caching_write", "tests/test_middlewares.py::test_nested", "tests/test_middlewares.py::test_caching_json_write", "tests/test_operations.py::test_delete[memory]", "tests/test_operations.p... | jyangballin/swesmith.x86_64.msiemens_1776_tinydb.10644a0e | true | null | 1 | 15 | 11 | 1,401 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2835 | 81.1255 | |||
5,794 | swe_smith::train::3266 | swe_smith | train | 3,266 | Suor__funcy.207a7810.lm_rewrite__xpj94mrn | swesmith/Suor__funcy.207a7810 | suor/funcy | python | null | # raiser() function doesn't handle string exceptions correctly
I found an issue with the `raiser()` function in the flow module. When passing a string to the function, it doesn't behave as expected.
## Steps to reproduce
```python
from funcy import raiser
# This works fine
with raises(Exception):
raiser()()
# ... | diff --git a/funcy/flow.py b/funcy/flow.py
index 85c5a8e..de6d737 100644
--- a/funcy/flow.py
+++ b/funcy/flow.py
@@ -19,16 +19,12 @@ __all__ = ['raiser', 'ignore', 'silent', 'suppress', 'nullcontext', 'reraise', '
def raiser(exception_or_class=Exception, *args, **kwargs):
"""Constructs function that raises the gi... | ["tests/test_flow.py::test_raiser"] | ["tests/test_calc.py::test_memoize", "tests/test_calc.py::test_memoize_args_kwargs", "tests/test_calc.py::test_memoize_skip", "tests/test_calc.py::test_memoize_memory", "tests/test_calc.py::test_memoize_key_func", "tests/test_calc.py::test_make_lookuper", "tests/test_calc.py::test_make_lookuper_nested", "tests/test_cal... | jyangballin/swesmith.x86_64.suor_1776_funcy.207a7810 | true | null | 1 | 10 | 1 | 1,501 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2835 | 81.1255 | |||
5,795 | swe_smith::train::43809 | swe_smith | train | 43,809 | pydata__patsy.a5d16484.combine_file__nmsgzk5t | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | Infix parser fails with "operators must be unary or binary" error
#### Description
The infix parser is incorrectly classifying operators, causing a ValueError when trying to parse expressions. The error message "operators must be unary or binary" suggests that the arity check logic has been inverted.
#### Steps/Code... | diff --git a/patsy/infix_parser.py b/patsy/infix_parser.py
index 6c127b5..8ba9261 100644
--- a/patsy/infix_parser.py
+++ b/patsy/infix_parser.py
@@ -70,11 +70,11 @@ class Token:
__repr__ = repr_pretty_delegate
def _repr_pretty_(self, p, cycle):
- assert not cycle
+ assert cycle
kwargs... | ["patsy/constraint.py::test_linear_constraint", "patsy/constraint.py::test_eval_errors", "patsy/desc.py::test_ModelDesc_from_formula", "patsy/desc.py::test_eval_formula", "patsy/desc.py::test_eval_formula_error_reporting", "patsy/desc.py::test_formula_factor_origin", "patsy/design_info.py::test_DesignInfo_linear_constr... | ["patsy/build.py::test__max_allowed_dim", "patsy/build.py::test__eval_factor_numerical", "patsy/build.py::test__eval_factor_categorical", "patsy/build.py::test__column_combinations", "patsy/build.py::test__subterm_column_names_iter_and__build_subterm", "patsy/build.py::test__factors_memorize", "patsy/build.py::test__ex... | jyangballin/swesmith.x86_64.pydata_1776_patsy.a5d16484 | true | null | 1 | 35 | 32 | 1,001 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2835 | 81.1255 | |||
5,796 | swe_smith::train::30538 | swe_smith | train | 30,538 | gweis__isodate.17cb25eb.combine_module__pfivbjav | swesmith/gweis__isodate.17cb25eb | gweis/isodate | python | null | Duration.totimedelta() method fails when both start and end parameters are provided
#### Description
The `Duration.totimedelta()` method doesn't properly validate its parameters. When both `start` and `end` arguments are provided, it should raise a `ValueError` but instead silently continues execution, leading to inc... | diff --git a/src/isodate/duration.py b/src/isodate/duration.py
index 85241e4..a79e0c9 100644
--- a/src/isodate/duration.py
+++ b/src/isodate/duration.py
@@ -289,10 +289,7 @@ class Duration:
if start is None and end is None:
raise ValueError("start or end required")
if start is not None an... | ["tests/test_datetime.py::test_parse[19850412T1015-expected0-%Y%m%dT%H%M-19850412T1015]", "tests/test_datetime.py::test_parse[1985-04-12T10:15-expected1-%Y-%m-%dT%H:%M-1985-04-12T10:15]", "tests/test_datetime.py::test_parse[1985102T1015Z-expected2-%Y%jT%H%M%z-1985102T1015Z]", "tests/test_datetime.py::test_parse[1985-10... | ["tests/test_date.py::test_parse[4-19-expected0-%C]", "tests/test_date.py::test_parse[4-1985-expected1-%Y]", "tests/test_date.py::test_parse[4-1985-04-expected2-%Y-%m]", "tests/test_date.py::test_parse[4-198504-expected3-%Y%m]", "tests/test_date.py::test_parse[4-1985-04-12-expected4-%Y-%m-%d]", "tests/test_date.py::tes... | jyangballin/swesmith.x86_64.gweis_1776_isodate.17cb25eb | true | null | 2 | 29 | 44 | 1,121 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2835 | 81.1255 | |||
5,797 | swe_smith::train::51073 | swe_smith | train | 51,073 | marshmallow-code__apispec.8b421526.combine_file__vxobdupj | swesmith/marshmallow-code__apispec.8b421526 | marshmallow-code/apispec | python | null | SchemaResolver constructor arguments swapped causing AttributeError
#### Description
The SchemaResolver constructor has its arguments swapped, causing `openapi_version` and `converter` to be assigned to the wrong instance variables. This leads to AttributeError when trying to access version properties.
#### Steps/Co... | diff --git a/src/apispec/ext/marshmallow/schema_resolver.py b/src/apispec/ext/marshmallow/schema_resolver.py
index 355d886..80f80ea 100644
--- a/src/apispec/ext/marshmallow/schema_resolver.py
+++ b/src/apispec/ext/marshmallow/schema_resolver.py
@@ -12,8 +12,8 @@ class SchemaResolver:
"""
def __init__(self, ... | ["tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[AnalysisSchema]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference[schema1]", "tests/test_ext_marshmallow.py::TestDefinitionHelper::test_resolve_schema_dict_auto_reference_in_list[... | ["tests/test_core.py::TestAPISpecInit::test_raises_wrong_apispec_version", "tests/test_core.py::TestMetadata::test_openapi_metadata[2.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata[3.0.0]", "tests/test_core.py::TestMetadata::test_openapi_metadata_merge_v3[3.0.0]", "tests/test_core.py::TestTags::test_tag[... | jyangballin/swesmith.x86_64.marshmallow-code_1776_apispec.8b421526 | true | null | 1 | 24 | 70 | 1,221 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2835 | 81.1255 | |||
5,798 | swe_smith::train::39461 | swe_smith | train | 39,461 | pallets__jinja.ada0a9a6.func_pm_ctrl_shuffle__v1uikeb8 | swesmith/pallets__jinja.ada0a9a6 | pallets/jinja | python | null | slice filter broken with UnboundLocalError
#### Description
The slice filter is throwing an UnboundLocalError when trying to use it in templates. This appears to affect both sync and async versions of the filter.
#### Steps/Code to Reproduce
```python
from jinja2 import Environment
env = Environment()
tmpl = env.f... | diff --git a/src/jinja2/filters.py b/src/jinja2/filters.py
index 1420877..cb554e4 100644
--- a/src/jinja2/filters.py
+++ b/src/jinja2/filters.py
@@ -1046,6 +1046,25 @@ def do_striptags(value: "t.Union[str, HasHTML]") -> str:
def sync_do_slice(
value: "t.Collection[V]", slices: int, fill_with: "t.Optional[V]" = No... | ["tests/test_async_filters.py::test_slice[<lambda>0]", "tests/test_async_filters.py::test_slice[<lambda>1]", "tests/test_filters.py::TestFilter::test_slice"] | ["tests/test_api.py::TestExtendedAPI::test_item_and_attribute", "tests/test_api.py::TestExtendedAPI::test_finalize", "tests/test_api.py::TestExtendedAPI::test_finalize_constant_expression", "tests/test_api.py::TestExtendedAPI::test_no_finalize_template_data", "tests/test_api.py::TestExtendedAPI::test_context_finalize",... | jyangballin/swesmith.x86_64.pallets_1776_jinja.ada0a9a6 | true | null | 1 | 39 | 3 | 920 | 0 | 0.6 | 1 | 0.75 | 1 | 0.283333 | 81.125 | |||
5,799 | swe_smith::train::10023 | swe_smith | train | 10,023 | google__textfsm.c31b6007.lm_rewrite__5xjupqgu | swesmith/google__textfsm.c31b6007 | google/textfsm | python | null | **Unexpected ANSI Escape Sequence Behavior**
**Describe the bug**
It seems that the ANSI escape sequences are not being formatted correctly. When using the `_AnsiCmd` function, the expected ANSI codes are not being generated as they should be, leading to incorrect text formatting.
**To Reproduce**
Here's a simple sc... | diff --git a/textfsm/terminal.py b/textfsm/terminal.py
index 32252a4..7068af0 100755
--- a/textfsm/terminal.py
+++ b/textfsm/terminal.py
@@ -111,7 +111,7 @@ class UsageError(Error):
def _AnsiCmd(command_list):
- """Takes a list of SGR values and formats them as an ANSI escape sequence.
+ """Takes a list of SGR... | ["tests/terminal_test.py::TerminalTest::testAnsiCmd", "tests/terminal_test.py::TerminalTest::testAnsiText", "tests/texttable_test.py::UnitTestTextTable::testFormattedTable", "tests/texttable_test.py::UnitTestTextTable::testFormattedTable2", "tests/texttable_test.py::UnitTestTextTable::testFormattedTableColoredCells", "... | ["tests/clitable_test.py::UnitTestIndexTable::testCopy", "tests/clitable_test.py::UnitTestIndexTable::testGetRowMatch", "tests/clitable_test.py::UnitTestIndexTable::testParseIndex", "tests/clitable_test.py::UnitTestCliTable::testAddKey", "tests/clitable_test.py::UnitTestCliTable::testCliCompile", "tests/clitable_test.p... | jyangballin/swesmith.x86_64.google_1776_textfsm.c31b6007 | true | null | 1 | 23 | 7 | 1,240 | 0 | 0.6 | 1 | 0.75 | 1 | 0.283333 | 81.125 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.