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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,900 | swe_smith::train::23403 | swe_smith | train | 23,403 | pyparsing__pyparsing.533adf47.combine_file__mrerdmhx | swesmith/pyparsing__pyparsing.533adf47 | pyparsing/pyparsing | python | null | Diagram generation broken with KeyError when accessing element states
#### Description
The diagram generation functionality is failing with KeyError exceptions when trying to access element states. This appears to affect multiple diagram-related operations including creating diagrams, combining elements, and processi... | diff --git a/pyparsing/diagram/__init__.py b/pyparsing/diagram/__init__.py
index 7926f2c..ff36f80 100644
--- a/pyparsing/diagram/__init__.py
+++ b/pyparsing/diagram/__init__.py
@@ -58,8 +58,8 @@ template = Template(jinja2_template_source)
def _collapse_verbose_regex(regex_str: str) -> str:
collapsed = pyparsing... | ["tests/test_diagram.py::TestRailroadDiagrams::test_complete_combine_element", "tests/test_diagram.py::TestRailroadDiagrams::test_create_diagram", "tests/test_diagram.py::TestRailroadDiagrams::test_create_diagram_embed", "tests/test_diagram.py::TestRailroadDiagrams::test_create_diagram_for_oneormore_with_stopon", "test... | ["examples/test_bibparse.py::TestBibparse::test_bib1", "examples/test_bibparse.py::TestBibparse::test_bibfile", "examples/test_bibparse.py::TestBibparse::test_comments", "examples/test_bibparse.py::TestBibparse::test_entry", "examples/test_bibparse.py::TestBibparse::test_macro", "examples/test_bibparse.py::TestBibparse... | jyangballin/swesmith.x86_64.pyparsing_1776_pyparsing.533adf47 | true | null | 1 | 6 | 13 | 1,146 | 0 | 0.6 | 1 | 0.75 | 1 | 0.211 | 80.908 | |||
7,901 | swe_smith::train::43796 | swe_smith | train | 43,796 | pydata__patsy.a5d16484.combine_file__ike4i353 | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | demo_data function raises ValueError when no keyword arguments provided
#### Description
The `demo_data` function incorrectly raises a `ValueError` when called without any keyword arguments, even though this should be valid usage.
#### Steps/Code to Reproduce
```python
from patsy.user_util import demo_data
# This ... | diff --git a/patsy/user_util.py b/patsy/user_util.py
index 080af84..abbba29 100644
--- a/patsy/user_util.py
+++ b/patsy/user_util.py
@@ -126,24 +126,24 @@ def demo_data(*names, **kwargs):
"""
nlevels = kwargs.pop("nlevels", 2)
min_rows = kwargs.pop("min_rows", 5)
- if kwargs:
- raise TypeError(... | ["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 | 22 | 13 | 825 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210833 | 80.9075 | |||
7,902 | swe_smith::train::19356 | swe_smith | train | 19,356 | seperman__deepdiff.ed252022.func_pm_remove_cond__kx0vjwm3 | swesmith/seperman__deepdiff.ed252022 | seperman/deepdiff | python | null | stringify_element function returns undefined variable
#### Description
The `stringify_element` function in `deepdiff/path.py` is returning an undefined variable `result`, causing NameError exceptions throughout the codebase when path stringification is attempted.
#### Steps/Code to Reproduce
```python
from deepdiff... | diff --git a/deepdiff/path.py b/deepdiff/path.py
index ee63b5b..de69632 100644
--- a/deepdiff/path.py
+++ b/deepdiff/path.py
@@ -271,22 +271,8 @@ def parse_path(path, root_element=DEFAULT_FIRST_ELEMENT, include_actions=False):
def stringify_element(param, quote_str=None):
has_quote = "'" in param
has_double_... | ["tests/test_cache.py::TestCache::test_cache_deeply_nested_b", "tests/test_command.py::TestCommands::test_diff_command[t1.toml-t2.toml-10.0.0.2-0]", "tests/test_command.py::TestCommands::test_deeppatch_command[t1.json-t2.json-args0-0]", "tests/test_command.py::TestCommands::test_deeppatch_command[t1.json-t2_json.csv-ar... | ["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 | 14 | 191 | 985 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210833 | 80.9075 | |||
7,903 | swe_smith::train::38969 | swe_smith | train | 38,969 | pallets__jinja.ada0a9a6.func_basic__c512s5qy | swesmith/pallets__jinja.ada0a9a6 | pallets/jinja | python | null | auto_aiter function incorrectly prioritizes __iter__ over __aiter__
#### Description
The `auto_aiter` function in `async_utils.py` has incorrect logic for determining whether to use async or sync iteration. It currently checks for `__iter__` first and falls back to `__aiter__`, but this is backwards - it should prior... | diff --git a/src/jinja2/async_utils.py b/src/jinja2/async_utils.py
index f0c1402..13c8b68 100644
--- a/src/jinja2/async_utils.py
+++ b/src/jinja2/async_utils.py
@@ -87,10 +87,10 @@ class _IteratorToAsyncIterator(t.Generic[V]):
def auto_aiter(
iterable: "t.Union[t.AsyncIterable[V], t.Iterable[V]]",
) -> "t.AsyncI... | ["tests/test_async.py::TestAsyncForLoop::test_noniter"] | ["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 | 6 | 1 | 1,144 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,904 | swe_smith::train::29864 | swe_smith | train | 29,864 | getnikola__nikola.0f4c230e.func_pm_ctrl_shuffle__28wgbgb4 | swesmith/getnikola__nikola.0f4c230e | getnikola/nikola | python | null | `nikola check` command fails with NameError due to variable reference before assignment
#### Description
The `nikola check` command is broken and raises a `NameError` when trying to scan files. The issue appears to be in the `real_scan_files` function where variables are being referenced before they are defined.
###... | diff --git a/nikola/plugins/command/check.py b/nikola/plugins/command/check.py
index 3f61dd2..61fa25f 100644
--- a/nikola/plugins/command/check.py
+++ b/nikola/plugins/command/check.py
@@ -62,27 +62,26 @@ def _call_nikola_list(site, cache=None):
def real_scan_files(site, cache=None):
- """Scan for files."""
... | ["tests/integration/test_archive_full.py::test_check_files", "tests/integration/test_archive_per_day.py::test_check_files", "tests/integration/test_archive_per_month.py::test_check_files", "tests/integration/test_building_in_subdir.py::test_check_files", "tests/integration/test_category_destpath.py::test_check_files", ... | ["tests/integration/test_archive_full.py::test_avoid_double_slash_in_rss", "tests/integration/test_archive_full.py::test_check_links", "tests/integration/test_archive_full.py::test_index_in_sitemap", "tests/integration/test_archive_full.py::test_full_archive[overall]", "tests/integration/test_archive_full.py::test_full... | jyangballin/swesmith.x86_64.getnikola_1776_nikola.0f4c230e | true | null | 1 | 19 | 20 | 884 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,905 | swe_smith::train::24840 | swe_smith | train | 24,840 | marshmallow-code__marshmallow.9716fc62.func_pm_ctrl_invert_if__os4nm98e | swesmith/marshmallow-code__marshmallow.9716fc62 | marshmallow-code/marshmallow | python | null | Schema.load with many=True fails when data is not a collection
#### Description
When using `Schema.load()` with `many=True` and passing non-collection data, the method attempts to iterate over the data instead of properly handling the type error. This causes a `TypeError` instead of the expected `ValidationError`.
#... | diff --git a/src/marshmallow/schema.py b/src/marshmallow/schema.py
index e21768e..eb9e135 100644
--- a/src/marshmallow/schema.py
+++ b/src/marshmallow/schema.py
@@ -607,9 +607,6 @@ class Schema(base.SchemaABC, metaclass=SchemaMeta):
index = index if index_errors else None
if many:
if not ... | ["tests/test_decorators.py::test_decorated_processors[True]", "tests/test_decorators.py::test_decorated_processors[False]", "tests/test_decorators.py::TestPassOriginal::test_pass_original_many", "tests/test_decorators.py::TestValidatesDecorator::test_validates_decorator", "tests/test_decorators.py::TestValidatesDecorat... | ["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_decorated_processor_returning_none[raise]", "tests/test_decorators.py::TestPassOriginal::test_pass_original_single", "tests/test_de... | jyangballin/swesmith.x86_64.marshmallow-code_1776_marshmallow.9716fc62 | true | null | 1 | 7 | 47 | 1,124 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,906 | swe_smith::train::4898 | swe_smith | train | 4,898 | bottlepy__bottle.a8dfef30.func_basic__yw3kz2fq | swesmith/bottlepy__bottle.a8dfef30 | bottlepy/bottle | python | null | Template initialization fails when source is provided with name parameter
#### Description
When creating a template with both source content and a name parameter, the template initialization fails unexpectedly. This affects basic template creation scenarios where you want to provide template content directly while al... | diff --git a/bottle.py b/bottle.py
index 286b5bc..f97ddf0 100755
--- a/bottle.py
+++ b/bottle.py
@@ -4056,14 +4056,14 @@ class BaseTemplate(object):
self.source = source.read() if hasattr(source, 'read') else source
self.filename = source.filename if hasattr(source, 'filename') else None
self... | ["test/test_auth.py::TestBasicAuth::test__header", "test/test_exc.py::TestAppException::test_noncatched_error", "test/test_exc.py::TestAppException::test_other_error", "test/test_jinja2.py::TestJinja2Template::test_custom_filters", "test/test_jinja2.py::TestJinja2Template::test_custom_tests", "test/test_jinja2.py::Test... | ["test/test_app.py::TestApplicationObject::test_setattr", "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", "test/test_config.py::TestConfDict::test_meta", ... | jyangballin/swesmith.x86_64.bottlepy_1776_bottle.a8dfef30 | true | null | 1 | 6 | 79 | 1,144 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,907 | swe_smith::train::39749 | swe_smith | train | 39,749 | tornadoweb__tornado.d5ac65c1.func_pm_ctrl_invert_if__hxj72t0d | swesmith/tornadoweb__tornado.d5ac65c1 | tornadoweb/tornado | python | null | # pgettext() fails with AssertionError when plural_message is None
## Description
When using `pgettext()` with a context and message but without a plural form, it fails with an AssertionError.
## Steps to reproduce
```python
from tornado.locale import Locale
locale = Locale.get("fr_FR")
locale.pgettext("law", "rig... | diff --git a/tornado/locale.py b/tornado/locale.py
index abd8668..5f896d8 100644
--- a/tornado/locale.py
+++ b/tornado/locale.py
@@ -567,6 +567,13 @@ class GettextLocale(Locale):
.. versionadded:: 4.2
"""
if plural_message is not None:
+ msg_with_ctxt = f"{context}{CONTEXT_SEPARATO... | ["test_gettext (tornado.test.locale_test.TranslationLoaderTest)"] | ["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 | 16 | 1 | 944 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,908 | swe_smith::train::48469 | swe_smith | train | 48,469 | sqlfluff__sqlfluff.50a1c4b6.func_pm_remove_cond__k064pd70 | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | Config validation crashes with KeyError when accessing removed config keys
#### Description
When processing configuration files, the config validation function crashes with a KeyError when trying to access keys from the removed_config dictionary. This happens because the code attempts to access `removed_config[key]` ... | diff --git a/src/sqlfluff/core/config/removed.py b/src/sqlfluff/core/config/removed.py
index 6043de4..e0b1bb5 100644
--- a/src/sqlfluff/core/config/removed.py
+++ b/src/sqlfluff/core/config/removed.py
@@ -190,9 +190,6 @@ def validate_config_dict_for_removed(
# Iterate through a copy of the config keys, so we can s... | ["test/core/config/fluffconfig_test.py::test__config__from_strings", "test/core/config/fluffconfig_test.py::test__config__nested_config_tests", "test/core/config/fluffconfig_test.py::test__config__templater_selection[raw-RawTemplater-False]", "test/core/config/fluffconfig_test.py::test__config__templater_selection[jinj... | ["test/core/config/loader_test.py::test__config__load_user_appdir_config"] | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 15 | 31 | 964 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,909 | swe_smith::train::44389 | swe_smith | train | 44,389 | pydata__patsy.a5d16484.func_pm_op_swap__nhup39h9 | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | BS spline error messages broken due to incorrect string formatting
#### Description
When using the `bs()` function with invalid parameters, error messages are not displayed correctly due to incorrect string formatting syntax.
#### Steps/Code to Reproduce
```python
import numpy as np
from patsy import bs
x = np.lin... | diff --git a/patsy/splines.py b/patsy/splines.py
index a6735e5..9389cfd 100644
--- a/patsy/splines.py
+++ b/patsy/splines.py
@@ -186,7 +186,7 @@ class BS(object):
"degree must be greater than 0 (not %r)" % (args["degree"],)
)
if int(args["degree"]) != args["degree"]:
- ... | ["patsy/splines.py::test_bs_errors"] | ["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 | 17 | 1 | 924 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210667 | 80.907 | |||
7,910 | swe_smith::train::11244 | swe_smith | train | 11,244 | rsalmei__alive-progress.35853799.func_basic__xorckj9a | swesmith/rsalmei__alive-progress.35853799 | rsalmei/alive-progress | python | null | Progress bar header template logic inverted causing TypeError
#### Description
When using alive-progress with header templates, the logic for determining when to use the header function versus the null header function appears to be inverted. This causes a TypeError when the header template is None but the code tries ... | diff --git a/alive_progress/core/hook_manager.py b/alive_progress/core/hook_manager.py
index 5b43fff..b58f29f 100644
--- a/alive_progress/core/hook_manager.py
+++ b/alive_progress/core/hook_manager.py
@@ -157,9 +157,9 @@ def __noop(): # pragma: no cover
def gen_header(header_template, get_pos, offset): # pragma: n... | ["tests/core/test_hook_manager.py::test_hook_manager_captures_stdout[print_data0]", "tests/core/test_hook_manager.py::test_hook_manager_captures_stdout[print_data1]", "tests/core/test_hook_manager.py::test_hook_manager_captures_stdout[print_data2]", "tests/core/test_hook_manager.py::test_hook_manager_captures_stdout[pr... | ["tests/animations/test_bars.py::test_bar_tip_background[--0.5-False-|0123456789|]", "tests/animations/test_bars.py::test_bar_tip_background[=--0.5-False-|0123456789|]", "tests/animations/test_bars.py::test_bar_tip_background[_-=--0.5-False-|0123456789|]", "tests/animations/test_bars.py::test_bar_tip_background[-0.0-Fa... | jyangballin/swesmith.x86_64.rsalmei_1776_alive-progress.35853799 | true | null | 1 | 6 | 23 | 1,143 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2105 | 80.9065 | |||
7,911 | swe_smith::train::19450 | swe_smith | train | 19,450 | seperman__deepdiff.ed252022.func_pm_remove_wrapper__qfpl4z3u | swesmith/seperman__deepdiff.ed252022 | seperman/deepdiff | python | null | DeepHash fails to handle byte strings with encoding errors
#### Description
When using DeepHash with byte strings that contain invalid UTF-8 sequences, the library crashes with an AttributeError instead of properly handling the encoding error. This happens because the encoding error handling logic was broken.
#### S... | diff --git a/deepdiff/deephash.py b/deepdiff/deephash.py
index 1f293bd..9b82705 100644
--- a/deepdiff/deephash.py
+++ b/deepdiff/deephash.py
@@ -99,12 +99,7 @@ def prepare_string_for_hashing(
encodings = ['utf-8'] if encodings is None else encodings
encoded = False
for encoding in encodings:
... | ["tests/test_hash.py::TestDeepHash::test_built_in_hash_not_sensitive_to_bytecode_vs_unicode", "tests/test_hash.py::TestDeepHash::test_sha1_hash_not_sensitive_to_bytecode_vs_unicode", "tests/test_hash.py::TestDeepHashPrep::test_dictionary_key_type_change", "tests/test_hash.py::TestDeepHashSHA::test_bytecode", "tests/tes... | ["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 | 8 | 9 | 1,103 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2105 | 80.9065 | |||
7,912 | swe_smith::train::14534 | swe_smith | train | 14,534 | hukkin__tomli.443a0c1b.func_basic__kx6q5sew | swesmith/hukkin__tomli.443a0c1b | hukkin/tomli | python | null | TOML parser fails to parse valid files and produces incorrect error messages
#### Description
The TOML parser is incorrectly rejecting valid TOML files and producing confusing error messages. When parsing valid TOML content, the parser raises `TOMLDecodeError` with "Unexpected end of file" even when the file is prope... | diff --git a/src/tomli/_parser.py b/src/tomli/_parser.py
index 16c76cd..d787f4f 100644
--- a/src/tomli/_parser.py
+++ b/src/tomli/_parser.py
@@ -313,17 +313,17 @@ def skip_until(
error_on_eof: bool,
) -> Pos:
try:
- new_pos = src.index(expect, pos)
+ new_pos = src.index(expect, pos + 1)
ex... | ["tests/test_data.py::TestData::test_invalid", "tests/test_data.py::TestData::test_valid", "tests/test_error.py::TestError::test_invalid_char_quotes", "tests/test_misc.py::TestMiscellaneous::test_load"] | ["tests/test_error.py::TestError::test_deprecated_tomldecodeerror", "tests/test_error.py::TestError::test_invalid_parse_float", "tests/test_error.py::TestError::test_line_and_col", "tests/test_error.py::TestError::test_missing_value", "tests/test_error.py::TestError::test_module_name", "tests/test_error.py::TestError::... | jyangballin/swesmith.x86_64.hukkin_1776_tomli.443a0c1b | true | null | 1 | 12 | 4 | 1,023 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2105 | 80.9065 | |||
7,913 | swe_smith::train::37836 | swe_smith | train | 37,836 | kayak__pypika.1c9646f0.func_basic__w1s47eoh | swesmith/kayak__pypika.1c9646f0 | kayak/pypika | python | null | Table.for_portion method incorrectly validates and assigns attributes
#### Description
The `for_portion` method on Table objects has incorrect logic that prevents it from working properly. When trying to use `for_portion` with temporal queries, it raises an AttributeError even when it should be allowed.
#### Steps/C... | diff --git a/pypika/queries.py b/pypika/queries.py
index 42c7c45..9d98d4c 100644
--- a/pypika/queries.py
+++ b/pypika/queries.py
@@ -171,11 +171,11 @@ class Table(Selectable):
@builder
def for_portion(self, period_criterion: PeriodCriterion) -> "Table":
- if self._for_portion:
+ if not self._f... | ["pypika/tests/test_deletes.py::DeleteTests::test_for_portion", "pypika/tests/test_updates.py::UpdateTests::test_for_portion"] | ["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 | 6 | 2 | 1,142 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210333 | 80.906 | |||
7,914 | swe_smith::train::55551 | swe_smith | train | 55,551 | RoaringBitmap__roaring.09c46a0a.func_pm_flip_operators__s1rfx8nk | swesmith/RoaringBitmap__roaring.09c46a0a | roaringbitmap/roaring | go | null | Bitmap.Intersects panics with index out of range when checking intersection
Description
The `Intersects` method in roaring64 package panics with "index out of range" error when checking if two bitmaps intersect. This appears to happen when one bitmap has fewer containers than expected during the intersection check.
... | diff --git a/roaring64/roaring64.go b/roaring64/roaring64.go
index 8ce7f4f..86cf8c1 100644
--- a/roaring64/roaring64.go
+++ b/roaring64/roaring64.go
@@ -592,7 +592,7 @@ func (rb *Bitmap) Intersects(x2 *Bitmap) bool {
main:
for {
- if pos1 < length1 && pos2 < length2 {
+ if pos1 < length1 || pos2 < length2 {
... | ["TestRoaringIntervalCheck"] | ["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 | 8 | 1 | 1,102 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210333 | 80.906 | |||
7,915 | swe_smith::train::27890 | swe_smith | train | 27,890 | jsvine__pdfplumber.02ff4313.func_pm_ctrl_shuffle__nda8k2g2 | swesmith/jsvine__pdfplumber.02ff4313 | jsvine/pdfplumber | python | null | UnboundLocalError in validate_directions function when char_dir validation fails
#### Description
When calling text extraction functions with invalid `char_dir` parameters, an `UnboundLocalError` is raised instead of the expected `ValueError`. The error occurs because the `valid_dirs` variable is referenced before be... | diff --git a/pdfplumber/utils/text.py b/pdfplumber/utils/text.py
index 8edafa1..9c80f97 100644
--- a/pdfplumber/utils/text.py
+++ b/pdfplumber/utils/text.py
@@ -76,11 +76,6 @@ POSITION_KEYS = {
def validate_directions(line_dir: T_dir, char_dir: T_dir, suffix: str = "") -> None:
- valid_dirs = set(POSITION_KEYS.... | ["tests/test_basics.py::Test::test_outside_bbox", "tests/test_basics.py::Test::test_unicode_normalization", "tests/test_ca_warn_report.py::Test::test_parse", "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_table", "tests... | ["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 | 11 | 58 | 1,041 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210167 | 80.9055 | |||
7,916 | swe_smith::train::13899 | swe_smith | train | 13,899 | python-openxml__python-docx.0cf6d71f.func_basic__rar4v55z | swesmith/python-openxml__python-docx.0cf6d71f | python-openxml/python-docx | python | null | LatentStyles dictionary access returns KeyError instead of LatentStyle object
#### Description
When accessing latent styles by name using dictionary-style syntax, the method returns a KeyError object instead of the expected _LatentStyle object, and raises _LatentStyle when it should raise KeyError.
#### Steps/Code t... | diff --git a/src/docx/styles/latent.py b/src/docx/styles/latent.py
index c9db62f..4925e87 100644
--- a/src/docx/styles/latent.py
+++ b/src/docx/styles/latent.py
@@ -12,10 +12,10 @@ class LatentStyles(ElementProxy):
def __getitem__(self, key):
"""Enables dictionary-style access to a latent style by name.""... | ["tests/styles/test_latent.py::DescribeLatentStyles::it_can_get_a_latent_style_by_name[getitem_fixture0]", "tests/styles/test_latent.py::DescribeLatentStyles::it_can_get_a_latent_style_by_name[getitem_fixture1]", "tests/styles/test_latent.py::DescribeLatentStyles::it_can_get_a_latent_style_by_name[getitem_fixture2]", "... | ["tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture0]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture1]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture2]", "tests/dml/test_color.py::DescribeColorFormat::it_knows... | jyangballin/swesmith.x86_64.python-openxml_1776_python-docx.0cf6d71f | true | null | 1 | 8 | 5 | 1,101 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210167 | 80.9055 | |||
7,917 | swe_smith::train::17104 | swe_smith | train | 17,104 | prettytable__prettytable.ca90b055.func_basic__qma5ebgc | swesmith/prettytable__prettytable.ca90b055 | prettytable/prettytable | python | null | # VRuleStyle validation is inverted
When setting vertical rule styles in PrettyTable, the validation logic is inverted, causing valid VRuleStyle values to be rejected and invalid values to be accepted.
## Reproduction
Here's a simple example that demonstrates the issue:
```python
from prettytable import PrettyTable... | diff --git a/src/prettytable/prettytable.py b/src/prettytable/prettytable.py
index 818a520..72958b1 100644
--- a/src/prettytable/prettytable.py
+++ b/src/prettytable/prettytable.py
@@ -673,10 +673,10 @@ class PrettyTable:
def _validate_vrules(self, name, val):
try:
- assert val in list(VRuleS... | ["tests/test_prettytable.py::TestPositionalJunctions::test_vrules_none", "tests/test_prettytable.py::TestPositionalJunctions::test_vrules_frame_with_title", "tests/test_prettytable.py::TestLatexOutput::test_latex_output_formatted", "tests/test_prettytable.py::TestMaxTableWidth::test_max_table_width_wide_vrules_frame", ... | ["tests/test_colortable.py::TestColorTable::test_themeless", "tests/test_colortable.py::TestColorTable::test_theme_setter", "tests/test_colortable.py::TestFormatCode::test_basic", "tests/test_colortable.py::TestFormatCode::test_prefix", "tests/test_colortable.py::TestFormatCode::test_escapes", "tests/test_colortable.py... | jyangballin/swesmith.x86_64.prettytable_1776_prettytable.ca90b055 | true | null | 1 | 6 | 5 | 1,141 | 0 | 0.6 | 1 | 0.75 | 1 | 0.210167 | 80.9055 | |||
7,918 | swe_smith::train::14149 | swe_smith | train | 14,149 | python-openxml__python-docx.0cf6d71f.func_pm_class_rm_funcs__4uigqgap | swesmith/python-openxml__python-docx.0cf6d71f | python-openxml/python-docx | python | null | JPEG images with EXIF data fail to load
#### Description
When trying to load JPEG images that contain EXIF metadata, the image processing fails with a KeyError. This affects images that have APP1 markers containing EXIF information.
#### Steps/Code to Reproduce
```python
from docx import Document
from docx.shared i... | diff --git a/src/docx/image/jpeg.py b/src/docx/image/jpeg.py
index b0114a9..672285b 100644
--- a/src/docx/image/jpeg.py
+++ b/src/docx/image/jpeg.py
@@ -108,14 +108,6 @@ class _JfifMarkers:
return m
raise KeyError("no APP0 marker in image")
- @property
- def app1(self):
- """Fir... | ["tests/image/test_image.py::Describe_ImageHeaderFactory::it_constructs_the_right_class_for_a_given_image_stream[call_fixture2]", "tests/image/test_jpeg.py::Describe_JfifMarkers::it_can_find_the_APP1_marker", "tests/image/test_jpeg.py::Describe_JfifMarkers::it_raises_if_it_cant_find_the_APP1_marker"] | ["tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture0]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture1]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture2]", "tests/dml/test_color.py::DescribeColorFormat::it_knows... | jyangballin/swesmith.x86_64.python-openxml_1776_python-docx.0cf6d71f | true | null | 1 | 9 | 3 | 1,080 | 0 | 0.6 | 1 | 0.75 | 1 | 0.21 | 80.905 | |||
7,919 | swe_smith::train::31571 | swe_smith | train | 31,571 | benoitc__gunicorn.bacbf8aa.func_basic__v65een58 | swesmith/benoitc__gunicorn.bacbf8aa | benoitc/gunicorn | python | null | Logger class returns None when statsd is configured
#### Description
When configuring gunicorn with a statsd host, the logger class property returns None instead of the expected Statsd logger class. This breaks logging functionality and causes various operations to fail.
#### Steps/Code to Reproduce
```python
from ... | diff --git a/gunicorn/config.py b/gunicorn/config.py
index 402a26b..3fa4e3a 100644
--- a/gunicorn/config.py
+++ b/gunicorn/config.py
@@ -153,11 +153,10 @@ class Config:
# support the default
uri = LoggerClass.default
- # if default logger is in use, and statsd is on, automagically swi... | ["tests/test_arbiter.py::test_arbiter_stop_closes_listeners", "tests/test_arbiter.py::test_arbiter_stop_child_does_not_unlink_listeners", "tests/test_arbiter.py::test_arbiter_stop_parent_does_not_unlink_listeners", "tests/test_arbiter.py::test_arbiter_stop_does_not_unlink_systemd_listeners", "tests/test_arbiter.py::tes... | ["tests/test_config.py::test_worker_class", "tests/test_config.py::test_defaults", "tests/test_config.py::test_bool_validation", "tests/test_config.py::test_pos_int_validation", "tests/test_config.py::test_str_validation", "tests/test_config.py::test_str_to_addr_list_validation", "tests/test_config.py::test_str_to_list... | jyangballin/swesmith.x86_64.benoitc_1776_gunicorn.bacbf8aa | true | null | 1 | 9 | 15 | 1,080 | 0 | 0.6 | 1 | 0.75 | 1 | 0.21 | 80.905 | |||
7,920 | swe_smith::train::10252 | swe_smith | train | 10,252 | paramiko__paramiko.23f92003.func_basic__1o9f1szr | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | PKey.from_private_key returns None instead of key instance
#### Description
When loading private keys using `PKey.from_private_key()`, the method returns `None` instead of the expected key instance. This affects all key types (RSA, DSA, ECDSA, Ed25519) and breaks key loading functionality.
#### Steps/Code to Reprodu... | diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index f0b2d6d..4bd52f0 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -453,8 +453,11 @@ class PKey:
if the private key file is encrypted, and ``password`` is ``None``
:raises: `.SSHException` -- if the key file is invalid
"""
- ... | ["tests/auth.py::AuthOnlyHandler_::fallback_pubkey_algorithm::key_type_algo_selection_is_cert_suffix_aware", "tests/auth.py::AuthSource_::InMemoryPrivateKey_::repr_shows_pkey_repr", "tests/auth.py::AuthSource_::InMemoryPrivateKey_::repr_appends_agent_flag_when_AgentKey", "tests/pkey.py::PKey_::from_path::loads_from_str... | ["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_::fields::defaults_to_get_name_and_blob", "tests/agent.py::AgentK... | jyangballin/swesmith.x86_64.paramiko_1776_paramiko.23f92003 | true | null | 1 | 7 | 13 | 1,120 | 0 | 0.6 | 1 | 0.75 | 1 | 0.21 | 80.905 | |||
7,921 | swe_smith::train::47806 | swe_smith | train | 47,806 | sqlfluff__sqlfluff.50a1c4b6.func_basic__a6lp4kxq | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | Parallel linting returns empty LintedFile instead of DelayedException on error
#### Description
When running the linter in parallel mode, exceptions that occur during file processing are not being properly handled. Instead of returning a `DelayedException` object that preserves the error information, the parallel wra... | diff --git a/src/sqlfluff/core/linter/runner.py b/src/sqlfluff/core/linter/runner.py
index 3ebe1db..da0e7a8 100644
--- a/src/sqlfluff/core/linter/runner.py
+++ b/src/sqlfluff/core/linter/runner.py
@@ -179,13 +179,11 @@ class ParallelRunner(BaseRunner):
) -> Union["DelayedException", LintedFile]:
"""Shim f... | ["test/core/linter/linter_test.py::test__linter__linting_result_get_violations[2]", "test/core/linter/linter_test.py::test__linter__linting_parallel_thread[False]", "test/core/linter/linter_test.py::test_lint_path_parallel_wrapper_exception"] | ["test/core/linter/discovery_test.py::test__linter__path_from_paths__dir", "test/core/linter/discovery_test.py::test__linter__path_from_paths__default", "test/core/linter/discovery_test.py::test__linter__path_from_paths__exts", "test/core/linter/discovery_test.py::test__linter__path_from_paths__file", "test/core/linter... | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 6 | 3 | 1,140 | 0 | 0.6 | 1 | 0.75 | 1 | 0.21 | 80.905 | |||
7,922 | swe_smith::train::31242 | swe_smith | train | 31,242 | scrapy__scrapy.35212ec5.func_pm_ctrl_shuffle__08esupl2 | swesmith/scrapy__scrapy.35212ec5 | scrapy/scrapy | python | null | ResponseTypes.from_body() raises UnboundLocalError for lowercase_chunk
#### Description
When using `ResponseTypes.from_body()` to detect response types from body content, an `UnboundLocalError` is raised because `lowercase_chunk` is referenced before being defined.
#### Steps/Code to Reproduce
```python
from scrapy... | diff --git a/scrapy/responsetypes.py b/scrapy/responsetypes.py
index 3f6f030..aea8750 100644
--- a/scrapy/responsetypes.py
+++ b/scrapy/responsetypes.py
@@ -104,23 +104,22 @@ class ResponseTypes:
return Response
def from_body(self, body: bytes) -> type[Response]:
+ if b"<html>" in lowercase_chunk... | ["tests/test_responsetypes.py::ResponseTypesTest::test_from_body"] | ["tests/test_responsetypes.py::ResponseTypesTest::test_custom_mime_types_loaded", "tests/test_responsetypes.py::ResponseTypesTest::test_from_args", "tests/test_responsetypes.py::ResponseTypesTest::test_from_content_disposition", "tests/test_responsetypes.py::ResponseTypesTest::test_from_content_type", "tests/test_respo... | jyangballin/swesmith.x86_64.scrapy_1776_scrapy.35212ec5 | true | null | 1 | 17 | 1 | 920 | 0 | 0.6 | 1 | 0.75 | 1 | 0.21 | 80.905 | |||
7,923 | swe_smith::train::17849 | swe_smith | train | 17,849 | pyasn1__pyasn1.0f07d724.func_pm_class_rm_funcs__bdx5usa7 | swesmith/pyasn1__pyasn1.0f07d724 | pyasn1/pyasn1 | python | null | RawPayloadDecoder missing valueDecoder method causes AttributeError
#### Description
After recent changes, the `RawPayloadDecoder` class is missing its `valueDecoder` method, which causes decoding operations to fail with an AttributeError when trying to decode certain ASN.1 structures.
#### Steps/Code to Reproduce
... | diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py
index 7e69ca1..6014c3b 100644
--- a/pyasn1/codec/ber/decoder.py
+++ b/pyasn1/codec/ber/decoder.py
@@ -85,21 +85,6 @@ class AbstractSimplePayloadDecoder(AbstractPayloadDecoder):
class RawPayloadDecoder(AbstractSimplePayloadDecoder):
protoCompon... | ["tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLargeTag", "tests/codec/ber/test_decoder.py::ExpTaggedOctetStringDecoderTestCase::testDefMode", "tests/codec/ber/test_decoder.py::ExpTaggedOctetStringDecoderTestCase::testDefModeChunked", "tests/codec/ber/test_decoder.py::ExpTaggedOctetStringDecoderTestCas... | ["tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLongTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testTagsEquivalence", "tests/codec/ber/test_decoder.py::DecoderCacheTestCase::testCache", "tests/codec/ber/test_decoder.py::IntegerDecoderTestCase::testMinusOne", "tests/codec/ber/test_de... | jyangballin/swesmith.x86_64.pyasn1_1776_pyasn1.0f07d724 | true | null | 1 | 16 | 13 | 940 | 0 | 0.6 | 1 | 0.75 | 1 | 0.21 | 80.905 | |||
7,924 | swe_smith::train::39928 | swe_smith | train | 39,928 | tornadoweb__tornado.d5ac65c1.func_pm_remove_wrapper__91xxm7i9 | swesmith/tornadoweb__tornado.d5ac65c1 | tornadoweb/tornado | python | null | Signed cookie decoding fails when secret is dict with key versioning
#### Description
When using key versioning for signed cookies with a dictionary of secrets, the `decode_signed_value` function crashes with a TypeError. The function attempts to pass the entire dictionary to the signature creation function instead o... | diff --git a/tornado/web.py b/tornado/web.py
index 357c5f1..464b2a9 100644
--- a/tornado/web.py
+++ b/tornado/web.py
@@ -3711,10 +3711,7 @@ def _decode_signed_value_v2(
signed_string = value[: -len(passed_sig)]
if isinstance(secret, dict):
- try:
- secret = secret[key_version]
- exc... | ["test_key_version_increment_version (tornado.test.web_test.SecureCookieV2Test)", "test_key_version_invalidate_version (tornado.test.web_test.SecureCookieV2Test)", "test_key_version_roundtrip (tornado.test.web_test.SecureCookieV2Test)", "test_key_version_roundtrip_differing_version (tornado.test.web_test.SecureCookieV2... | ["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 | 6 | 7 | 1,139 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,925 | swe_smith::train::7974 | swe_smith | train | 7,974 | cantools__cantools.0c6a7871.func_pm_ctrl_shuffle__jysu8tu6 | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | `invert_signal_tree` function returns None when called with empty tree
#### Description
The `invert_signal_tree` function in `cantools.tester` returns `None` instead of an empty dictionary when called with an empty tree list. This causes `AttributeError: 'NoneType' object has no attribute 'setdefault'` errors in down... | diff --git a/src/cantools/tester.py b/src/cantools/tester.py
index c2ad9f2..502de8d 100644
--- a/src/cantools/tester.py
+++ b/src/cantools/tester.py
@@ -44,12 +44,6 @@ def _invert_signal_tree(
"""
- if ret is None:
- ret = {}
-
- if cur_mpx is None:
- cur_mpx = {}
-
for sigs in tree:
... | ["tests/test_tester.py::CanToolsTesterTest::test_bad_message_name", "tests/test_tester.py::CanToolsTesterTest::test_enable_disable", "tests/test_tester.py::CanToolsTesterTest::test_expect", "tests/test_tester.py::CanToolsTesterTest::test_flush_input", "tests/test_tester.py::CanToolsTesterTest::test_on_message", "tests/... | ["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 | 13 | 9 | 999 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,926 | swe_smith::train::776 | swe_smith | train | 776 | oauthlib__oauthlib.1fd52536.func_pm_ctrl_shuffle__q2wjhdnn | swesmith/oauthlib__oauthlib.1fd52536 | oauthlib/oauthlib | python | null | OAuth2Error twotuples property returns incomplete error information
#### Description
The `twotuples` property in `OAuth2Error` class is not returning all error fields when an error URI is present. The method appears to return early before processing all the error attributes.
#### Steps/Code to Reproduce
```python
f... | diff --git a/oauthlib/oauth2/rfc6749/errors.py b/oauthlib/oauth2/rfc6749/errors.py
index 3b41574..38a51e6 100644
--- a/oauthlib/oauth2/rfc6749/errors.py
+++ b/oauthlib/oauth2/rfc6749/errors.py
@@ -76,15 +76,14 @@ class OAuth2Error(Exception):
@property
def twotuples(self):
+ if self.uri:
+ ... | ["tests/oauth2/rfc6749/endpoints/test_base_endpoint.py::BaseEndpointTest::test_error_catching", "tests/oauth2/rfc6749/endpoints/test_base_endpoint.py::BaseEndpointTest::test_unavailability", "tests/oauth2/rfc6749/endpoints/test_base_endpoint.py::BaseEndpointTest::test_wrapper", "tests/oauth2/rfc6749/endpoints/test_clie... | ["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 | 7 | 69 | 1,119 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,927 | swe_smith::train::9535 | swe_smith | train | 9,535 | marshmallow-code__webargs.dbde72fe.combine_module__6k40qgw4 | swesmith/marshmallow-code__webargs.dbde72fe | marshmallow-code/webargs | python | null | TornadoParser broken after recent changes
I'm getting unexpected behavior with the TornadoParser where JSON and form parsing is completely broken. When I try to parse JSON requests, I get raw request body bytes instead of parsed data, and form parsing throws errors about argument order.
#### Steps to Reproduce
```py... | diff --git a/src/webargs/testing.py b/src/webargs/testing.py
index 0d7bf0f..65a9118 100644
--- a/src/webargs/testing.py
+++ b/src/webargs/testing.py
@@ -97,9 +97,9 @@ class CommonTestCase:
def test_parse_json_many_schema_invalid_input(self, testapp):
res = testapp.post_json(
- "/echo_many_sch... | ["tests/test_aiohttpparser.py::TestAIOHTTPParser::test_parse_json_many_schema_invalid_input", "tests/test_bottleparser.py::TestBottleParser::test_parse_json_many_schema_invalid_input", "tests/test_djangoparser.py::TestDjangoParser::test_parse_json_many_schema_invalid_input", "tests/test_falconparser.py::TestFalconParse... | ["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 | 10 | 24 | 1,059 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,928 | swe_smith::train::17961 | swe_smith | train | 17,961 | pyasn1__pyasn1.0f07d724.func_pm_remove_assign__mlzdzwh8 | swesmith/pyasn1__pyasn1.0f07d724 | pyasn1/pyasn1 | python | null | BER decoder broken after recent changes - variables referenced before assignment
Description
The BER decoder is failing with `UnboundLocalError` when trying to decode ASN.1 structures. It looks like some variables are being referenced before they're assigned in the decoder logic.
Steps/Code to Reproduce
```python
f... | diff --git a/pyasn1/codec/ber/decoder.py b/pyasn1/codec/ber/decoder.py
index 7e69ca1..81a0c42 100644
--- a/pyasn1/codec/ber/decoder.py
+++ b/pyasn1/codec/ber/decoder.py
@@ -733,7 +733,6 @@ class ConstructedPayloadDecoderBase(AbstractConstructedPayloadDecoder):
namedTypes = asn1Spec.componentType
... | ["tests/codec/ber/test_decoder.py::SequenceDecoderWithSchemaTestCase::testDefMode", "tests/codec/ber/test_decoder.py::SequenceDecoderWithSchemaTestCase::testDefModeChunked", "tests/codec/ber/test_decoder.py::SequenceDecoderWithSchemaTestCase::testWithDefaultedDefMode", "tests/codec/ber/test_decoder.py::SequenceDecoderW... | ["tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLargeTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLongTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testTagsEquivalence", "tests/codec/ber/test_decoder.py::DecoderCacheTestCase::testCache", "tests/codec/ber/test_d... | jyangballin/swesmith.x86_64.pyasn1_1776_pyasn1.0f07d724 | true | null | 1 | 14 | 64 | 979 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,929 | swe_smith::train::17247 | swe_smith | train | 17,247 | aio-libs__async-timeout.d0baa9f1.combine_file__la9dmvt9 | swesmith/aio-libs__async-timeout.d0baa9f1 | aio-libs/async-timeout | python | null | ### Unexpected Behavior in Timeout Handling
I've encountered an issue with the `Timeout` context manager in the `async_timeout` module. After applying a recent change, the behavior of the timeout handling seems to have altered unexpectedly.
### Steps to Reproduce
Here's a minimal example to illustrate the problem:
... | diff --git a/async_timeout/__init__.py b/async_timeout/__init__.py
index fe4aa58..ada7f57 100644
--- a/async_timeout/__init__.py
+++ b/async_timeout/__init__.py
@@ -162,9 +162,9 @@ else:
self._task: Optional["asyncio.Task[object]"] = None
self._timeout_handler = None # type: Optional[asyncio.... | ["tests/test_timeout.py::test_timeout", "tests/test_timeout.py::test_timeout_finish_in_time", "tests/test_timeout.py::test_timeout_disable", "tests/test_timeout.py::test_timeout_is_none_no_schedule", "tests/test_timeout.py::test_timeout_zero", "tests/test_timeout.py::test_timeout_not_relevant_exception", "tests/test_ti... | ["tests/test_timeout.py::test_timeout_no_loop", "tests/test_timeout.py::test_cancel_outer_coro"] | jyangballin/swesmith.x86_64.aio-libs_1776_async-timeout.d0baa9f1 | true | null | 1 | 6 | 30 | 1,139 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,930 | swe_smith::train::43114 | swe_smith | train | 43,114 | gawel__pyquery.811cd048.func_basic__tlq371m2 | swesmith/gawel__pyquery.811cd048 | gawel/pyquery | python | null | `each()` method returns None instead of self after iteration
#### Description
The `each()` method is supposed to return the PyQuery object to allow method chaining, but it's currently returning `None` which breaks the fluent interface.
#### Steps/Code to Reproduce
```python
from pyquery import PyQuery as pq
# Crea... | diff --git a/pyquery/pyquery.py b/pyquery/pyquery.py
index 5b05681..569d1c3 100644
--- a/pyquery/pyquery.py
+++ b/pyquery/pyquery.py
@@ -697,13 +697,14 @@ class PyQuery(list):
try:
for i, element in enumerate(self):
func.__globals__['this'] = element
- if callback(f... | ["docs/manipulating.rst::manipulating.rst"] | ["README.rst::README.rst", "docs/attributes.rst::attributes.rst", "docs/css.rst::css.rst", "docs/pseudo_classes.rst::pseudo_classes.rst", "docs/scrap.rst::scrap.rst", "docs/tips.rst::tips.rst", "docs/traversing.rst::traversing.rst", "pyquery/cssselectpatch.py::pyquery.cssselectpatch.JQueryTranslator.xpath_button_pseudo... | jyangballin/swesmith.x86_64.gawel_1776_pyquery.811cd048 | true | null | 1 | 9 | 1 | 1,079 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,931 | swe_smith::train::2545 | swe_smith | train | 2,545 | pdfminer__pdfminer.six.1a8bd2f7.func_pm_remove_cond__hvral9cw | swesmith/pdfminer__pdfminer.six.1a8bd2f7 | pdfminer/pdfminer.six | python | null | dumppdf.py crashes with NameError: name 'outfp' is not defined
#### Description
The dumppdf.py tool is crashing with a NameError when trying to use the `outfp` variable. This happens because the variable initialization code was accidentally removed, but the code still tries to use `outfp` later in the function.
####... | diff --git a/tools/dumppdf.py b/tools/dumppdf.py
index f88389a..d604bd3 100755
--- a/tools/dumppdf.py
+++ b/tools/dumppdf.py
@@ -415,14 +415,6 @@ def main(argv: Optional[List[str]] = None) -> None:
parser = create_parser()
args = parser.parse_args(args=argv)
- if args.debug:
- logging.getLogger().... | ["tests/test_tools_dumppdf.py::TestDumpPDF::test_2", "tests/test_tools_dumppdf.py::TestDumpPDF::test_3", "tests/test_tools_dumppdf.py::TestDumpPDF::test_4", "tests/test_tools_dumppdf.py::TestDumpPDF::test_5", "tests/test_tools_dumppdf.py::TestDumpPDF::test_6", "tests/test_tools_dumppdf.py::TestDumpPDF::test_jo", "tests... | ["tests/test_converter.py::TestPaintPath::test_paint_path", "tests/test_converter.py::TestPaintPath::test_paint_path_mlllh", "tests/test_converter.py::TestPaintPath::test_paint_path_multiple_mlllh", "tests/test_converter.py::TestPaintPath::test_paint_path_quadrilaterals", "tests/test_converter.py::TestPaintPath::test_p... | jyangballin/swesmith.x86_64.pdfminer_1776_pdfminer.six.1a8bd2f7 | true | null | 1 | 13 | 11 | 999 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209833 | 80.9045 | |||
7,932 | swe_smith::train::7978 | swe_smith | train | 7,978 | cantools__cantools.0c6a7871.func_pm_ctrl_shuffle__p6ivgxa5 | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | KCD multiplex loading fails with UnboundLocalError
#### Description
When loading KCD files containing multiplex signals, the parser fails with `UnboundLocalError: local variable 'mux_signal' referenced before assignment`. This affects any KCD file that uses multiplexed signals.
#### Steps/Code to Reproduce
```pytho... | diff --git a/src/cantools/database/can/formats/kcd.py b/src/cantools/database/can/formats/kcd.py
index a54c86c..c253732 100644
--- a/src/cantools/database/can/formats/kcd.py
+++ b/src/cantools/database/can/formats/kcd.py
@@ -147,13 +147,15 @@ def _load_signal_element(signal, nodes):
def _load_multiplex_element(mux... | ["tests/test_database.py::CanToolsDatabaseTest::test_as_kcd_string", "tests/test_database.py::CanToolsDatabaseTest::test_get_bus_by_name", "tests/test_database.py::CanToolsDatabaseTest::test_get_node_by_name", "tests/test_database.py::CanToolsDatabaseTest::test_load_file_with_database_format", "tests/test_database.py::... | ["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 | 9 | 13 | 1,078 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,933 | swe_smith::train::11676 | swe_smith | train | 11,676 | andialbrecht__sqlparse.e57923b3.func_basic__2z5qpz31 | swesmith/andialbrecht__sqlparse.e57923b3 | andialbrecht/sqlparse | python | null | parsestream function broken after recent changes
#### Description
The `parsestream` function is not working correctly and throws AttributeError when trying to parse SQL from a stream. This affects any code that uses `sqlparse.parsestream()` to parse SQL from file-like objects.
#### Steps/Code to Reproduce
```python... | diff --git a/sqlparse/__init__.py b/sqlparse/__init__.py
index 23507b7..9b99210 100644
--- a/sqlparse/__init__.py
+++ b/sqlparse/__init__.py
@@ -38,8 +38,10 @@ def parsestream(stream, encoding=None):
:returns: A generator of :class:`~sqlparse.sql.Statement` instances.
"""
stack = engine.FilterStack()
- ... | ["tests/test_grouping.py::test_grouping_parenthesis", "tests/test_grouping.py::test_grouping_identifiers", "tests/test_grouping.py::test_grouping_identifier_wildcard", "tests/test_grouping.py::test_grouping_identifier_name_wildcard", "tests/test_grouping.py::test_grouping_identifier_invalid", "tests/test_grouping.py::t... | ["tests/test_cli.py::test_cli_main_empty", "tests/test_cli.py::test_parser_empty", "tests/test_cli.py::test_main_help", "tests/test_cli.py::test_valid_args", "tests/test_cli.py::test_invalid_choice", "tests/test_cli.py::test_invalid_args", "tests/test_cli.py::test_invalid_infile", "tests/test_cli.py::test_invalid_outfi... | jyangballin/swesmith.x86_64.andialbrecht_1776_sqlparse.e57923b3 | true | null | 1 | 6 | 197 | 1,138 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,934 | swe_smith::train::8998 | swe_smith | train | 8,998 | pyupio__safety.7654596b.func_pm_remove_cond__xrjlmrse | swesmith/pyupio__safety.7654596b | pyupio/safety | python | null | Scan command crashes with KeyError when detecting ecosystems
#### Description
When running the scan command, the application crashes with a KeyError when trying to detect and display ecosystem information. The error occurs during the ecosystem detection phase where the code attempts to access a dictionary key that do... | diff --git a/safety/scan/render.py b/safety/scan/render.py
index a44a51e..e9f738a 100644
--- a/safety/scan/render.py
+++ b/safety/scan/render.py
@@ -96,8 +96,6 @@ def print_detected_ecosystems_section(console: Console, file_paths: Dict[str, Se
for file_type_key, f_paths in file_paths.items():
file_type = ... | ["tests/test_cli.py::TestSafetyCLI::test_debug_flag"] | ["tests/test_cli.py::TestSafetyCLI::test_announcements_if_is_not_tty", "tests/test_cli.py::TestSafetyCLI::test_basic_html_output_pass", "tests/test_cli.py::TestSafetyCLI::test_check_continue_on_error", "tests/test_cli.py::TestSafetyCLI::test_check_ignore_format_backward_compatible", "tests/test_cli.py::TestSafetyCLI::t... | jyangballin/swesmith.x86_64.pyupio_1776_safety.7654596b | true | null | 1 | 10 | 1 | 1,058 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,935 | swe_smith::train::23385 | swe_smith | train | 23,385 | pyparsing__pyparsing.533adf47.combine_file__f4f4axg1 | swesmith/pyparsing__pyparsing.533adf47 | pyparsing/pyparsing | python | null | ParseBaseException constructor arguments in wrong order
#### Description
When creating ParseBaseException instances, the constructor arguments are being passed in the wrong order, causing issues with exception handling and error reporting.
#### Steps/Code to Reproduce
```python
import pyparsing as pp
# Simple exam... | diff --git a/pyparsing/exceptions.py b/pyparsing/exceptions.py
index 57a1579..d7ccb11 100644
--- a/pyparsing/exceptions.py
+++ b/pyparsing/exceptions.py
@@ -54,13 +54,13 @@ class ParseBaseException(Exception):
elem=None,
):
if msg is None:
- msg, pstr = pstr, ""
+ pstr, msg ... | ["tests/test_examples.py::TestExamples::test_lucene_grammar", "tests/test_examples.py::TestExamples::test_range_check", "tests/test_examples.py::TestExamples::test_roman_numerals", "tests/test_examples.py::TestExamples::test_sexp_parser", "tests/test_simple_unit.py::TestLiteral::runTest", "tests/test_simple_unit.py::Te... | ["examples/test_bibparse.py::TestBibparse::test_bib1", "examples/test_bibparse.py::TestBibparse::test_bibfile", "examples/test_bibparse.py::TestBibparse::test_comments", "examples/test_bibparse.py::TestBibparse::test_entry", "examples/test_bibparse.py::TestBibparse::test_macro", "examples/test_bibparse.py::TestBibparse... | jyangballin/swesmith.x86_64.pyparsing_1776_pyparsing.533adf47 | true | null | 1 | 13 | 168 | 998 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,936 | swe_smith::train::22244 | swe_smith | train | 22,244 | tweepy__tweepy.91a41c6e.combine_file__g7fnac24 | swesmith/tweepy__tweepy.91a41c6e | tweepy/tweepy | python | null | Cursor Iteration Fails with AttributeError
It seems like there's an issue with the cursor iteration in the latest update. When trying to iterate over items or pages using the cursor, an `AttributeError` is raised. This happens when attempting to access the `method` attribute, which appears to be incorrectly set.
Here... | diff --git a/tweepy/cursor.py b/tweepy/cursor.py
index 1db73e1..5bd3fe8 100644
--- a/tweepy/cursor.py
+++ b/tweepy/cursor.py
@@ -77,10 +77,10 @@ class Cursor:
class BaseIterator:
def __init__(self, method, *args, **kwargs):
- self.method = method
- self.args = args
- self.kwargs = kwargs
- ... | ["tests/test_cursors.py::TweepyCursorTests::testcursorcursoritems", "tests/test_cursors.py::TweepyCursorTests::testcursorcursorpages", "tests/test_cursors.py::TweepyCursorTests::testcursornext", "tests/test_cursors.py::TweepyCursorTests::testcursorsetstartcursor", "tests/test_cursors.py::TweepyCursorTests::testidcursor... | ["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 | 14 | 6 | 978 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,937 | swe_smith::train::6946 | swe_smith | train | 6,946 | cantools__cantools.0c6a7871.combine_file__50pf4pnz | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | SnakeOilAuthenticator fails with TypeError when secret is string
Description
When using SnakeOilAuthenticator with a string secret, the authenticator fails with a TypeError during XOR operations. The error occurs because the code attempts to XOR an integer with a string.
Steps/Code to Reproduce
```python
import can... | diff --git a/src/cantools/autosar/snakeauth.py b/src/cantools/autosar/snakeauth.py
index bcb1cfd..7238514 100644
--- a/src/cantools/autosar/snakeauth.py
+++ b/src/cantools/autosar/snakeauth.py
@@ -15,10 +15,10 @@ class SnakeOilAuthenticator:
"""
def __init__(self,
secret: Union[bytes, str]) ... | ["tests/test_autosar.py::CanToolsAutosarTest::test_autosar4_secoc"] | ["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_command_line.py::CanToolsCommandLineTest::test_convert", "tests/test_command_line.py::CanTools... | jyangballin/swesmith.x86_64.cantools_1776_cantools.0c6a7871 | true | null | 1 | 12 | 1 | 1,018 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,938 | swe_smith::train::46604 | swe_smith | train | 46,604 | python-trio__trio.cfbbe2c1.combine_file__d8z8sqds | swesmith/python-trio__trio.cfbbe2c1 | python-trio/trio | python | null | SSLStream initialization broken after recent changes
#### Description
After some recent changes, SSLStream objects are failing to initialize properly. The `_Once` helper class seems to have incorrect initial state values that prevent SSL connections from working.
#### Steps/Code to Reproduce
```python
import trio
i... | diff --git a/src/trio/_ssl.py b/src/trio/_ssl.py
index 0a0419f..dba55d5 100644
--- a/src/trio/_ssl.py
+++ b/src/trio/_ssl.py
@@ -232,8 +232,8 @@ class _Once:
) -> None:
self._afn = afn
self._args = args
- self.started = False
- self._done = _sync.Event()
+ self.started = True... | ["src/trio/_tests/test_highlevel_ssl_helpers.py::test_open_ssl_over_tcp_stream_and_everything_else[tls13]", "src/trio/_tests/test_highlevel_ssl_helpers.py::test_open_ssl_over_tcp_stream_and_everything_else[tls12]", "src/trio/_tests/test_ssl.py::test_ssl_client_basics[tls13]", "src/trio/_tests/test_ssl.py::test_ssl_serv... | ["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 | 6 | 62 | 1,138 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209667 | 80.904 | |||
7,939 | swe_smith::train::2043 | swe_smith | train | 2,043 | pdfminer__pdfminer.six.1a8bd2f7.func_basic__3bfz7afq | swesmith/pdfminer__pdfminer.six.1a8bd2f7 | pdfminer/pdfminer.six | python | null | PDFResourceManager.get_font returns None instead of font object
When processing PDF files, the `get_font` method in `PDFResourceManager` is returning `None` instead of the expected font object, causing text extraction to fail.
#### Steps/Code to Reproduce
```python
from pdfminer.high_level import extract_text
# Thi... | diff --git a/pdfminer/pdfinterp.py b/pdfminer/pdfinterp.py
index ae1c46a..a834283 100644
--- a/pdfminer/pdfinterp.py
+++ b/pdfminer/pdfinterp.py
@@ -211,7 +211,6 @@ class PDFResourceManager:
if settings.STRICT:
if spec["Type"] is not LITERAL_FONT:
raise PDFFontError("T... | ["tests/test_highlevel_extracttext.py::TestExtractText::test_issue_495_pdfobjref_iterable", "tests/test_highlevel_extracttext.py::TestExtractText::test_issue_566_cid_range", "tests/test_highlevel_extracttext.py::TestExtractText::test_issue_566_cmap_bytes", "tests/test_highlevel_extracttext.py::TestExtractText::test_iss... | ["tests/test_converter.py::TestPaintPath::test_paint_path", "tests/test_converter.py::TestPaintPath::test_paint_path_mlllh", "tests/test_converter.py::TestPaintPath::test_paint_path_multiple_mlllh", "tests/test_converter.py::TestPaintPath::test_paint_path_quadrilaterals", "tests/test_converter.py::TestPaintPath::test_p... | jyangballin/swesmith.x86_64.pdfminer_1776_pdfminer.six.1a8bd2f7 | true | null | 1 | 20 | 19 | 857 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,940 | swe_smith::train::39383 | swe_smith | train | 39,383 | pallets__jinja.ada0a9a6.func_pm_ctrl_invert_if__cguh6h4z | swesmith/pallets__jinja.ada0a9a6 | pallets/jinja | python | null | urlize function fails when trim_url_limit is None
#### Description
The `urlize` function in `jinja2.utils` raises a `TypeError` when `trim_url_limit` is `None`. This happens because the logic for handling URL trimming has been incorrectly structured, causing a comparison operation to be performed on `None`.
#### Ste... | diff --git a/src/jinja2/utils.py b/src/jinja2/utils.py
index 5c1ff5d..45beaa9 100644
--- a/src/jinja2/utils.py
+++ b/src/jinja2/utils.py
@@ -259,14 +259,13 @@ def urlize(
if trim_url_limit is not None:
def trim_url(x: str) -> str:
- if len(x) > trim_url_limit:
- return f"{x[:tr... | ["tests/test_filters.py::TestFilter::test_urlize", "tests/test_filters.py::TestFilter::test_urlize_rel_policy", "tests/test_filters.py::TestFilter::test_urlize_target_parameter", "tests/test_regression.py::TestBug::test_urlize_filter_escaping", "tests/test_regression.py::TestBug::test_urlize_filter_closing_punctuation"... | ["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 | 8 | 6 | 1,097 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,941 | swe_smith::train::7017 | swe_smith | train | 7,017 | cantools__cantools.0c6a7871.combine_file__intc7hfz | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | ARXML End-to-End Properties category validation breaks existing files
#### Description
When loading ARXML files with End-to-End properties, the category validation is too strict and rejects valid category values that contain non-alphabetic characters.
#### Steps/Code to Reproduce
```python
import cantools
# This f... | diff --git a/src/cantools/database/can/formats/arxml/end_to_end_properties.py b/src/cantools/database/can/formats/arxml/end_to_end_properties.py
index 7fcc8e5..27f15a4 100644
--- a/src/cantools/database/can/formats/arxml/end_to_end_properties.py
+++ b/src/cantools/database/can/formats/arxml/end_to_end_properties.py
@@ ... | ["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_database.py::CanToolsDataba... | ["tests/test_command_line.py::CanToolsCommandLineTest::test_convert", "tests/test_command_line.py::CanToolsCommandLineTest::test_convert_bad_outfile", "tests/test_command_line.py::CanToolsCommandLineTest::test_decode", "tests/test_command_line.py::CanToolsCommandLineTest::test_decode_can_fd", "tests/test_command_line.p... | jyangballin/swesmith.x86_64.cantools_1776_cantools.0c6a7871 | true | null | 1 | 10 | 12 | 1,057 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,942 | swe_smith::train::12970 | swe_smith | train | 12,970 | python-openxml__python-docx.0cf6d71f.combine_file__ygn13uil | swesmith/python-openxml__python-docx.0cf6d71f | python-openxml/python-docx | python | null | # SettingsPart.new() fails to create default settings part
When trying to create a new document with settings, I'm encountering an error. The `SettingsPart.new()` method is failing to properly load the default settings template.
## Steps to reproduce
Here's a simple script that demonstrates the issue:
```python
fro... | diff --git a/src/docx/parts/settings.py b/src/docx/parts/settings.py
index 116facc..47a659b 100644
--- a/src/docx/parts/settings.py
+++ b/src/docx/parts/settings.py
@@ -32,7 +32,9 @@ class SettingsPart(XmlPart):
partname = PackURI("/word/settings.xml")
content_type = CT.WML_SETTINGS
element =... | ["tests/parts/test_settings.py::DescribeSettingsPart::it_constructs_a_default_settings_part_to_help"] | ["tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture0]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture1]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture2]", "tests/dml/test_color.py::DescribeColorFormat::it_knows... | jyangballin/swesmith.x86_64.python-openxml_1776_python-docx.0cf6d71f | true | null | 1 | 8 | 1 | 1,097 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,943 | swe_smith::train::12899 | swe_smith | train | 12,899 | python-openxml__python-docx.0cf6d71f.combine_file__n02kenkx | swesmith/python-openxml__python-docx.0cf6d71f | python-openxml/python-docx | python | null | PackURI validation bypassed when slash check moved after object creation
#### Description
When creating a PackURI instance, the validation that ensures the URI begins with a slash is no longer working properly. The validation check has been moved to after the object creation, which means invalid URIs can still create... | diff --git a/src/docx/opc/packuri.py b/src/docx/opc/packuri.py
index fdbb67e..dde995b 100644
--- a/src/docx/opc/packuri.py
+++ b/src/docx/opc/packuri.py
@@ -19,11 +19,10 @@ class PackURI(str):
_filename_re = re.compile("([a-zA-Z]+)([1-9][0-9]*)?")
def __new__(cls, pack_uri_str: str):
+ return str.__n... | ["tests/opc/test_packuri.py::DescribePackURI::it_should_raise_on_construct_with_bad_pack_uri_str", "tests/opc/test_packuri.py::DescribePackURI::it_can_calculate_baseURI", "tests/opc/test_packuri.py::DescribePackURI::it_can_calculate_rels_uri", "tests/opc/test_phys_pkg.py::DescribeDirPkgReader::it_can_retrieve_the_rels_... | ["tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture0]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture1]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture2]", "tests/dml/test_color.py::DescribeColorFormat::it_knows... | jyangballin/swesmith.x86_64.python-openxml_1776_python-docx.0cf6d71f | true | null | 1 | 14 | 9 | 977 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,944 | swe_smith::train::51842 | swe_smith | train | 51,842 | pydicom__pydicom.7d361b3d.func_basic__9cfauj6m | swesmith/pydicom__pydicom.7d361b3d | pydicom/pydicom | python | null | Plugin removal from CoderBase fails to remove from correct dictionary
#### Description
When removing plugins from CoderBase, the `remove_plugin` method is checking and removing from the wrong dictionaries. This causes plugins to not be properly removed and can lead to KeyError exceptions.
#### Steps/Code to Reproduc... | diff --git a/src/pydicom/pixels/common.py b/src/pydicom/pixels/common.py
index 10a4a93..9483910 100644
--- a/src/pydicom/pixels/common.py
+++ b/src/pydicom/pixels/common.py
@@ -186,12 +186,12 @@ class CoderBase:
label : str
The label of the plugin to remove.
"""
- if label in self.... | ["tests/pixels/test_common.py::TestCoderBase::test_add_plugin_unavailable", "tests/pixels/test_common.py::TestCoderBase::test_remove_plugin"] | ["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 | 6 | 2 | 1,137 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,945 | swe_smith::train::17621 | swe_smith | train | 17,621 | pyasn1__pyasn1.0f07d724.func_basic__e8e9j4ab | swesmith/pyasn1__pyasn1.0f07d724 | pyasn1/pyasn1 | python | null | NamedValues __repr__ method breaks with generator object error
#### Description
The `__repr__` method of `NamedValues` class is causing a `TypeError` when trying to format the representation string. The error occurs because the method is trying to use a generator object in string formatting operations.
#### Steps/Co... | diff --git a/pyasn1/type/namedval.py b/pyasn1/type/namedval.py
index 46a6496..ce481d1 100644
--- a/pyasn1/type/namedval.py
+++ b/pyasn1/type/namedval.py
@@ -104,13 +104,13 @@ class NamedValues(object):
number += 1
def __repr__(self):
- representation = ', '.join(['%s=%d' % x for x in self... | ["tests/codec/native/test_decoder.py::BooleanDecoderTestCase::testTrue", "tests/codec/native/test_decoder.py::BooleanDecoderTestCase::testTrueNeg", "tests/type/test_namedval.py::NamedValuesCaseBase::testStrRepr", "tests/type/test_univ.py::BooleanTestCase::testRepr", "tests/type/test_univ.py::BitStringTestCase::testRepr... | ["tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLargeTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLongTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testTagsEquivalence", "tests/codec/ber/test_decoder.py::DecoderCacheTestCase::testCache", "tests/codec/ber/test_d... | jyangballin/swesmith.x86_64.pyasn1_1776_pyasn1.0f07d724 | true | null | 1 | 10 | 6 | 1,057 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,946 | swe_smith::train::17312 | swe_smith | train | 17,312 | pyasn1__pyasn1.0f07d724.combine_file__8jmcdtn5 | swesmith/pyasn1__pyasn1.0f07d724 | pyasn1/pyasn1 | python | null | Native decoder fails with TypeError after recent changes
#### Description
The native decoder is throwing `TypeError: 'NoneType' object is not iterable` when trying to decode basic Python objects to ASN.1 types. This affects all basic types including integers, booleans, strings, etc.
#### Steps/Code to Reproduce
```... | diff --git a/pyasn1/codec/native/decoder.py b/pyasn1/codec/native/decoder.py
index 9ac01ff..952a15b 100644
--- a/pyasn1/codec/native/decoder.py
+++ b/pyasn1/codec/native/decoder.py
@@ -32,16 +32,15 @@ class BitStringPayloadDecoder(AbstractScalarPayloadDecoder):
class SequenceOrSetPayloadDecoder(object):
def __c... | ["tests/codec/native/test_decoder.py::BadAsn1SpecTestCase::testBadSpec", "tests/codec/native/test_decoder.py::IntegerDecoderTestCase::testNegInt", "tests/codec/native/test_decoder.py::IntegerDecoderTestCase::testPosInt", "tests/codec/native/test_decoder.py::BooleanDecoderTestCase::testTrue", "tests/codec/native/test_de... | ["tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLargeTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testLongTag", "tests/codec/ber/test_decoder.py::LargeTagDecoderTestCase::testTagsEquivalence", "tests/codec/ber/test_decoder.py::DecoderCacheTestCase::testCache", "tests/codec/ber/test_d... | jyangballin/swesmith.x86_64.pyasn1_1776_pyasn1.0f07d724 | true | null | 1 | 13 | 13 | 997 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2095 | 80.9035 | |||
7,947 | swe_smith::train::31491 | swe_smith | train | 31,491 | benoitc__gunicorn.bacbf8aa.func_basic__8yo91hft | swesmith/benoitc__gunicorn.bacbf8aa | benoitc/gunicorn | python | null | Arbiter initialization broken after recent changes
When trying to start gunicorn, the arbiter fails to initialize properly. The worker_class attribute is being set to None instead of the configured worker class, causing AttributeError when trying to spawn workers.
#### Steps to Reproduce
```python
import gunicorn.ar... | diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py
index 646d684..e5af8c7 100644
--- a/gunicorn/arbiter.py
+++ b/gunicorn/arbiter.py
@@ -89,17 +89,17 @@ class Arbiter:
self.app = app
self.cfg = app.cfg
- if self.log is None:
+ if self.log is not None:
self.log = self.c... | ["tests/test_arbiter.py::test_arbiter_stop_closes_listeners", "tests/test_arbiter.py::test_arbiter_stop_child_does_not_unlink_listeners", "tests/test_arbiter.py::test_arbiter_stop_parent_does_not_unlink_listeners", "tests/test_arbiter.py::test_arbiter_stop_does_not_unlink_systemd_listeners", "tests/test_arbiter.py::tes... | ["tests/test_config.py::test_worker_class", "tests/test_config.py::test_defaults", "tests/test_config.py::test_property_access", "tests/test_config.py::test_bool_validation", "tests/test_config.py::test_pos_int_validation", "tests/test_config.py::test_str_validation", "tests/test_config.py::test_str_to_addr_list_valida... | jyangballin/swesmith.x86_64.benoitc_1776_gunicorn.bacbf8aa | true | null | 1 | 14 | 12 | 976 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209333 | 80.903 | |||
7,948 | swe_smith::train::46094 | swe_smith | train | 46,094 | conan-io__conan.86f29e13.pr_13266 | swesmith/conan-io__conan.86f29e13 | conan-io/conan | python | null | Error parsing options in conanfile
When trying to load options from a conanfile, an error is raised due to incorrect option specification. The error message suggests that options should be specified in a certain format, but the current format seems to be causing issues.
To reproduce the issue, you can use the followi... | diff --git a/conans/client/loader.py b/conans/client/loader.py
index 9576964..691858d 100644
--- a/conans/client/loader.py
+++ b/conans/client/loader.py
@@ -240,8 +240,8 @@ class ConanFileLoader:
try:
conanfile.options = Options.loads(parser.options)
except Exception:
- raise C... | ["test/unittests/client/conanfile_loader_test.py::ConanLoaderTxtTest::test_load_options_error"] | ["test/unittests/client/conanfile_loader_test.py::ConanLoaderTest::test_inherit_short_paths", "test/unittests/client/conanfile_loader_test.py::ConanLoaderTxtTest::test_conanfile_txt_errors", "test/unittests/client/conanfile_loader_test.py::ConanLoaderTxtTest::test_layout_multiple", "test/unittests/client/conanfile_load... | jyangballin/swesmith.x86_64.conan-io_1776_conan.86f29e13 | true | null | 1 | 6 | 1 | 1,136 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209333 | 80.903 | |||
7,949 | swe_smith::train::48560 | swe_smith | train | 48,560 | sqlfluff__sqlfluff.50a1c4b6.func_pm_remove_wrapper__iz1b2exl | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | Linter crashes with NameError when lexing fails
#### Description
When the linter encounters a lexing error, it crashes with a `NameError: name 'segments' is not defined` instead of gracefully handling the error and returning violations.
#### Steps/Code to Reproduce
```python
from sqlfluff import Linter
from sqlfluf... | diff --git a/src/sqlfluff/core/linter/linter.py b/src/sqlfluff/core/linter/linter.py
index 5e5474f..614c368 100644
--- a/src/sqlfluff/core/linter/linter.py
+++ b/src/sqlfluff/core/linter/linter.py
@@ -169,19 +169,6 @@ class Linter:
linter_logger.info("LEXING RAW (%s)", templated_file.fname)
# Get the ... | ["test/core/linter/linter_test.py::test__linter__skip_large_bytes[0-False]", "test/core/linter/linter_test.py::test__linter__skip_large_bytes[2000-False]", "test/core/linter/linter_test.py::test__linter__lint_string_vs_file[test/fixtures/linter/indentation_errors.sql]", "test/core/linter/linter_test.py::test__linter__l... | ["test/core/linter/linter_test.py::test__linter__skip_large_bytes[5-True]", "test/core/linter/linter_test.py::test__linter__linting_result__sum_dicts", "test/core/linter/linter_test.py::test__linter__linting_result__combine_dicts", "test/core/linter/linter_test.py::test__linter__linting_result_get_violations[1]", "test... | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 14 | 20 | 975 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209167 | 80.9025 | |||
7,950 | swe_smith::train::23869 | swe_smith | train | 23,869 | sunpy__sunpy.f8edfd5c.func_pm_ctrl_invert_if__n011hdzz | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | find_contours method raises ValueError for valid single scalar levels
#### Description
The `find_contours` method is incorrectly raising a "level must be a single scalar value" error even when passed a valid single scalar value. This appears to affect both 'contourpy' and 'skimage' methods.
#### Steps/Code to Reprod... | diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
index bdcac77..bf8c1fb 100644
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -2976,11 +2976,11 @@ class GenericMap(NDData):
"""
level = self._process_levels_arg(level)
if level.size != 1:
- raise ValueError("level m... | ["sunpy/map/tests/test_mapbase.py::test_find_contours_contourpy", "sunpy/map/tests/test_mapbase.py::test_find_contours_skimage", "sunpy/map/tests/test_mapbase.py::test_find_contours_invalid_library", "sunpy/map/tests/test_mapbase.py::test_find_contours_units", "sunpy/map/tests/test_mapbase.py::test_find_contours_inputs... | ["sunpy/map/tests/test_mapbase.py::test_notes_combined", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_references", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_existing_notes", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_notes_no_references", "sunpy/map/tests/test_mapbase.py::test_f... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 9 | 5 | 1,075 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209167 | 80.9025 | |||
7,951 | swe_smith::train::27340 | swe_smith | train | 27,340 | tkrajina__gpxpy.09fc46b3.func_pm_remove_assign__ltki7a4w | swesmith/tkrajina__gpxpy.09fc46b3 | tkrajina/gpxpy | python | null | NameError in smooth() method when remove_extremes is enabled
When calling the `smooth()` method with `remove_extremes=True`, a `NameError` is raised for undefined variables like `new_longitude` and `dist`.
#### Steps/Code to Reproduce
```python
import gpxpy
import gpxpy.parser as mod_parser
# Load any GPX file with... | diff --git a/gpxpy/gpx.py b/gpxpy/gpx.py
index 73e2024..deccb72 100644
--- a/gpxpy/gpx.py
+++ b/gpxpy/gpx.py
@@ -1262,7 +1262,6 @@ class GPXTrackSegment:
# points -- then is a candidate for deletion:
# TODO: Make this a method parameter
remove_2d_extremes_threshold = 1.75 * avg_distance
- ... | ["test.py::GPXTests::test_clone_and_smooth", "test.py::GPXTests::test_horizontal_and_vertical_smooth_remove_extremes", "test.py::GPXTests::test_horizontal_smooth_remove_extremes", "test.py::GPXTests::test_moving_stopped_times", "test.py::GPXTests::test_smooth_without_removing_extreemes_preserves_point_count_2", "test.p... | ["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 | 10 | 7 | 1,055 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209167 | 80.9025 | |||
7,952 | swe_smith::train::43618 | swe_smith | train | 43,618 | cloudpipe__cloudpickle.6220b0ce.func_basic__w5ot5zcx | swesmith/cloudpipe__cloudpickle.6220b0ce | cloudpipe/cloudpickle | python | null | unregister_pickle_by_value function has inverted logic
Description
The `unregister_pickle_by_value` function appears to have inverted logic - it raises an error when a module IS a module type instead of when it's NOT a module type, and it adds modules to the registry instead of removing them.
Steps/Code to Reproduce... | diff --git a/cloudpickle/cloudpickle.py b/cloudpickle/cloudpickle.py
index 8c50ba1..6e4cfcf 100644
--- a/cloudpickle/cloudpickle.py
+++ b/cloudpickle/cloudpickle.py
@@ -166,12 +166,12 @@ def register_pickle_by_value(module):
def unregister_pickle_by_value(module):
"""Unregister that the input module should be p... | ["tests/cloudpickle_test.py::CloudPickleTest::test_pickle_constructs_from_module_registered_for_pickling_by_value", "tests/cloudpickle_test.py::Protocol2CloudPickleTest::test_pickle_constructs_from_module_registered_for_pickling_by_value"] | ["tests/cloudpickle_file_test.py::CloudPickleFileTests::test_closed_file", "tests/cloudpickle_file_test.py::CloudPickleFileTests::test_empty_file", "tests/cloudpickle_file_test.py::CloudPickleFileTests::test_pickling_special_file_handles", "tests/cloudpickle_file_test.py::CloudPickleFileTests::test_plus_mode", "tests/c... | jyangballin/swesmith.x86_64.cloudpipe_1776_cloudpickle.6220b0ce | true | null | 1 | 8 | 2 | 1,094 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,953 | swe_smith::train::47963 | swe_smith | train | 47,963 | sqlfluff__sqlfluff.50a1c4b6.func_basic__ncz1jjji | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | FunctionWrapper __str__ method returns warning instead of raising error
#### Description
When attempting to render a FunctionWrapper directly as a string, the method now returns a warning message instead of raising a SQLTemplaterError. This changes the expected behavior where the system should fail fast when trying t... | diff --git a/src/sqlfluff/core/templaters/builtins/common.py b/src/sqlfluff/core/templaters/builtins/common.py
index 56b71fa..52a2005 100644
--- a/src/sqlfluff/core/templaters/builtins/common.py
+++ b/src/sqlfluff/core/templaters/builtins/common.py
@@ -22,10 +22,9 @@ class FunctionWrapper:
return self._callabl... | ["test/core/templaters/builtins_test.py::test_function_emulator"] | ["test/core/templaters/builtins_test.py::test_relation_emulator_magic_methods"] | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 11 | 1 | 1,034 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,954 | swe_smith::train::11030 | swe_smith | train | 11,030 | rsalmei__alive-progress.35853799.combine_module__8f8a9f7j | swesmith/rsalmei__alive-progress.35853799 | rsalmei/alive-progress | python | null | Configuration validation broken for string inputs
#### Description
When passing string values to configuration parameters that expect floats, the validation is not working correctly. Instead of rejecting invalid string inputs, the system is accepting them and causing downstream errors.
#### Steps/Code to Reproduce
... | diff --git a/alive_progress/core/configuration.py b/alive_progress/core/configuration.py
index b36d671..d6be413 100644
--- a/alive_progress/core/configuration.py
+++ b/alive_progress/core/configuration.py
@@ -71,9 +71,9 @@ def _float_input_factory(lower, upper):
def _input(x):
try:
x = float(... | ["tests/core/test_configuration.py::test_config_creation", "tests/core/test_configuration.py::test_config_global[config_params0]", "tests/core/test_configuration.py::test_config_global[config_params1]", "tests/core/test_configuration.py::test_config_global[config_params2]", "tests/core/test_configuration.py::test_confi... | ["tests/animations/test_bars.py::test_bar_tip_background[--0.5-False-|0123456789|]", "tests/animations/test_bars.py::test_bar_tip_background[=--0.5-False-|0123456789|]", "tests/animations/test_bars.py::test_bar_tip_background[_-=--0.5-False-|0123456789|]", "tests/animations/test_bars.py::test_bar_tip_background[-0.0-Fa... | jyangballin/swesmith.x86_64.rsalmei_1776_alive-progress.35853799 | true | null | 2 | 8 | 61 | 1,094 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,955 | swe_smith::train::5570 | swe_smith | train | 5,570 | PyCQA__flake8.cf1542ce.func_pm_remove_assign__5bz2ejw2 | swesmith/PyCQA__flake8.cf1542ce | pycqa/flake8 | python | null | FileProcessor build_logical_line method breaks with undefined variables
#### Description
The `build_logical_line` method in `FileProcessor` is referencing undefined variables that cause `NameError` exceptions when processing certain Python files.
#### Steps/Code to Reproduce
Create a simple Python file and run flak... | diff --git a/src/flake8/processor.py b/src/flake8/processor.py
index e44547b..f7b2678 100644
--- a/src/flake8/processor.py
+++ b/src/flake8/processor.py
@@ -191,7 +191,6 @@ class FileProcessor:
comments = []
mapping: _LogicalMapping = []
length = 0
- previous_row = previous_column = No... | ["tests/integration/test_api_legacy.py::test_legacy_api", "tests/integration/test_main.py::test_form_feed_line_split", "tests/integration/test_main.py::test_e101_indent_char_does_not_reset", "tests/integration/test_main.py::test_statistics_option", "tests/integration/test_main.py::test_show_source_option", "tests/integ... | ["tests/integration/test_aggregator.py::test_aggregate_options_with_config", "tests/integration/test_aggregator.py::test_aggregate_options_when_isolated", "tests/integration/test_checker.py::test_handle_file_plugins[PluginClass]", "tests/integration/test_checker.py::test_handle_file_plugins[plugin_func_gen]", "tests/in... | jyangballin/swesmith.x86_64.pycqa_1776_flake8.cf1542ce | true | null | 1 | 11 | 19 | 1,034 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,956 | swe_smith::train::6949 | swe_smith | train | 6,949 | cantools__cantools.0c6a7871.combine_file__70028abo | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | NamedSignalValue initialization broken with comments parameter
Description
When creating a NamedSignalValue with comments parameter, the object fails to initialize properly and raises AttributeError about missing '_comments' attribute.
Steps/Code to Reproduce
```python
from cantools.database.namedsignalvalue import... | diff --git a/src/cantools/database/namedsignalvalue.py b/src/cantools/database/namedsignalvalue.py
index 89bface..af3f232 100644
--- a/src/cantools/database/namedsignalvalue.py
+++ b/src/cantools/database/namedsignalvalue.py
@@ -15,14 +15,11 @@ class NamedSignalValue:
name: str,
comments: Optional[dic... | ["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... | ["tests/test_command_line.py::CanToolsCommandLineTest::test_decode_muxed_data", "tests/test_command_line.py::CanToolsCommandLineTest::test_decode_single_line_muxed_data", "tests/test_command_line.py::CanToolsCommandLineTest::test_dump_j1939", "tests/test_command_line.py::CanToolsCommandLineTest::test_dump_no_sender", "... | jyangballin/swesmith.x86_64.cantools_1776_cantools.0c6a7871 | true | null | 1 | 21 | 187 | 834 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,957 | swe_smith::train::20407 | swe_smith | train | 20,407 | tobymao__sqlglot.036601ba.combine_file__nwhay3ne | swesmith/tobymao__sqlglot.036601ba | tobymao/sqlglot | python | null | Oracle dialect fails with UnboundLocalError when parsing hints and trim functions
#### Description
When using Oracle dialect with certain SQL queries containing hints or trim functions, the parser raises an `UnboundLocalError` due to variables being referenced before assignment.
#### Steps/Code to Reproduce
```pyth... | diff --git a/sqlglot/dialects/oracle.py b/sqlglot/dialects/oracle.py
index 3013bf2..66f523a 100644
--- a/sqlglot/dialects/oracle.py
+++ b/sqlglot/dialects/oracle.py
@@ -23,13 +23,12 @@ if t.TYPE_CHECKING:
def _trim_sql(self: Oracle.Generator, expression: exp.Trim) -> str:
- position = expression.args.get("posit... | ["tests/dialects/test_oracle.py::TestOracle::test_hints", "tests/dialects/test_oracle.py::TestOracle::test_oracle"] | ["tests/dialects/test_oracle.py::TestOracle::test_analyze", "tests/dialects/test_oracle.py::TestOracle::test_connect_by", "tests/dialects/test_oracle.py::TestOracle::test_datetrunc", "tests/dialects/test_oracle.py::TestOracle::test_grant", "tests/dialects/test_oracle.py::TestOracle::test_join_marker", "tests/dialects/t... | jyangballin/swesmith.x86_64.tobymao_1776_sqlglot.036601ba | true | null | 1 | 15 | 2 | 954 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,958 | swe_smith::train::2544 | swe_smith | train | 2,544 | pdfminer__pdfminer.six.1a8bd2f7.func_pm_remove_cond__hserj897 | swesmith/pdfminer__pdfminer.six.1a8bd2f7 | pdfminer/pdfminer.six | python | null | PDFXRefStream get_entry method returns incorrect values for type 2 entries
#### Description
When processing PDF cross-reference streams, the `get_entry` method in `PDFXRefStream` class doesn't handle type 2 entries correctly. Type 2 entries should return a tuple with the object stream ID, index within that stream, an... | diff --git a/pdfminer/pdfdocument.py b/pdfminer/pdfdocument.py
index 1c06335..afacf06 100644
--- a/pdfminer/pdfdocument.py
+++ b/pdfminer/pdfdocument.py
@@ -319,12 +319,6 @@ class PDFXRefStream(PDFBaseXRef):
f3 = nunpack(ent[self.fl1 + self.fl2 :])
if f1 == 1:
return (None, f2, f3)
- ... | ["tests/test_highlevel_extracttext.py::TestExtractText::test_issue_566_cid_range", "tests/test_highlevel_extracttext.py::TestExtractText::test_issue_566_cmap_bytes", "tests/test_highlevel_extracttext.py::TestExtractText::test_simple5_with_file", "tests/test_highlevel_extracttext.py::TestExtractText::test_simple5_with_s... | ["tests/test_converter.py::TestPaintPath::test_paint_path", "tests/test_converter.py::TestPaintPath::test_paint_path_mlllh", "tests/test_converter.py::TestPaintPath::test_paint_path_multiple_mlllh", "tests/test_converter.py::TestPaintPath::test_paint_path_quadrilaterals", "tests/test_converter.py::TestPaintPath::test_p... | jyangballin/swesmith.x86_64.pdfminer_1776_pdfminer.six.1a8bd2f7 | true | null | 1 | 6 | 7 | 1,134 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,959 | swe_smith::train::4783 | swe_smith | train | 4,783 | bottlepy__bottle.a8dfef30.func_basic__g438yp83 | swesmith/bottlepy__bottle.a8dfef30 | bottlepy/bottle | python | null | ResourceManager initialization parameters swapped causing attribute errors
When creating a ResourceManager instance, the `base` and `opener` parameters appear to be swapped internally, causing various methods to fail with TypeError and AttributeError exceptions.
#### Steps/Code to Reproduce
```python
from bottle imp... | diff --git a/bottle.py b/bottle.py
index 286b5bc..fa0b64a 100755
--- a/bottle.py
+++ b/bottle.py
@@ -2644,14 +2644,14 @@ class ResourceManager(object):
"""
def __init__(self, base='./', opener=open, cachemode='all'):
- self.opener = opener
- self.base = base
- self.cachemode = cachemode... | ["test/test_resources.py::TestResourceManager::test_get", "test/test_resources.py::TestResourceManager::test_open", "test/test_resources.py::TestResourceManager::test_path_absolutize", "test/test_resources.py::TestResourceManager::test_path_create", "test/test_resources.py::TestResourceManager::test_path_normalize", "t... | ["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 | 10 | 8 | 1,054 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,960 | swe_smith::train::23783 | swe_smith | train | 23,783 | rustedpy__result.0b855e1e.func_basic__l0xvb1um | swesmith/rustedpy__result.0b855e1e | rustedpy/result | python | null | Ok.expect_err() not raising UnwrapError when message is not empty
#### Description
The `expect_err()` method on `Ok` instances is not properly raising `UnwrapError` when called with a non-empty message. Instead, it appears to be silently returning without raising the expected exception.
#### Steps/Code to Reproduce
... | diff --git a/src/result/result.py b/src/result/result.py
index 8551239..6e78176 100644
--- a/src/result/result.py
+++ b/src/result/result.py
@@ -114,7 +114,13 @@ class Ok(Generic[T]):
"""
Raise an UnwrapError since this type is `Ok`
"""
- raise UnwrapError(self, message)
+ if me... | ["tests/test_result.py::test_expect_err", "tests/type_checking/test_result.yml::failure_lash", "tests/type_checking/test_result.yml::covariance", "tests/type_checking/test_result.yml::map_ok_err", "tests/type_checking/test_result.yml::map_result"] | ["tests/test_result.py::test_ok_factories", "tests/test_result.py::test_err_factories", "tests/test_result.py::test_eq", "tests/test_result.py::test_hash", "tests/test_result.py::test_repr", "tests/test_result.py::test_ok_value", "tests/test_result.py::test_err_value", "tests/test_result.py::test_ok", "tests/test_resul... | jyangballin/swesmith.x86_64.rustedpy_1776_result.0b855e1e | true | null | 1 | 8 | 5 | 1,094 | 0 | 0.6 | 1 | 0.75 | 1 | 0.209 | 80.902 | |||
7,961 | swe_smith::train::10552 | swe_smith | train | 10,552 | paramiko__paramiko.23f92003.func_basic__ocissla9 | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | SSH connection fails with "list index out of range" error
#### Description
When attempting to establish SSH connections, paramiko fails with an IndexError during the connection process. This affects all SSH client operations including basic connections, host key negotiation, and authentication.
#### Steps/Code to Re... | diff --git a/paramiko/client.py b/paramiko/client.py
index d8be910..ae07f84 100644
--- a/paramiko/client.py
+++ b/paramiko/client.py
@@ -203,14 +203,11 @@ class SSHClient(ClosingContextManager):
hostname, port, socket.AF_UNSPEC, socket.SOCK_STREAM
)
for (family, socktype, proto, canonname... | ["tests/test_client.py::SSHClientTest::test_auth_timeout", "tests/test_client.py::SSHClientTest::test_auth_trickledown", "tests/test_client.py::SSHClientTest::test_auto_add_policy", "tests/test_client.py::SSHClientTest::test_banner_timeout", "tests/test_client.py::SSHClientTest::test_certs_allowed_as_key_filename_value... | ["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 | 7 | 30 | 1,113 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,962 | swe_smith::train::23995 | swe_smith | train | 23,995 | sunpy__sunpy.f8edfd5c.func_pm_ctrl_shuffle__dhdih28q | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | Map creation fails with UnboundLocalError on _date_obs property
#### Description
When creating or accessing Map objects, an `UnboundLocalError` is raised when trying to access the `_date_obs` property. The error indicates that a local variable 'time' is being accessed before it's assigned a value.
#### Steps/Code to... | diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
index bdcac77..337d3df 100644
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -928,12 +928,11 @@ class GenericMap(NDData):
@property
def _date_obs(self):
- # Get observation date from date-obs, falling back to date_obs
- time = ... | ["sunpy/map/tests/test_mapbase.py::test_wcs", "sunpy/map/tests/test_mapbase.py::test_wcs_pv", "sunpy/map/tests/test_mapbase.py::test_wcs_cache", "sunpy/map/tests/test_mapbase.py::test_header_immutability", "sunpy/map/tests/test_mapbase.py::test_name", "sunpy/map/tests/test_mapbase.py::test_date[keys0-expected_date0]", ... | ["sunpy/map/tests/test_mapbase.py::test_notes_combined", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_references", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_existing_notes", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_notes_no_references", "sunpy/map/tests/test_mapbase.py::test_f... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 7 | 80 | 1,113 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,963 | swe_smith::train::42185 | swe_smith | train | 42,185 | scanny__python-pptx.278b47b1.func_pm_ctrl_shuffle__pmza8dpc | swesmith/scanny__python-pptx.278b47b1 | scanny/python-pptx | python | null | #### Description
The `vary_by_categories` property on chart plots returns incorrect values due to a variable scope issue. When accessing this property, it references an undefined variable `varyColors` before the variable is actually declared.
#### Steps/Code to Reproduce
```python
from pptx import Presentation
from ... | diff --git a/src/pptx/chart/plot.py b/src/pptx/chart/plot.py
index 6e72358..a754e85 100644
--- a/src/pptx/chart/plot.py
+++ b/src/pptx/chart/plot.py
@@ -94,6 +94,9 @@ class _BasePlot(object):
@property
def vary_by_categories(self):
+ if varyColors is None:
+ return True
+ return var... | ["tests/chart/test_plot.py::Describe_BasePlot::it_knows_whether_it_varies_color_by_category[vary_by_categories_get_fixture0]", "tests/chart/test_plot.py::Describe_BasePlot::it_knows_whether_it_varies_color_by_category[vary_by_categories_get_fixture1]", "tests/chart/test_plot.py::Describe_BasePlot::it_knows_whether_it_v... | ["tests/chart/test_axis.py::Describe_BaseAxis::it_provides_access_to_its_title[c:catAx]", "tests/chart/test_axis.py::Describe_BaseAxis::it_provides_access_to_its_title[c:dateAx]", "tests/chart/test_axis.py::Describe_BaseAxis::it_provides_access_to_its_title[c:valAx]", "tests/chart/test_axis.py::Describe_BaseAxis::it_pr... | jyangballin/swesmith.x86_64.scanny_1776_python-pptx.278b47b1 | true | null | 1 | 7 | 3 | 1,113 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,964 | swe_smith::train::30886 | swe_smith | train | 30,886 | mido__mido.a0158ff9.func_basic__pmdm5hhf | swesmith/mido__mido.a0158ff9 | mido/mido | python | null | # Socket address parsing is broken
I noticed a strange behavior when trying to connect to a MIDI socket server. The connection fails with unexpected errors.
When trying to parse addresses like `:8080` or `localhost:8080`, the host and port are swapped in the returned tuple:
```python
>>> from mido.sockets import par... | diff --git a/mido/sockets.py b/mido/sockets.py
index 78d98bb..c9fa897 100644
--- a/mido/sockets.py
+++ b/mido/sockets.py
@@ -152,11 +152,10 @@ def parse_address(address):
except ValueError as ve:
raise ValueError('port number must be an integer') from ve
- # Note: port 0 is not allowed.
- if not 0... | ["../dev/tests/test_sockets.py::TestParseAddress::test_parse_address_normal[:8080-expected0]", "../dev/tests/test_sockets.py::TestParseAddress::test_parse_address_normal[localhost:8080-expected1]", "../dev/tests/test_sockets.py::TestParseAddress::test_port_zero_raises_value_error", "../dev/tests/test_sockets.py::TestPa... | ["../dev/tests/test_frozen.py::test_hashability", "../dev/tests/test_frozen.py::test_freeze_and_thaw", "../dev/tests/test_frozen.py::test_thawed_message_is_copy", "../dev/tests/test_frozen.py::test_is_frozen", "../dev/tests/test_frozen.py::test_frozen_repr", "../dev/tests/test_frozen.py::test_frozen_meta_repr", "../dev... | jyangballin/swesmith.x86_64.mido_1776_mido.a0158ff9 | true | null | 1 | 7 | 4 | 1,113 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,965 | swe_smith::train::43184 | swe_smith | train | 43,184 | gawel__pyquery.811cd048.func_pm_ctrl_shuffle__zjbgpiyi | swesmith/gawel__pyquery.811cd048 | gawel/pyquery | python | null | #### Description
The `items()` method raises an `UnboundLocalError` when called due to a variable being used before assignment.
#### Steps/Code to Reproduce
```python
from pyquery import PyQuery as pq
# Simple HTML to test with
html = '<div><span>foo</span><span>bar</span></div>'
d = pq(html)
# This should work bu... | diff --git a/pyquery/pyquery.py b/pyquery/pyquery.py
index 5b05681..e273318 100644
--- a/pyquery/pyquery.py
+++ b/pyquery/pyquery.py
@@ -290,6 +290,12 @@ class PyQuery(list):
return self
def items(self, selector=None):
+ for elem in elems:
+ yield self._copy(elem, parent=self)
+ ... | ["pyquery/pyquery.py::pyquery.pyquery.PyQuery.items", "pyquery/pyquery.py::pyquery.pyquery.PyQuery.next_until", "pyquery/pyquery.py::pyquery.pyquery.PyQuery.serialize", "pyquery/pyquery.py::pyquery.pyquery.PyQuery.serialize_array", "pyquery/pyquery.py::pyquery.pyquery.PyQuery.serialize_dict", "pyquery/pyquery.py::pyque... | ["README.rst::README.rst", "docs/attributes.rst::attributes.rst", "docs/css.rst::css.rst", "docs/manipulating.rst::manipulating.rst", "docs/pseudo_classes.rst::pseudo_classes.rst", "docs/scrap.rst::scrap.rst", "docs/tips.rst::tips.rst", "docs/traversing.rst::traversing.rst", "pyquery/cssselectpatch.py::pyquery.cssselec... | jyangballin/swesmith.x86_64.gawel_1776_pyquery.811cd048 | true | null | 1 | 13 | 14 | 993 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,966 | swe_smith::train::46617 | swe_smith | train | 46,617 | python-trio__trio.cfbbe2c1.combine_file__fv91q7oh | swesmith/python-trio__trio.cfbbe2c1 | python-trio/trio | python | null | Instrument methods accessing undefined attributes
#### Description
When using the Instrument class, some hook methods are trying to access attributes that don't exist on the instance, causing AttributeError when called.
#### Steps/Code to Reproduce
```python
import trio
from trio._abc import Instrument
class MyIns... | diff --git a/src/trio/_abc.py b/src/trio/_abc.py
index 306ee22..1fade42 100644
--- a/src/trio/_abc.py
+++ b/src/trio/_abc.py
@@ -112,7 +112,8 @@ class Instrument(ABC): # noqa: B024 # conceptually is ABC
task (trio.lowlevel.Task): The task that is about to run.
"""
- return
+ if t... | ["src/trio/_tests/test_abc.py::test_instrument_implements_hook_methods"] | ["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 | 8 | 1 | 1,093 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,967 | swe_smith::train::44411 | swe_smith | train | 44,411 | pydata__patsy.a5d16484.func_pm_remove_assign__b9pmicf9 | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | # DesignMatrix pretty printing broken in latest version
## Description
I found a bug in the latest version of Patsy. When trying to print a DesignMatrix object, I get a NameError saying that 'INDENT' is not defined.
## Steps to reproduce
Here's a simple example that reproduces the issue:
```python
import numpy as ... | diff --git a/patsy/design_info.py b/patsy/design_info.py
index d94b97a..716aef4 100644
--- a/patsy/design_info.py
+++ b/patsy/design_info.py
@@ -1186,7 +1186,6 @@ class DesignMatrix(np.ndarray):
# fixed width it always uses. (As of IPython 0.12.)
MAX_TOTAL_WIDTH = 78
SEP = 2
- INDENT =... | ["patsy/design_info.py::test_design_matrix"] | ["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,133 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208833 | 80.9015 | |||
7,968 | swe_smith::train::7938 | swe_smith | train | 7,938 | cantools__cantools.0c6a7871.func_pm_ctrl_shuffle__0q6rl6gr | swesmith/cantools__cantools.0c6a7871 | cantools/cantools | python | null | CDD file loading fails with UnboundLocalError on did_data_refs
#### Description
When loading CDD files, the parser fails with `UnboundLocalError: local variable 'did_data_refs' referenced before assignment` in the `_load_did_element` function.
#### Steps/Code to Reproduce
```python
import cantools
# This will fail... | diff --git a/src/cantools/database/diagnostics/formats/cdd.py b/src/cantools/database/diagnostics/formats/cdd.py
index b25f9d5..00a792c 100644
--- a/src/cantools/database/diagnostics/formats/cdd.py
+++ b/src/cantools/database/diagnostics/formats/cdd.py
@@ -167,21 +167,16 @@ def _load_data_element(data, offset, data_typ... | ["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 | 1 | 23 | 7 | 792 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,969 | swe_smith::train::12905 | swe_smith | train | 12,905 | python-openxml__python-docx.0cf6d71f.combine_file__o2mkjxed | swesmith/python-openxml__python-docx.0cf6d71f | python-openxml/python-docx | python | null | OpcPackage.open() returns None instead of package instance
When trying to open a package file using `OpcPackage.open()`, the method returns `None` instead of the expected `OpcPackage` instance. This breaks any code that expects to work with the returned package object.
#### Steps/Code to Reproduce
```python
from doc... | diff --git a/src/docx/opc/package.py b/src/docx/opc/package.py
index 3b1eef2..c87bbec 100644
--- a/src/docx/opc/package.py
+++ b/src/docx/opc/package.py
@@ -126,8 +126,8 @@ class OpcPackage:
"""Return an |OpcPackage| instance loaded with the contents of `pkg_file`."""
pkg_reader = PackageReader.from_f... | ["tests/opc/test_package.py::DescribeOpcPackage::it_can_open_a_pkg_file", "tests/opc/test_package.py::DescribeOpcPackage::it_can_save_to_a_pkg_file", "tests/opc/test_package.py::DescribeUnmarshaller::it_can_unmarshal_from_a_pkg_reader", "tests/opc/test_package.py::DescribeUnmarshaller::it_can_unmarshal_parts", "tests/t... | ["tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture0]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture1]", "tests/dml/test_color.py::DescribeColorFormat::it_knows_its_color_type[type_fixture2]", "tests/dml/test_color.py::DescribeColorFormat::it_knows... | jyangballin/swesmith.x86_64.python-openxml_1776_python-docx.0cf6d71f | true | null | 1 | 23 | 7 | 792 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,970 | swe_smith::train::26062 | swe_smith | train | 26,062 | pylint-dev__astroid.b114f6b5.func_basic__w72a1p0j | swesmith/pylint-dev__astroid.b114f6b5 | pylint-dev/astroid | python | null | __class__ attribute assignment broken for built-in types
#### Description
When accessing the `__class__` attribute on built-in types or functions, astroid fails with a KeyError. This affects inference of many standard library modules and built-in objects.
#### Steps/Code to Reproduce
```python
import astroid
# Thi... | diff --git a/astroid/raw_building.py b/astroid/raw_building.py
index c1f7ec1..1e6e273 100644
--- a/astroid/raw_building.py
+++ b/astroid/raw_building.py
@@ -52,13 +52,13 @@ def _attach_local_node(parent, node, name: str) -> None:
def _add_dunder_class(func, parent: nodes.NodeNG, member) -> None:
"""Add a __class_... | ["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 | 12 | 60 | 1,012 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,971 | swe_smith::train::28298 | swe_smith | train | 28,298 | encode__starlette.db5063c2.combine_file__6arymhmp | swesmith/encode__starlette.db5063c2 | encode/starlette | python | null | WebSocket initialization fails with assertion error
#### Description
WebSocket connections are failing to initialize properly. When creating a WebSocket instance, an assertion error is raised even for valid websocket scopes.
#### Steps/Code to Reproduce
```python
from starlette.websockets import WebSocket
async de... | diff --git a/starlette/websockets.py b/starlette/websockets.py
index b7acaa3..25a1da1 100644
--- a/starlette/websockets.py
+++ b/starlette/websockets.py
@@ -17,17 +17,17 @@ class WebSocketState(enum.Enum):
class WebSocketDisconnect(Exception):
- def __init__(self, code: int = 1000, reason: str | None = None) ->... | ["tests/middleware/test_base.py::test_custom_middleware[asyncio]", "tests/middleware/test_base.py::test_custom_middleware[trio]", "tests/test_applications.py::test_websocket_route[asyncio]", "tests/test_applications.py::test_websocket_raise_websocket_exception[asyncio]", "tests/test_applications.py::test_websocket_rais... | ["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/test_base.py::test_contextvars[asyncio-CustomMiddlewareWithoutBaseHTT... | jyangballin/swesmith.x86_64.encode_1776_starlette.db5063c2 | true | null | 1 | 12 | 119 | 1,012 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,972 | swe_smith::train::21689 | swe_smith | train | 21,689 | buriy__python-readability.40256f40.func_pm_remove_assign__6nydton7 | swesmith/buriy__python-readability.40256f40 | buriy/python-readability | python | null | NameError in Document.clean() method when processing HTML elements
#### Description
When processing HTML documents, the `Document.clean()` method raises a `NameError` for undefined variables that were accidentally removed during code cleanup.
#### Steps/Code to Reproduce
```python
from readability import Document
... | diff --git a/readability/readability.py b/readability/readability.py
index c86e7d1..e09f4ee 100755
--- a/readability/readability.py
+++ b/readability/readability.py
@@ -516,8 +516,6 @@ class Document:
elem.text = "VIDEO" # ADD content to iframe text node to force <iframe></iframe> proper output
... | ["tests/test_article_only.py::TestArticleOnly::test_best_elem_is_root_and_passing", "tests/test_article_only.py::TestArticleOnly::test_correct_cleanup", "tests/test_article_only.py::TestArticleOnly::test_si_sample", "tests/test_article_only.py::TestArticleOnly::test_si_sample_html_partial", "tests/test_article_only.py:... | ["tests/test_article_only.py::TestArticleOnly::test_author_absent", "tests/test_article_only.py::TestArticleOnly::test_author_present", "tests/test_article_only.py::TestArticleOnly::test_many_repeated_spaces", "tests/test_article_only.py::TestArticleOnly::test_not_self_closing"] | jyangballin/swesmith.x86_64.buriy_1776_python-readability.40256f40 | true | null | 1 | 17 | 7 | 912 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,973 | swe_smith::train::29909 | swe_smith | train | 29,909 | getnikola__nikola.0f4c230e.func_pm_ctrl_shuffle__s1p7c20p | swesmith/getnikola__nikola.0f4c230e | getnikola/nikola | python | null | SoundCloud directive returns early without processing options
#### Description
The SoundCloud directive in the reStructuredText compiler is returning the HTML output before processing all the directive options, causing a KeyError when trying to access the 'align' option.
#### Steps/Code to Reproduce
Create a reStru... | diff --git a/nikola/plugins/compile/rest/soundcloud.py b/nikola/plugins/compile/rest/soundcloud.py
index 2ccc2c2..fc67c14 100644
--- a/nikola/plugins/compile/rest/soundcloud.py
+++ b/nikola/plugins/compile/rest/soundcloud.py
@@ -75,21 +75,20 @@ class SoundCloud(Directive):
preslug = "tracks"
def run(self):
... | ["tests/integration/test_archive_full.py::test_avoid_double_slash_in_rss", "tests/integration/test_archive_full.py::test_index_in_sitemap", "tests/integration/test_archive_full.py::test_full_archive[overall]", "tests/integration/test_archive_full.py::test_full_archive[year]", "tests/integration/test_archive_full.py::te... | ["tests/integration/test_archive_full.py::test_check_files", "tests/integration/test_archive_full.py::test_check_links", "tests/integration/test_archive_per_day.py::test_check_files", "tests/integration/test_archive_per_day.py::test_check_links", "tests/integration/test_archive_per_month.py::test_check_files", "tests/i... | jyangballin/swesmith.x86_64.getnikola_1776_nikola.0f4c230e | true | null | 1 | 7 | 48 | 1,112 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,974 | swe_smith::train::27345 | swe_smith | train | 27,345 | tkrajina__gpxpy.09fc46b3.func_pm_remove_assign__oxv4661x | swesmith/tkrajina__gpxpy.09fc46b3 | tkrajina/gpxpy | python | null | XML serialization fails with UnboundLocalError for 'fields' and 'suppressuntil' variables
#### Description
When calling `to_xml()` on GPX objects, the method raises `UnboundLocalError` for local variables `fields` and `suppressuntil` that are referenced before assignment.
#### Steps/Code to Reproduce
```python
impo... | diff --git a/gpxpy/gpxfield.py b/gpxpy/gpxfield.py
index e253df3..bba662e 100644
--- a/gpxpy/gpxfield.py
+++ b/gpxpy/gpxfield.py
@@ -487,7 +487,6 @@ def gpx_fields_to_xml(instance: Any, tag: str, version: str, custom_attributes:
nsmap: Dict[str, str]={}, prettyprint: bool=True, indent: str='', em... | ["test.py::GPXTests::test_10_to_11_conversion", "test.py::GPXTests::test_bounds_xml", "test.py::GPXTests::test_custom_schema_locations", "test.py::GPXTests::test_default_schema_locations", "test.py::GPXTests::test_dilutions", "test.py::GPXTests::test_garmin_extension", "test.py::GPXTests::test_gpx_10_fields", "test.py:... | ["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_add_missing_elevations", "test.py::GPXTests::tes... | jyangballin/swesmith.x86_64.tkrajina_1776_gpxpy.09fc46b3 | true | null | 1 | 10 | 27 | 1,052 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,975 | swe_smith::train::54055 | swe_smith | train | 54,055 | blevesearch__bleve.f2876b5e.func_pm_flip_operators__vcctl3op | swesmith/blevesearch__bleve.f2876b5e | blevesearch/bleve | go | null | UpsideDownCouchDocIDReader panics with nil pointer dereference in onlyMode
#### Description
The UpsideDownCouchDocIDReader is causing a panic with a nil pointer dereference when operating in onlyMode. This appears to be related to incorrect loop conditions and error handling logic.
#### Steps/Code to Reproduce
The ... | diff --git a/index/upsidedown/reader.go b/index/upsidedown/reader.go
index 68b1531..af8df50 100644
--- a/index/upsidedown/reader.go
+++ b/index/upsidedown/reader.go
@@ -257,9 +257,9 @@ func (r *UpsideDownCouchDocIDReader) Next() (index.IndexInternalID, error) {
if r.onlyMode {
var rv index.IndexInternalID
- for... | ["TestIndexDocIdOnlyReader", "TestDocIDSearcherValid"] | ["TestBuilder", "TestIndexAliasSingle", "TestIndexAliasClosed", "TestIndexAliasEmpty", "TestIndexAliasMulti", "TestMultiSearchNoError", "TestMultiSearchSomeError", "TestMultiSearchAllError", "TestMultiSearchSecondPage", "TestMultiSearchTimeout", "TestMultiSearchTimeoutPartial", "TestIndexAliasMultipleLayer", "TestMulti... | jyangballin/swesmith.x86_64.blevesearch_1776_bleve.f2876b5e | true | null | 1 | 6 | 2 | 1,132 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208667 | 80.901 | |||
7,976 | swe_smith::train::4418 | swe_smith | train | 4,418 | pygments__pygments.27649ebb.func_pm_remove_assign__crzqbk6v | swesmith/pygments__pygments.27649ebb | pygments/pygments | python | null | Terminal256Formatter breaks with NameError on spl variable
#### Description
The Terminal256Formatter is throwing a NameError when trying to format tokens. The variable `spl` is being referenced but not defined, causing the formatter to fail completely.
#### Steps/Code to Reproduce
```python
from pygments import hig... | diff --git a/pygments/formatters/terminal256.py b/pygments/formatters/terminal256.py
index 6402d8c..42f782e 100644
--- a/pygments/formatters/terminal256.py
+++ b/pygments/formatters/terminal256.py
@@ -257,12 +257,6 @@ class Terminal256Formatter(Formatter):
not_found = True
while ttype and not_... | ["tests/test_basic_api.py::test_formatter_public_api[TerminalTrueColorFormatter]", "tests/test_basic_api.py::test_formatter_unicode_handling[TerminalTrueColorFormatter]", "tests/test_basic_api.py::test_formatter_unicode_handling[Terminal256Formatter]", "tests/test_basic_api.py::test_formatter_public_api[Terminal256Form... | ["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 | 9 | 5 | 1,071 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2085 | 80.9005 | |||
7,977 | swe_smith::train::28359 | swe_smith | train | 28,359 | encode__starlette.db5063c2.combine_file__quhtrpr5 | swesmith/encode__starlette.db5063c2 | encode/starlette | python | null | WebSocket connection fails with assertion error
#### Description
WebSocket connections are failing to establish due to an assertion error in the WebSocket class initialization. The assertion is checking that the scope type is NOT "websocket" when it should be checking that it IS "websocket".
#### Steps/Code to Repro... | diff --git a/starlette/websockets.py b/starlette/websockets.py
index b7acaa3..a90a918 100644
--- a/starlette/websockets.py
+++ b/starlette/websockets.py
@@ -17,17 +17,17 @@ class WebSocketState(enum.Enum):
class WebSocketDisconnect(Exception):
- def __init__(self, code: int = 1000, reason: str | None = None) ->... | ["tests/middleware/test_base.py::test_custom_middleware[asyncio]", "tests/middleware/test_base.py::test_custom_middleware[trio]", "tests/test_applications.py::test_websocket_route[asyncio]", "tests/test_applications.py::test_websocket_raise_websocket_exception[asyncio]", "tests/test_applications.py::test_websocket_rais... | ["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/test_base.py::test_contextvars[asyncio-CustomMiddlewareWithoutBaseHTT... | jyangballin/swesmith.x86_64.encode_1776_starlette.db5063c2 | true | null | 1 | 15 | 119 | 951 | 0 | 0.6 | 1 | 0.75 | 1 | 0.2085 | 80.9005 | |||
7,978 | swe_smith::train::20848 | swe_smith | train | 20,848 | tobymao__sqlglot.036601ba.func_pm_remove_assign__3f2yfisy | swesmith/tobymao__sqlglot.036601ba | tobymao/sqlglot | python | null | Simplify optimizer throws UnboundLocalError for certain expressions
#### Description
The simplify optimizer is throwing an `UnboundLocalError` when processing certain SQL expressions. This appears to be related to variable assignment logic in the equality simplification function.
#### Steps/Code to Reproduce
```pyt... | diff --git a/sqlglot/optimizer/simplify.py b/sqlglot/optimizer/simplify.py
index 3f0f732..f404317 100644
--- a/sqlglot/optimizer/simplify.py
+++ b/sqlglot/optimizer/simplify.py
@@ -599,8 +599,7 @@ def simplify_equality(expression: exp.Expression) -> exp.Expression:
return expression
if r.is_numb... | ["tests/test_optimizer.py::TestOptimizer::test_simplify", "tests/test_optimizer.py::TestOptimizer::test_tpcds"] | ["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 | 9 | 2 | 1,070 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208333 | 80.9 | |||
7,979 | swe_smith::train::40936 | swe_smith | train | 40,936 | scanny__python-pptx.278b47b1.func_basic__d1hmg3f7 | swesmith/scanny__python-pptx.278b47b1 | scanny/python-pptx | python | null | Date property assignment fails with datetime objects
#### Description
When setting date properties on core properties, datetime objects are being rejected with a type error. The validation logic appears to be checking for the wrong type.
#### Steps/Code to Reproduce
```python
from pptx import Presentation
import da... | diff --git a/src/pptx/oxml/coreprops.py b/src/pptx/oxml/coreprops.py
index de6b26b..5b09edb 100644
--- a/src/pptx/oxml/coreprops.py
+++ b/src/pptx/oxml/coreprops.py
@@ -255,19 +255,16 @@ class CT_CoreProperties(BaseOxmlElement):
def _set_element_datetime(self, prop_name: str, value: dt.datetime) -> None:
... | ["tests/parts/test_coreprops.py::DescribeCorePropertiesPart::it_can_change_the_date_property_values[last_printed-cp:lastPrinted-value1-2014-06-04T04:00:00Z-]", "tests/parts/test_coreprops.py::DescribeCorePropertiesPart::it_can_construct_a_default_core_props"] | ["tests/chart/test_axis.py::Describe_BaseAxis::it_provides_access_to_its_title[c:catAx]", "tests/chart/test_axis.py::Describe_BaseAxis::it_provides_access_to_its_title[c:dateAx]", "tests/chart/test_axis.py::Describe_BaseAxis::it_provides_access_to_its_title[c:valAx]", "tests/chart/test_axis.py::Describe_BaseAxis::it_pr... | jyangballin/swesmith.x86_64.scanny_1776_python-pptx.278b47b1 | true | null | 1 | 15 | 2 | 950 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208333 | 80.9 | |||
7,980 | swe_smith::train::24381 | swe_smith | train | 24,381 | sunpy__sunpy.f8edfd5c.func_pm_remove_wrapper__d4l3c6f5 | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | CDF file reading broken after recent changes
#### Description
CDF files are no longer being read properly by the TimeSeries factory. When trying to load CDF files, the factory fails to detect them as CDF files and falls back to generic file reading, which then fails with a NoMatchError.
#### Steps/Code to Reproduce
... | diff --git a/sunpy/timeseries/timeseries_factory.py b/sunpy/timeseries/timeseries_factory.py
index e5f59d1..4d3cece 100644
--- a/sunpy/timeseries/timeseries_factory.py
+++ b/sunpy/timeseries/timeseries_factory.py
@@ -140,15 +140,6 @@ class TimeSeriesFactory(BasicRegistrationFactory):
List of ``(data, heade... | ["sunpy/timeseries/tests/test_timeseries_factory.py::test_read_cdf", "sunpy/timeseries/tests/test_timeseries_factory.py::test_read_empty_cdf"] | ["sunpy/timeseries/metadata.py::sunpy.timeseries.metadata.TimeSeriesMetaData", "sunpy/timeseries/sources/eve.py::sunpy.timeseries.sources.eve.EVESpWxTimeSeries", "sunpy/timeseries/sources/fermi_gbm.py::sunpy.timeseries.sources.fermi_gbm.GBMSummaryTimeSeries", "sunpy/timeseries/sources/goes.py::sunpy.timeseries.sources.... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 10 | 2 | 1,050 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208333 | 80.9 | |||
7,981 | swe_smith::train::43576 | swe_smith | train | 43,576 | cloudpipe__cloudpickle.6220b0ce.func_basic__7nqi0xrb | swesmith/cloudpipe__cloudpickle.6220b0ce | cloudpipe/cloudpickle | python | null | Pickling classes fails with TypeError when using vars() instead of getattr()
#### Description
When pickling classes, cloudpickle now raises a `TypeError: 'NoneType' object is not iterable` error. This appears to be related to how class bases are retrieved during the pickling process.
#### Steps/Code to Reproduce
``... | diff --git a/cloudpickle/cloudpickle.py b/cloudpickle/cloudpickle.py
index 8c50ba1..d31a6cc 100644
--- a/cloudpickle/cloudpickle.py
+++ b/cloudpickle/cloudpickle.py
@@ -617,16 +617,11 @@ def _typevar_reduce(obj):
def _get_bases(typ):
if "__orig_bases__" in getattr(typ, "__dict__", {}):
- # For generic ty... | ["tests/cloudpickle_test.py::CloudPickleTest::test_abc", "tests/cloudpickle_test.py::CloudPickleTest::test_abc_cache_not_pickled", "tests/cloudpickle_test.py::CloudPickleTest::test_abstracts", "tests/cloudpickle_test.py::CloudPickleTest::test_always_use_up_to_date_copyreg", "tests/cloudpickle_test.py::CloudPickleTest::... | ["tests/cloudpickle_file_test.py::CloudPickleFileTests::test_closed_file", "tests/cloudpickle_file_test.py::CloudPickleFileTests::test_empty_file", "tests/cloudpickle_file_test.py::CloudPickleFileTests::test_pickling_special_file_handles", "tests/cloudpickle_file_test.py::CloudPickleFileTests::test_plus_mode", "tests/c... | jyangballin/swesmith.x86_64.cloudpipe_1776_cloudpickle.6220b0ce | true | null | 1 | 9 | 63 | 1,070 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208333 | 80.9 | |||
7,982 | swe_smith::train::18542 | swe_smith | train | 18,542 | HIPS__autograd.ac044f0d.lm_rewrite__lzl17rhq | swesmith/HIPS__autograd.ac044f0d | hips/autograd | python | null | ### Issue: `solve` Function Fails with Non-Square Matrices
**Describe the bug**
The `solve` function is currently failing when provided with non-square matrices. This results in a `ValueError` or `AxisError`, which is unexpected behavior for inputs that should be valid.
**To Reproduce**
Steps to reproduce the behavio... | diff --git a/autograd/numpy/linalg.py b/autograd/numpy/linalg.py
index b400a55..a7b7b62 100644
--- a/autograd/numpy/linalg.py
+++ b/autograd/numpy/linalg.py
@@ -65,12 +65,11 @@ defvjp(pinv, grad_pinv)
def grad_solve(argnum, ans, a, b):
- updim = lambda x: x if x.ndim == a.ndim else x[..., None]
+ """Gradient... | ["tests/test_linalg.py::test_solve_arg1", "tests/test_linalg.py::test_solve_arg1_1d", "tests/test_linalg.py::test_solve_arg2", "tests/test_linalg.py::test_solve_arg1_3d", "tests/test_linalg.py::test_solve_arg1_3d_3d", "tests/test_linalg.py::test_cholesky", "tests/test_linalg.py::test_cholesky_broadcast", "tests/test_li... | ["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 | 7 | 12 | 1,110 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208333 | 80.9 | |||
7,983 | swe_smith::train::10283 | swe_smith | train | 10,283 | paramiko__paramiko.23f92003.func_basic__3nw53emd | swesmith/paramiko__paramiko.23f92003 | paramiko/paramiko | python | null | BadHostKeyException constructor arguments swapped causing incorrect error messages
#### Description
When creating a `BadHostKeyException`, the constructor arguments appear to be getting mixed up, resulting in error messages that show the wrong hostname and swapped key information.
#### Steps/Code to Reproduce
```py... | diff --git a/paramiko/ssh_exception.py b/paramiko/ssh_exception.py
index 2b68ebe..b9db5f4 100644
--- a/paramiko/ssh_exception.py
+++ b/paramiko/ssh_exception.py
@@ -124,10 +124,10 @@ class BadHostKeyException(SSHException):
"""
def __init__(self, hostname, got_key, expected_key):
- SSHException.__ini... | ["tests/test_ssh_exception.py::ExceptionStringDisplayTest::test_BadHostKeyException"] | ["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 | 8 | 1 | 1,089 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,984 | swe_smith::train::20575 | swe_smith | train | 20,575 | tobymao__sqlglot.036601ba.func_pm_ctrl_shuffle__64dgmblz | swesmith/tobymao__sqlglot.036601ba | tobymao/sqlglot | python | null | UnboundLocalError in Hive dialect date functions
#### Description
When using date functions in the Hive dialect, an `UnboundLocalError` is raised for variables `func` and `increment` that are referenced before assignment.
#### Steps/Code to Reproduce
```python
import sqlglot
# This will raise UnboundLocalError
sql... | diff --git a/sqlglot/dialects/hive.py b/sqlglot/dialects/hive.py
index 6084d44..2c177a9 100644
--- a/sqlglot/dialects/hive.py
+++ b/sqlglot/dialects/hive.py
@@ -64,25 +64,24 @@ DIFF_MONTH_SWITCH = ("YEAR", "QUARTER", "MONTH")
def _add_date_sql(self: Hive.Generator, expression: DATE_ADD_OR_SUB) -> str:
- if isin... | ["tests/dialects/test_hive.py::TestHive::test_hive", "tests/dialects/test_hive.py::TestHive::test_time"] | ["tests/dialects/test_hive.py::TestHive::test_bits", "tests/dialects/test_hive.py::TestHive::test_cast", "tests/dialects/test_hive.py::TestHive::test_data_type", "tests/dialects/test_hive.py::TestHive::test_ddl", "tests/dialects/test_hive.py::TestHive::test_escapes", "tests/dialects/test_hive.py::TestHive::test_lateral... | jyangballin/swesmith.x86_64.tobymao_1776_sqlglot.036601ba | true | null | 1 | 13 | 2 | 989 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,985 | swe_smith::train::3054 | swe_smith | train | 3,054 | Suor__funcy.207a7810.func_basic__5avqau5l | swesmith/Suor__funcy.207a7810 | suor/funcy | python | null | Lookuper decorator behavior changed unexpectedly
Description
The `make_lookuper` decorator is not working as expected. When looking up values that exist in the lookup table, it's raising a `ValueError` instead of returning the value. Also, when looking up values that don't exist, it's returning the argument itself in... | diff --git a/funcy/calc.py b/funcy/calc.py
index 2966bdd..a364752 100644
--- a/funcy/calc.py
+++ b/funcy/calc.py
@@ -127,15 +127,15 @@ def _make_lookuper(silent):
def wrapper(arg):
if not memory:
- memory[object()] = None # prevent continuos memory refilling
+ ... | ["tests/test_calc.py::test_make_lookuper", "tests/test_calc.py::test_make_lookuper_nested"] | ["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_silent_lookuper", "tests/test_calc.py::test_silnent_lookuper_nested", "tests/tes... | jyangballin/swesmith.x86_64.suor_1776_funcy.207a7810 | true | null | 1 | 8 | 2 | 1,089 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,986 | swe_smith::train::39941 | swe_smith | train | 39,941 | tornadoweb__tornado.d5ac65c1.lm_rewrite__o1z2c945 | swesmith/tornadoweb__tornado.d5ac65c1 | tornadoweb/tornado | python | null | WebSocket StreamClosedError on Connection
Description
After the recent changes, it seems that the WebSocket connections are unexpectedly closing, resulting in a `StreamClosedError`. This issue occurs when attempting to establish a WebSocket connection, and it appears to be affecting multiple test cases.
To reproduce... | diff --git a/tornado/websocket.py b/tornado/websocket.py
index 1e0161e..a1c1eca 100644
--- a/tornado/websocket.py
+++ b/tornado/websocket.py
@@ -1280,12 +1280,12 @@ class WebSocketProtocol13(WebSocketProtocol):
return self.stream.closed() or self.client_terminated or self.server_terminated
@property
- ... | ["test_message_sizes (tornado.test.websocket_test.ClientOnlyCompressionTest)", "test_size_limit (tornado.test.websocket_test.ClientOnlyCompressionTest)", "test_client_ping (tornado.test.websocket_test.ClientPeriodicPingTest)", "test_message_sizes (tornado.test.websocket_test.DefaultCompressionTest)", "test_size_limit (... | ["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 | 10 | 40 | 1,049 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,987 | swe_smith::train::24284 | swe_smith | train | 24,284 | sunpy__sunpy.f8edfd5c.func_pm_remove_assign__zfyooyuw | swesmith/sunpy__sunpy.f8edfd5c | sunpy/sunpy | python | null | NameError in _repr_html_() method after recent changes
#### Description
The `_repr_html_()` method in GenericMap is throwing a `NameError: name 'partial_html' is not defined` when called. This affects both the HTML representation in Jupyter notebooks and the quicklook functionality.
#### Steps/Code to Reproduce
```... | diff --git a/sunpy/map/mapbase.py b/sunpy/map/mapbase.py
index bdcac77..add5215 100644
--- a/sunpy/map/mapbase.py
+++ b/sunpy/map/mapbase.py
@@ -338,9 +338,6 @@ class GenericMap(NDData):
"""
Produce an HTML summary with plots for use in Jupyter notebooks.
"""
- # Convert the text repr ... | ["sunpy/map/tests/test_mapbase.py::test_repr_html", "sunpy/map/tests/test_mapbase.py::test_quicklook"] | ["sunpy/map/tests/test_mapbase.py::test_notes_combined", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_references", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_existing_notes", "sunpy/map/tests/test_mapbase.py::test_notes_combined_no_notes_no_references", "sunpy/map/tests/test_mapbase.py::test_f... | jyangballin/swesmith.x86_64.sunpy_1776_sunpy.f8edfd5c | true | null | 1 | 18 | 2 | 889 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,988 | swe_smith::train::22965 | swe_smith | train | 22,965 | graphql-python__graphene.82903263.func_pm_remove_cond__hak1hmke | swesmith/graphql-python__graphene.82903263 | graphql-python/graphene | python | null | DataLoader constructor fails to set batch_load_fn and batch attributes
#### Description
When creating a DataLoader instance, the `batch_load_fn` and `batch` parameters are not being properly assigned to the instance, causing AttributeError when the DataLoader tries to access these attributes.
#### Steps/Code to Repr... | diff --git a/graphene/utils/dataloader.py b/graphene/utils/dataloader.py
index c75b9ee..9032a15 100644
--- a/graphene/utils/dataloader.py
+++ b/graphene/utils/dataloader.py
@@ -35,9 +35,6 @@ class DataLoader(object):
):
self._loop = loop
- if batch_load_fn is not None:
- self.batch_loa... | ["graphene/utils/tests/test_dataloader.py::test_build_a_simple_data_loader", "graphene/utils/tests/test_dataloader.py::test_can_build_a_data_loader_from_a_partial", "graphene/utils/tests/test_dataloader.py::test_supports_loading_multiple_keys_in_one_call", "graphene/utils/tests/test_dataloader.py::test_batches_multiple... | ["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 | 7 | 19 | 1,109 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,989 | swe_smith::train::20884 | swe_smith | train | 20,884 | tobymao__sqlglot.036601ba.func_pm_remove_assign__g1cj5anx | swesmith/tobymao__sqlglot.036601ba | tobymao/sqlglot | python | null | NameError in eliminate_qualify transform when processing QUALIFY clauses
#### Description
The `eliminate_qualify` transform function raises a `NameError` when processing SQL queries with QUALIFY clauses. Variables that should be defined are missing from the function scope.
#### Steps/Code to Reproduce
```python
imp... | diff --git a/sqlglot/transforms.py b/sqlglot/transforms.py
index 10c0faf..6cecb74 100644
--- a/sqlglot/transforms.py
+++ b/sqlglot/transforms.py
@@ -235,7 +235,6 @@ def eliminate_qualify(expression: exp.Expression) -> exp.Expression:
corresponding expression to avoid creating invalid column references.
"""
... | ["tests/test_transforms.py::TestTransforms::test_eliminate_qualify"] | ["tests/test_transforms.py::TestTransforms::test_eliminate_distinct_on", "tests/test_transforms.py::TestTransforms::test_eliminate_join_marks", "tests/test_transforms.py::TestTransforms::test_remove_precision_parameterized_types", "tests/test_transforms.py::TestTransforms::test_unalias_group"] | jyangballin/swesmith.x86_64.tobymao_1776_sqlglot.036601ba | true | null | 1 | 9 | 1 | 1,069 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,990 | swe_smith::train::44436 | swe_smith | train | 44,436 | pydata__patsy.a5d16484.func_pm_remove_assign__wtnmnb3m | swesmith/pydata__patsy.a5d16484 | pydata/patsy | python | null | NameError in pretty_untokenize function after code cleanup
#### Description
The `pretty_untokenize` function in `patsy/tokens.py` is raising a `NameError: name 'text' is not defined` when processing tokens. This appears to be affecting formula parsing and token normalization throughout the library.
#### Steps/Code t... | diff --git a/patsy/tokens.py b/patsy/tokens.py
index 34d8efc..c7383e6 100644
--- a/patsy/tokens.py
+++ b/patsy/tokens.py
@@ -114,12 +114,9 @@ _python_space_after = _python_space_both + [",", ":"]
def pretty_untokenize(typed_tokens):
- text = []
prev_was_space_delim = False
prev_wants_space = False
... | ["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/eval.py::test_EvalFactor_basics", "patsy/eval.py::test_EvalFactor_memorize_passes_needed", "patsy/eval.py::test_EvalFactor_end_to_end... | ["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 | 8 | 35 | 1,089 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208167 | 80.8995 | |||
7,991 | swe_smith::train::43415 | swe_smith | train | 43,415 | theskumar__python-dotenv.2b8635b7.func_pm_remove_assign__i3tgb375 | swesmith/theskumar__python-dotenv.2b8635b7 | theskumar/python-dotenv | python | null | set_key function breaks when quote=False due to undefined variables
When calling `set_key` with `quote=False`, the function fails with `NameError` for undefined variables `value_out`, `line_out`, and `missing_newline`.
#### Steps/Code to Reproduce
```python
from dotenv import set_key
import tempfile
import os
# Cre... | diff --git a/src/dotenv/main.py b/src/dotenv/main.py
index 052de05..13f1faf 100644
--- a/src/dotenv/main.py
+++ b/src/dotenv/main.py
@@ -174,22 +174,20 @@ def set_key(
if quote:
value_out = "'{}'".format(value_to_set.replace("'", "\\'"))
else:
- value_out = value_to_set
+ pass
if e... | ["tests/test_cli.py::test_set_quote_options[always-a-x-a='x'\\n]", "tests/test_cli.py::test_set_quote_options[never-a-x-a=x\\n]", "tests/test_cli.py::test_set_quote_options[auto-a-x-a=x\\n]", "tests/test_cli.py::test_set_quote_options[auto-a-$-a='$'\\n]", "tests/test_cli.py::test_set_export[dotenv_path1-false-a-x-a='x'... | ["tests/test_cli.py::test_list[shell-x='a\\nb\\nc'-x='a\\nb\\nc'\\n]", "tests/test_cli.py::test_list_non_existent_file", "tests/test_cli.py::test_list_not_a_file", "tests/test_cli.py::test_list_no_file", "tests/test_cli.py::test_get_existing_value", "tests/test_cli.py::test_get_non_existent_value", "tests/test_cli.py::... | jyangballin/swesmith.x86_64.theskumar_1776_python-dotenv.2b8635b7 | true | null | 1 | 7 | 20 | 1,108 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208 | 80.899 | |||
7,992 | swe_smith::train::27138 | swe_smith | train | 27,138 | tkrajina__gpxpy.09fc46b3.func_pm_ctrl_shuffle__4oysqnh1 | swesmith/tkrajina__gpxpy.09fc46b3 | tkrajina/gpxpy | python | null | UnboundLocalError when calling get_nearest_locations before track segment is properly initialized
#### Description
When calling `get_nearest_locations()` on a GPX object before the track segments are fully set up, an `UnboundLocalError` occurs due to accessing a variable before it's defined.
#### Steps/Code to Repro... | diff --git a/test.py b/test.py
index 7dd6f44..55002c8 100644
--- a/test.py
+++ b/test.py
@@ -757,13 +757,16 @@ class GPXTests(mod_unittest.TestCase):
self.assertTrue(points_before - 3 == points_after)
def test_positions_on_track(self) -> None:
+
+ location_to_find_on_track = None
gpx = m... | ["test.py::GPXTests::test_positions_on_track"] | ["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 | 15 | 1 | 948 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208 | 80.899 | |||
7,993 | swe_smith::train::24598 | swe_smith | train | 24,598 | marshmallow-code__marshmallow.9716fc62.combine_module__m7xrgy94 | swesmith/marshmallow-code__marshmallow.9716fc62 | marshmallow-code/marshmallow | python | null | Range validator logic inverted causing incorrect validation behavior
#### Description
The Range validator is not working correctly - it's checking the wrong bounds and raising validation errors when values should be valid.
#### Steps/Code to Reproduce
```python
from marshmallow import validate
# This should pass b... | diff --git a/src/marshmallow/decorators.py b/src/marshmallow/decorators.py
index 965edb6..10cd16b 100644
--- a/src/marshmallow/decorators.py
+++ b/src/marshmallow/decorators.py
@@ -88,7 +88,7 @@ def validates(field_name: str) -> Callable[..., Any]:
:param str field_name: Name of the field that the method validat... | ["tests/test_decorators.py::test_decorated_processors[True]", "tests/test_decorators.py::test_decorated_processors[False]", "tests/test_decorators.py::TestPassOriginal::test_pass_original_many", "tests/test_decorators.py::TestValidatesDecorator::test_validates_decorator", "tests/test_decorators.py::TestValidatesDecorat... | ["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_decorated_processor_returning_none[raise]", "tests/test_decorators.py::TestPassOriginal::test_pass_original_single", "tests/test_de... | jyangballin/swesmith.x86_64.marshmallow-code_1776_marshmallow.9716fc62 | true | null | 2 | 8 | 18 | 1,088 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208 | 80.899 | |||
7,994 | swe_smith::train::42408 | swe_smith | train | 42,408 | r1chardj0n3s__parse.30da9e4f.func_pm_remove_cond__gwaw2yx7 | swesmith/r1chardj0n3s__parse.30da9e4f | r1chardj0n3s/parse | python | null | int_convert fails with NameError after removing sign handling code
#### Description
When using integer type conversion in parse patterns, the code throws a `NameError` because variables `sign` and `number_start` are not defined.
#### Steps/Code to Reproduce
```python
import parse
# This should work but throws Name... | diff --git a/parse.py b/parse.py
index 80242e1..0859ba3 100644
--- a/parse.py
+++ b/parse.py
@@ -68,15 +68,6 @@ class int_convert:
self.base = base
def __call__(self, string, match):
- if string[0] == "-":
- sign = -1
- number_start = 1
- elif string[0] == "+":
- ... | ["README.rst::README.rst", "tests/test_bugs.py::test_dotted_type_conversion_pull_8", "tests/test_bugs.py::test_unused_centered_alignment_bug", "tests/test_parse.py::test_typed", "tests/test_parse.py::test_custom_type", "tests/test_parse.py::test_named_repeated_type", "tests/test_parse.py::test_named_typed", "tests/test... | ["parse.py::parse.with_pattern", "tests/test_bugs.py::test_tz_compare_to_None", "tests/test_bugs.py::test_named_date_issue7", "tests/test_bugs.py::test_pm_overflow_issue16", "tests/test_bugs.py::test_pm_handling_issue57", "tests/test_bugs.py::test_user_type_with_group_count_issue60", "tests/test_bugs.py::test_unmatched... | jyangballin/swesmith.x86_64.r1chardj0n3s_1776_parse.30da9e4f | true | null | 1 | 10 | 17 | 1,048 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208 | 80.899 | |||
7,995 | swe_smith::train::8938 | swe_smith | train | 8,938 | pyupio__safety.7654596b.func_pm_remove_assign__p9yelof4 | swesmith/pyupio__safety.7654596b | pyupio/safety | python | null | License command fails with NameError for undefined variables
#### Description
When running the license command, the function crashes with a NameError because variables are referenced before being defined.
#### Steps/Code to Reproduce
```python
from safety.util import get_packages_licenses
from safety.util import re... | diff --git a/safety/util.py b/safety/util.py
index 420eb13..df170ee 100644
--- a/safety/util.py
+++ b/safety/util.py
@@ -1102,10 +1102,9 @@ def get_packages_licenses(*, packages: Optional[List[Package]] = None, licenses_
Returns:
List[Dict[str, Any]]: The list of packages and their licenses.
"""
- ... | ["tests/test_cli.py::TestSafetyCLI::test_license_with_file", "tests/test_safety.py::TestSafety::test_get_packages_licenses", "tests/test_safety.py::TestSafety::test_report_licenses_bare", "tests/test_safety.py::TestSafety::test_report_licenses_json"] | ["tests/test_cli.py::TestSafetyCLI::test_announcements_if_is_not_tty", "tests/test_cli.py::TestSafetyCLI::test_basic_html_output_pass", "tests/test_cli.py::TestSafetyCLI::test_check_continue_on_error", "tests/test_cli.py::TestSafetyCLI::test_check_ignore_format_backward_compatible", "tests/test_cli.py::TestSafetyCLI::t... | jyangballin/swesmith.x86_64.pyupio_1776_safety.7654596b | true | null | 1 | 11 | 4 | 1,028 | 0 | 0.6 | 1 | 0.75 | 1 | 0.208 | 80.899 | |||
7,996 | r2e_gym::train::5299 | r2e_gym | train | 5,299 | aiohttp__d2286ff6f0ebf3f477822dd081e257aa25a1477d | aiohttp | aio-libs/aiohttp | python | d2286ff6f0ebf3f477822dd081e257aa25a1477d | **Title:** WebSocket Handshake Fails When Specifying Subprotocols
**Description:**
When attempting to perform a WebSocket handshake with specified subprotocols, the handshake function does not accept the `protocols` argument. This results in errors that prevent successful negotiation of subprotocols and disrupt the ha... | diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -22,3 +22,4 @@
Simon Kennedy
Vaibhav Sagar
Vitaly Haritonsky
+Philipp A.
diff --git a/aiohttp/websocket.py b/aiohttp/websocket.py
--- a/aiohttp/websocket.py
+++ b/aiohttp/websocket.py
@@ -21,7 +21,7 @@
WS_KEY = b'258... | diff --git a/tests/test_websocket.py b/tests/test_websocket.py
--- a/tests/test_websocket.py
+++ b/tests/test_websocket.py
@@ -419,18 +419,54 @@
websocket.do_handshake,
self.message.method, self.message.headers, self.transport)
+ def gen_ws_headers(self, protocols=''):
+ key = base... | null | null | namanjain12/aiohttp_final:d2286ff6f0ebf3f477822dd081e257aa25a1477d | true | null | 2 | 42 | null | 1,120 | 0 | 0.75 | 1 | 0.6375 | 1 | 0.326667 | 80.89875 | ||
7,997 | swe_smith::train::39109 | swe_smith | train | 39,109 | pallets__jinja.ada0a9a6.func_basic__l57yri01 | swesmith/pallets__jinja.ada0a9a6 | pallets/jinja | python | null | Scope frame handling causes UnboundLocalError in template compilation
#### Description
When using Jinja2 templates with scope-related extensions, template compilation fails with `UnboundLocalError` due to improper frame handling in the code generator.
#### Steps/Code to Reproduce
```python
from jinja2 import Enviro... | diff --git a/src/jinja2/compiler.py b/src/jinja2/compiler.py
index 91720c5..2f910ad 100644
--- a/src/jinja2/compiler.py
+++ b/src/jinja2/compiler.py
@@ -1931,10 +1931,14 @@ class CodeGenerator(NodeVisitor):
def visit_Scope(self, node: nodes.Scope, frame: Frame) -> None:
scope_frame = frame.inner()
- ... | ["tests/test_ext.py::TestScope::test_basic_scope_behavior", "tests/test_ext.py::TestNewstyleInternationalization::test_autoescape_support", "tests/test_ext.py::TestAutoEscape::test_volatile", "tests/test_ext.py::TestAutoEscape::test_volatile_scoping"] | ["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 | 8 | 4 | 1,087 | 0 | 0.6 | 1 | 0.75 | 1 | 0.207833 | 80.8985 | |||
7,998 | swe_smith::train::27362 | swe_smith | train | 27,362 | tkrajina__gpxpy.09fc46b3.func_pm_remove_assign__t7gkdgz8 | swesmith/tkrajina__gpxpy.09fc46b3 | tkrajina/gpxpy | python | null | NameError when running GPX 1.1 field tests
When running the GPX 1.1 field validation tests, I'm getting a `NameError: name 'aaa' is not defined` error. It looks like some variable declarations got removed but the variables are still being used later in the test.
#### Steps to Reproduce
Run the test that validates GP... | diff --git a/test.py b/test.py
index 7dd6f44..fe59e7f 100644
--- a/test.py
+++ b/test.py
@@ -2296,16 +2296,12 @@ class GPXTests(mod_unittest.TestCase):
# TODO
self.assertEqual(len(gpx.metadata_extensions), 3)
- aaa = mod_etree.Element(namespace+'aaa')
... | ["test.py::GPXTests::test_gpx_11_fields"] | ["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 | 9 | 1 | 1,067 | 0 | 0.6 | 1 | 0.75 | 1 | 0.207833 | 80.8985 | |||
7,999 | swe_smith::train::48015 | swe_smith | train | 48,015 | sqlfluff__sqlfluff.50a1c4b6.func_basic__sb33huc6 | swesmith/sqlfluff__sqlfluff.50a1c4b6 | sqlfluff/sqlfluff | python | null | PythonTemplater crashes with AttributeError when processing files
#### Description
The PythonTemplater is throwing an AttributeError when trying to process template files. This appears to be related to the `get_context` method implementation.
#### Steps/Code to Reproduce
```python
from sqlfluff.core.templaters.pyth... | diff --git a/src/sqlfluff/core/templaters/python.py b/src/sqlfluff/core/templaters/python.py
index a2126a8..e19a90d 100644
--- a/src/sqlfluff/core/templaters/python.py
+++ b/src/sqlfluff/core/templaters/python.py
@@ -210,10 +210,12 @@ class PythonTemplater(RawTemplater):
Returns:
dict: The templat... | ["test/core/templaters/jinja_test.py::test__templater_jinja[simple]", "test/core/templaters/jinja_test.py::test__templater_jinja[unboundlocal_bugfix]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[basic_block]", "test/core/templaters/jinja_test.py::test__templater_jinja_slices[strip_left_block]", "... | ["test/core/templaters/base_test.py::test__indices_of_newlines[-positions0]", "test/core/templaters/base_test.py::test__indices_of_newlines[foo-positions1]", "test/core/templaters/base_test.py::test__indices_of_newlines[foo\\nbar-positions2]", "test/core/templaters/base_test.py::test__indices_of_newlines[\\nfoo\\n\\nba... | jyangballin/swesmith.x86_64.sqlfluff_1776_sqlfluff.50a1c4b6 | true | null | 1 | 6 | 71 | 1,127 | 0 | 0.6 | 1 | 0.75 | 1 | 0.207833 | 80.8985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.