Download data/tasks.jsonl from FineEnvs/repo2rlenv-r2e-gym: direct link, hf CLI and curl.
- Browser
- Download file 252 kB
-
https://huggingface.co/datasets/FineEnvs/repo2rlenv-r2e-gym/resolve/main/data/tasks.jsonl
- Command line
-
hf download hf://datasets/FineEnvs/repo2rlenv-r2e-gym/data/tasks.jsonl
-
curl -L -o tasks.jsonl https://huggingface.co/datasets/FineEnvs/repo2rlenv-r2e-gym/resolve/main/data/tasks.jsonl
252 kB
| {"task_id": "r2e-gym-0b19371cfc9ec1a22a7a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:1a2e22687aef1f9efc6acc10400c15e3da1d56568c6812d38182bde3a2d5bd60", "task_path": "tasks/r2e-gym-0b19371cfc9ec1a22a7a", "instruction": "## `product_index` raises `TypeError` when given iterator inputs\n\nWhen calling `product_index` with iterator arguments, a `TypeError` is raised because the function tries to call `len()` on the original iterator rather than on the already-converted tuple.\n\nHere's a minimal example that reproduces the issue:\n\n```python\nimport more_itertools as mi\n\n# Passing iterators instead of sequences\nresult = mi.product_index(iter(['i', 'a']), iter('snicker'), iter('snack'))\nprint(result) # Expected: 12\n```\n\nThis raises:\n```\nTypeError: object of type 'list_iterator' has no len()\n```\n\nThe function converts `element` and `args` into tuples early on, but the subsequent length validation check uses `len(element)` and `len(args)` — the originals — instead of the converted tuples. Since iterators don't support `len()`, passing any iterator as input causes a crash before the actual index computation.\n\n**Expected behavior:** `product_index` should accept iterators as inputs (just as it accepts sequences), and the validation check should use the lengths of the already-materialized tuples.\n\n**Actual behavior:** A `TypeError` is raised: `object of type 'list_iterator' has no len()`.\n\nThe fix should update the validation check to use the lengths of the converted tuples rather than the original arguments.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-35c6db5532547741de60", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:551c82c4d77c8e9465fc34268f8e90bc6dd999af07414c4200a1065c5d883927", "task_path": "tasks/r2e-gym-35c6db5532547741de60", "instruction": "## `value_chain` silently swallows `TypeError` raised while iterating an argument\n\nWhen an iterable passed to `value_chain` raises a `TypeError` during iteration (not during the initial `iter()` call), the error is silently swallowed instead of propagating to the caller.\n\nHere's a minimal example that demonstrates the problem:\n\n```python\nimport more_itertools as mi\n\ndef gen():\n yield 1\n yield 2\n raise TypeError('failure inside the iterable')\n\nit = mi.value_chain(gen(), 3)\nprint(next(it)) # 1\nprint(next(it)) # 2\nprint(next(it)) # Should raise TypeError, but instead returns 3 silently\n```\n\nThe generator `gen()` yields `1` and `2` correctly, then raises a `TypeError`. Instead of propagating that error, `value_chain` catches it and continues as if nothing happened — moving on to yield `3` from the next argument.\n\nThis happens because the current implementation wraps `yield from value` in a `try/except TypeError` block. The intent of the `except` clause is to catch objects that aren't iterable at all (so they can be yielded as scalars), but the broad catch also intercepts `TypeError` exceptions raised *from within* an iterable during consumption.\n\n**Expected behavior:** A `TypeError` raised while consuming an iterable argument should propagate to the caller, just like any other exception would.\n\n**Actual behavior:** The `TypeError` is silently caught, the remainder of the iterable is discarded, and iteration continues with the next argument as if nothing went wrong.\n\nNote: the behavior for genuinely non-iterable objects (e.g. an object whose `__iter__` raises `TypeError`) should remain unchanged — such objects should still be yielded as scalar values.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-36c81f3d2d8f9e4a429b", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:8a0a81986fa97ae39692136004c6efec88917f5bf98c1cadc68996cee2b43b84", "task_path": "tasks/r2e-gym-36c81f3d2d8f9e4a429b", "instruction": "## `powerset_of_sets()` does not support a `baseset` parameter\n\n### Description\n\nThe `powerset_of_sets()` function always yields plain `set` objects. There is no way to request `frozenset` outputs, which means the results can't be collected into a `set` (since `set` is not hashable).\n\nFor example, trying to deduplicate or store the powerset in a `set` container fails:\n\n```python\nimport more_itertools as mi\n\n# This raises TypeError because set is not hashable\nps = set(mi.powerset_of_sets('abc'))\n```\n\nA `baseset` keyword argument should be supported so callers can choose between `set` and `frozenset` outputs:\n\n```python\nimport more_itertools as mi\n\n# Should work: request frozenset outputs\nfor kind in (set, frozenset):\n ps = list(mi.powerset_of_sets([0, 1, 2], baseset=kind))\n print(set(map(type, ps))) # should be {kind}\n\n# Should allow collecting into a set\nps = set(mi.powerset_of_sets('abc', baseset=frozenset))\nprint({'a', 'b'} in ps) # should be True\n```\n\nCurrently, calling `powerset_of_sets` with `baseset=frozenset` raises:\n\n```\nTypeError: powerset_of_sets() got an unexpected keyword argument 'baseset'\n```\n\n### Expected behavior\n\n`powerset_of_sets()` should accept a keyword-only `baseset` parameter (defaulting to `set`) that controls the type of the yielded subsets. When `baseset=frozenset` is passed, all yielded subsets should be `frozenset` instances, making them hashable and usable in sets or as dictionary keys.\n\n### Actual behavior\n\nThe function signature is `powerset_of_sets(iterable)` with no `baseset` parameter, so passing `baseset=set` or `baseset=frozenset` raises a `TypeError`.\n\n### Fix\n\nAdd a `baseset` keyword-only argument to `powerset_of_sets` in `more_itertools/more.py` and use it when constructing the union of each combination of sets.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-4d85779d48424cc78938", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:e0f273393c1acebb3df69372e3eb247bb3f4a232c4642d40f84a44a9cfa329c7", "task_path": "tasks/r2e-gym-4d85779d48424cc78938", "instruction": "## `interleave_evenly` raises `IndexError` when called with no iterables\n\n### Description\n\nCalling `interleave_evenly` with an empty list of iterables raises an `IndexError` instead of returning an empty iterator. This is a straightforward edge case: passing zero iterables should simply yield nothing.\n\n```python\nimport more_itertools as mi\n\n# Both of these raise IndexError instead of returning []\nresult1 = list(mi.interleave_evenly([]))\nresult2 = list(mi.interleave_evenly([], lengths=[]))\n```\n\n### Error\n\n```\nIndexError: list index out of range\n```\n\nThe traceback points to the internal unpacking step inside `interleave_evenly` where it tries to access the first element of the sorted lengths list:\n\n```\nmore_itertools/more.py: in interleave_evenly\n delta_primary, deltas_secondary = lengths_desc[0], lengths_desc[1:]\n ^^^^^^^^^^^^^^^\nIndexError: list index out of range\n```\n\n### Expected behavior\n\nWhen called with an empty sequence of iterables (with or without an explicit `lengths=[]`), `interleave_evenly` should return an empty iterator, so `list(mi.interleave_evenly([]))` produces `[]`.\n\n### Fix\n\nAdd a guard at the start of the function that returns early when no iterables are provided (i.e., when `dims == 0`).\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-50e37f1f26bff65e263b", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:752787f5a70e81fd21844f91b6e4375624922718ad0a8ef40808d0797afaeae8", "task_path": "tasks/r2e-gym-50e37f1f26bff65e263b", "instruction": "## `last()` raises incorrect `ValueError` when `__reversed__` is set to `None`\n\n### Description\n\nWhen an iterable class explicitly sets `__reversed__ = None` (which is a valid Python pattern to signal that an object is not reversible), `more_itertools.last()` incorrectly raises a `ValueError` claiming the iterable is empty, even when it isn't.\n\nThe issue is in the `last()` implementation, which uses `hasattr(iterable, '__reversed__')` to decide whether to call `reversed()`. Since `hasattr` returns `True` even when the attribute exists but is `None`, the code tries to call `reversed()` on the object, which raises a `TypeError`. The exception handler then incorrectly interprets this as the iterable being empty.\n\n### Reproducer\n\n```python\nimport more_itertools as mi\n\nclass ReversedIsNone:\n __reversed__ = None # explicitly marks the object as non-reversible\n\n def __iter__(self):\n return iter([1])\n\nresult = mi.last(ReversedIsNone())\nprint(result) # should print 1\n```\n\n### Expected behavior\n\n`mi.last(ReversedIsNone())` should return `1`, since the iterable yields one element. When `__reversed__` is `None`, `last()` should fall back to consuming the iterable via `__iter__` rather than attempting to call `reversed()`.\n\n### Actual behavior\n\nA `ValueError` is raised:\n\n```\nValueError: last() was called on an empty iterable, and no default value was provided.\n```\n\nThis is misleading because the iterable is not empty — it contains the element `1`. The root cause is that `hasattr(iterable, '__reversed__')` returns `True` even when `__reversed__` is `None`, so `reversed(iterable)` is attempted and fails with a `TypeError`, which is then caught and re-raised as a spurious \"empty iterable\" error.\n\n### Fix suggestion\n\nReplace the `hasattr` check with a truthiness check (e.g., `getattr(iterable, '__reversed__', None)`) so that `__reversed__ = None` is correctly treated as \"not reversible\".\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-53c4002d7c95f0dc4bbd", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:d2bb78cbca176df045201cc6d4f1295b68f6174a4988064f9bf0feb89d9c11a8", "task_path": "tasks/r2e-gym-53c4002d7c95f0dc4bbd", "instruction": "## `iequals` returns `True` when comparing iterables of different lengths if one contains `mock.ANY`\n\n### Description\n\nThe `iequals` function from `more-itertools` incorrectly returns `True` when comparing an empty iterable with a non-empty iterable, if the non-empty one contains `mock.ANY` (or any object that compares equal to everything).\n\nThe issue is that internally `iequals` uses `zip_longest` with a `fillvalue=object()` sentinel to detect length mismatches. However, `mock.ANY` compares equal to *any* object — including that sentinel — so the length difference goes undetected.\n\n### Reproducer\n\n```python\nfrom unittest import mock\nimport more_itertools as mi\n\nresult = mi.iequals([], [mock.ANY])\nprint(result) # prints True, but should print False\n```\n\nYou can also verify this with any custom class that overrides `__eq__` to always return `True`:\n\n```python\nclass AlwaysEqual:\n def __eq__(self, other):\n return True\n\nresult = mi.iequals([], [AlwaysEqual()])\nprint(result) # also prints True incorrectly\n```\n\n### Expected behavior\n\n`iequals([], [mock.ANY])` should return `False` because the two iterables have different lengths — one is empty and the other has one element. Iterables of unequal length cannot be equal.\n\n### Actual behavior\n\nReturns `True` instead of `False`. The sentinel `object()` used as the fill value for the shorter iterable ends up being compared against `mock.ANY`, which always reports equality, masking the length difference entirely.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-55f0f0827cb418494c1a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:3f529fb1ed685c06aa55cf651254d94d518d515ed439ec92bcb5ce69a250d9b3", "task_path": "tasks/r2e-gym-55f0f0827cb418494c1a", "instruction": "## `gray_product` and `partial_product` fail when iterators are passed with `repeat` argument\n\n### Description\n\nWhen passing iterator objects (as opposed to sequences) to `gray_product` or `partial_product` along with a `repeat` argument greater than 1, the results are incorrect.\n\nFor `gray_product`, a `ValueError` is raised:\n\n```python\nimport more_itertools as mi\n\n# Raises ValueError: each iterable must have two or more items\nresult = list(mi.gray_product(iter('abc'), iter('def'), repeat=2))\n```\n\nFor `partial_product`, the output is truncated/wrong compared to using sequences directly:\n\n```python\nimport more_itertools as mi\n\nwith_iterators = list(mi.partial_product(iter('abc'), iter('def'), repeat=2))\nwith_sequences = list(mi.partial_product('abc', 'def', repeat=2))\n\nprint(with_iterators) # Only 3 tuples, all wrong\nprint(with_sequences) # 9 tuples, correct\n```\n\nThe `with_iterators` result contains only 3 elements like `[('a', 'd', 'b', 'e'), ('c', 'd', 'b', 'e'), ('c', 'f', 'b', 'e')]`, while `with_sequences` correctly produces 9 elements starting with `[('a', 'd', 'a', 'd'), ('b', 'd', 'a', 'd'), ...]`.\n\n### Root Cause\n\nThe issue is that when `repeat > 1`, the code multiplies the tuple of iterators directly. Since iterators are stateful and single-use, repeating the same iterator object means subsequent passes over it yield nothing (it's already exhausted). The iterables need to be materialized (converted to tuples) before the repeat is applied.\n\n### Expected Behavior\n\nPassing iterator arguments should produce the same result as passing equivalent sequences:\n\n```python\nlist(mi.gray_product(iter('abc'), iter('def'), repeat=2))\n# should equal\nlist(mi.gray_product('abc', 'def', repeat=2))\n```\n\nSame for `partial_product`.\n\n### Actual Behavior\n\n- `gray_product` raises `ValueError: each iterable must have two or more items` because the repeated iterator references are already exhausted.\n- `partial_product` silently returns a truncated and incorrect result.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-5b258a93a37c35a60533", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:353a390d9b03c95997fc940f3cb64149795d5babacba8e3c61b58234b2ce16be", "task_path": "tasks/r2e-gym-5b258a93a37c35a60533", "instruction": "## Bug: `reversed()` on empty `numeric_range` raises `IndexError`\n\nCalling `reversed()` on an empty `numeric_range` object raises an `IndexError` instead of returning an empty iterator.\n\n### Steps to reproduce\n\n```python\nimport more_itertools as mi\n\nresult = list(reversed(mi.numeric_range(0)))\nprint(result) # should print []\n```\n\nThis raises:\n\n```\nIndexError: numeric range object index out of range\n```\n\nThe traceback points to the `__reversed__` method, which unconditionally tries to access the last element (index `-1`) of the range in order to construct the reversed iterator. When the range is empty, no such element exists, so `_get_by_index(-1)` raises an `IndexError`.\n\n### Expected behavior\n\nReversing an empty `numeric_range` should return an empty iterator, consistent with how Python's built-in `range` behaves:\n\n```python\nlist(reversed(range(0))) # returns []\n```\n\n### Actual behavior\n\n`reversed(mi.numeric_range(0))` raises `IndexError: numeric range object index out of range`.\n\nThe fix should guard against the empty-range case in `numeric_range.__reversed__`, returning an empty iterator when the range contains no elements.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-67563031624da23170ae", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:f023e55fd25a5b9c15b99cfc3e4d137f4f8e9bee0cfbc646e4452de9669140ba", "task_path": "tasks/r2e-gym-67563031624da23170ae", "instruction": "## `numeric_range` slicing with negative step returns wrong result\n\nWhen slicing a `numeric_range` that has a negative step using a negative slice step (e.g., `[::-1]` to reverse it), the result is incorrect — an empty range is returned instead of the expected reversed range.\n\n### Example\n\n```python\nfrom more_itertools import numeric_range\n\nnr = numeric_range(10.0, 0.0, -2.0)\nprint(list(nr)) # [10.0, 8.0, 6.0, 4.0, 2.0]\n\nreversed_nr = nr[::-1]\nprint(list(reversed_nr)) # Expected: [2.0, 4.0, 6.0, 8.0, 10.0]\n # Actual: []\n\nprint(reversed_nr) # Actual: numeric_range(10.0, 0.0, 2.0) <- empty!\n # Expected: numeric_range(2.0, 12.0, 2.0)\n```\n\nThe resulting `numeric_range(10.0, 0.0, 2.0)` is empty because `start > stop` with a positive step. The expected result when reversing `numeric_range(10.0, 0.0, -2.0)` is `numeric_range(2.0, 12.0, 2.0)`, which correctly iterates `2.0, 4.0, 6.0, 8.0, 10.0`.\n\n### Expected behavior\n\nSlicing a `numeric_range` with a negative slice step should correctly reverse the range. For `numeric_range(10.0, 0.0, -2.0)[::- 1]`, the result should be equivalent to `numeric_range(2.0, 12.0, 2.0)` — a range that produces `[2.0, 4.0, 6.0, 8.0, 10.0]`.\n\n### Actual behavior\n\nThe slice returns `numeric_range(10.0, 0.0, 2.0)`, which is an empty range (since start `10.0` is greater than stop `0.0` with a positive step `2.0`). The start and stop values are not correctly recomputed when both the range step and the slice step are negative.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-82ae55eeacd375fd11b9", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:127b4230727564302f0ba3b1722bf8f8987804c6b0676ce4e8fd495bc931ef1d", "task_path": "tasks/r2e-gym-82ae55eeacd375fd11b9", "instruction": "## `constrained_batches` silently accepts non-positive `max_count` values\n\n### Description\n\nThe `constrained_batches` function accepts a `max_count` argument to limit the number of items per batch. However, passing a value of `0` or a negative integer (e.g., `-1`) does not raise any error — the function just silently accepts these nonsensical values.\n\nFor comparison, passing `max_size <= 0` already correctly raises a `ValueError`. The same validation is missing for `max_count`.\n\n### Example\n\n```python\nimport more_itertools as mi\n\n# These should raise ValueError but currently don't:\nlist(mi.constrained_batches(iter(['a', 'b']), 10, 0))\nlist(mi.constrained_batches(iter(['a', 'b']), 10, -1))\n```\n\nNo exception is raised in either case.\n\n### Expected behavior\n\nWhen `max_count` is `0` or negative, a `ValueError` should be raised immediately with the message `'maximum count must be greater than zero'`, before any items are consumed from the iterable.\n\n### Actual behavior\n\nNo exception is raised. The function proceeds as if `max_count` were a valid positive integer, which can lead to incorrect or undefined batching behavior.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-8b05c71e48fd71cc41f1", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:4616ef522d3bc131231a057560e64ea6ad74cb192adf7ab8983d6e17cfceb726", "task_path": "tasks/r2e-gym-8b05c71e48fd71cc41f1", "instruction": "## `combination_with_replacement_index` gives wrong results and fails to raise errors when `None` is in the iterable or element\n\nWhen using `combination_with_replacement_index` with an iterable or element that contains `None`, the function returns incorrect indices and fails to raise `ValueError` for invalid inputs.\n\n### Wrong index returned\n\nIf the iterable contains `None`, the returned index is wrong:\n\n```python\nfrom itertools import combinations_with_replacement\nimport more_itertools as mi\n\niterable = [1, None, 2]\n# None is at index 1 in the iterable, so (None,) should be the 2nd combination (index 1)\nfor index, element in enumerate(combinations_with_replacement(iterable, 1)):\n result = mi.combination_with_replacement_index(iter(element), iter(iterable))\n print(f'element={element}, expected={index}, got={result}')\n```\n\nExpected output:\n```\nelement=(1,), expected=0, got=0\nelement=(None,), expected=1, got=2 # <-- wrong, returns 2 instead of 1\nelement=(2,), expected=2, got=2\n```\n\nSimilarly for multi-element combinations like `(1, None)`, `(None, None)`, etc., the returned index is off.\n\n### ValueError not raised for invalid inputs containing `None`\n\nWhen the element contains `None` but `None` is not present in the iterable, a `ValueError` should be raised (just like any other invalid element), but it isn't:\n\n```python\nimport more_itertools as mi\n\n# None is not in [1, 2], so this should raise ValueError\nmi.combination_with_replacement_index((None,), [1, 2]) # no error raised!\n\n# None appears after 1 in the iterable [None, 1], but (1, None) is not a valid\n# combination with replacement (elements must be non-decreasing by position)\nmi.combination_with_replacement_index((1, None), [None, 1]) # no error raised!\n```\n\nBoth calls should raise `ValueError` indicating the element is not a valid combination with replacement of the iterable.\n\n### Expected behavior\n\n- When the iterable contains `None`, `combination_with_replacement_index` should return the correct index corresponding to the position in the sequence generated by `itertools.combinations_with_replacement`.\n- When the element is not a valid combination with replacement of the iterable (including cases where `None` appears in the element but not in the iterable, or in an invalid order), a `ValueError` should be raised.\n\n### Root cause\n\nThe function internally uses `None` as a sentinel value to detect the end of iteration (via `next(element, (None, None))`). This sentinel conflicts with actual `None` values in the element or iterable, causing incorrect behavior.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-8dc5d49c05b68bdb12a1", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:5ed234dc20644b63de0d6c1bc1f0a7bca7e2b4f22332312dcf89f7b502647a34", "task_path": "tasks/r2e-gym-8dc5d49c05b68bdb12a1", "instruction": "## Bug: `exactly_n` raises `ValueError` for negative `n` values\n\nWhen calling `exactly_n` with a negative value for `n`, a `ValueError` is raised instead of returning `False`.\n\nSince no iterable can contain a negative number of elements satisfying a predicate, `exactly_n` should always return `False` when `n < 0`. But currently, the implementation passes `n + 1` directly to `islice()`, which rejects negative integers.\n\n### Reproducer\n\n```python\nimport more_itertools as mi\n\n# Should return False — an iterable can't have -10 True elements\nresult = mi.exactly_n([True], -10)\nprint(result) # Expected: False\n\n# Same issue with an empty iterable and negative n\nresult2 = mi.exactly_n([], -1)\nprint(result2) # Expected: False\n```\n\n### Error\n\n```\nValueError: Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n```\n\nThis happens because the internal implementation does `islice(filter(predicate, iterable), n + 1)`, and when `n` is `-10`, `n + 1` is `-9`, which `islice` refuses to accept.\n\n### Expected behavior\n\n`exactly_n(iterable, n)` should return `False` for any negative `n`, regardless of the contents of the iterable, without raising an exception.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-9bd0fd7bbe785ac41994", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:42816d1c6d678bfb668dd43982b2d59db61b42194fd3d8c1c0a0b8e7670d9257", "task_path": "tasks/r2e-gym-9bd0fd7bbe785ac41994", "instruction": "## `peekable` is not subscriptable for generic type annotations\n\nThe `peekable` class from `more-itertools` does not support generic type subscript syntax (e.g., `peekable[str]`), which is standard behavior for built-in Python containers like `list[str]` or `deque[str]` since Python 3.9.\n\n### Steps to reproduce\n\n```python\nimport types\nimport more_itertools as mi\n\n# This raises TypeError\nalias = mi.peekable[str]\nprint(alias) # Expected: more_itertools.more.peekable[str]\nprint(isinstance(alias, types.GenericAlias)) # Expected: True\nprint(alias.__origin__ is mi.peekable) # Expected: True\nprint(alias.__args__) # Expected: (str,)\n```\n\n### Error\n\n```\nTypeError: type 'peekable' is not subscriptable\n```\n\n### Expected behavior\n\n`peekable[str]` should return a `types.GenericAlias` instance (just like `list[str]` does), with `__origin__` set to `peekable` and `__args__` set to `(str,)`. This would allow `peekable` to be used in generic type annotations at runtime, e.g., as a return type hint `-> peekable[int]`.\n\n### Actual behavior\n\nAttempting to subscript `peekable` with a type raises `TypeError: type 'peekable' is not subscriptable`. The class is missing `__class_getitem__` support.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-9be39cbb00d55a837a52", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:7bb103ff4807788daedccee1df1973dccae64786ff1fdf3712aee0e5d517c4bd", "task_path": "tasks/r2e-gym-9be39cbb00d55a837a52", "instruction": "## `split_before`, `split_after`, and `split_when` yield an empty list when given an empty iterable and `maxsplit=0`\n\n### Description\n\nWhen calling `split_before`, `split_after`, or `split_when` on an empty iterable with `maxsplit=0`, the functions incorrectly yield a single empty list instead of yielding nothing.\n\nHere's a minimal example showing the problem:\n\n```python\nimport more_itertools as mi\n\n# Expected: []\n# Actual: [[]]\nprint(list(mi.split_before([], lambda c: bool(c), maxsplit=0)))\n\n# Expected: []\n# Actual: [[]]\nprint(list(mi.split_after([], lambda c: bool(c), maxsplit=0)))\n\n# Expected: []\n# Actual: [[]]\nprint(list(mi.split_when('', lambda a, b: a != b, maxsplit=0)))\n```\n\nAll three calls produce `[[]]` (a list containing one empty list) instead of `[]` (an empty list).\n\nNote that this only happens with `maxsplit=0`. Other values of `maxsplit` (e.g., -1, 1, 2, 3) correctly return an empty list when given an empty iterable.\n\n### Expected behavior\n\nSplitting an empty iterable should always produce an empty result, regardless of the `maxsplit` value. For example:\n\n```python\nlist(mi.split_before([], lambda c: bool(c), maxsplit=0)) # should be []\nlist(mi.split_after([], lambda c: bool(c), maxsplit=0)) # should be []\nlist(mi.split_when('', lambda a, b: a != b, maxsplit=0)) # should be []\n```\n\n### Actual behavior\n\nAll three calls return `[[]]` when `maxsplit=0` and the input is empty. The `maxsplit=0` fast-path in each function unconditionally yields `list(iterable)` without checking whether it is empty first, so an empty iterable causes a spurious empty list to be emitted.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-a02b68f4069ec94d8949", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:7a2a6cebead2e41114c4466599d7388dfed52060158f9c22331c12d7ca4673bd", "task_path": "tasks/r2e-gym-a02b68f4069ec94d8949", "instruction": "## `sliced()` silently accepts negative slice sizes instead of raising `ValueError`\n\nWhen calling `sliced()` with a negative `n`, the function should raise a `ValueError` to indicate that negative slice sizes are not valid. Instead, it currently accepts the value silently and produces incorrect or undefined behavior.\n\n### Example\n\n```python\nimport more_itertools as mi\n\nseq = 'ABCDEFG'\n\n# Both of these should raise ValueError, but currently do not\nresult1 = list(mi.sliced(seq, -1))\nresult2 = list(mi.sliced(seq, -1, strict=True))\n```\n\n### Expected behavior\n\nBoth calls should raise a `ValueError` immediately, similar to how Python's built-in `range()` raises `ValueError` for a zero step. Passing a negative slice size is nonsensical and should be rejected with a clear error message.\n\n### Actual behavior\n\nNo exception is raised. The function proceeds with the negative value and either silently returns wrong results or behaves in an unexpected way, making it hard to catch bugs in calling code.\n\nThe fix should add a guard at the start of `sliced()` that checks if `n < 0` and raises `ValueError('n must be at least 0')` before any iteration begins.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-b386a5c4d45043ab3df5", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:e547d8238bf2bc7cdde6f0b1fca15d189f6b8a7579eaac2f52e1a56ea2a1c620", "task_path": "tasks/r2e-gym-b386a5c4d45043ab3df5", "instruction": "## `seekable` object does not support subscript (index) access\n\nThe `seekable` class does not implement `__getitem__`, so trying to access items by index raises a `TypeError` instead of returning items from the internal cache.\n\n### Example\n\n```python\nimport more_itertools as mi\n\ns = mi.seekable(str(n) for n in range(10))\nmi.take(3, s) # consume 3 items: '0', '1', '2'\n\n# All of these raise TypeError: 'seekable' object is not subscriptable\nprint(s[-1]) # expected: '2'\nprint(s[0]) # expected: '0'\nprint(s[2]) # expected: '2'\n```\n\nAlso, before any items are consumed (empty cache), `s[0]` should raise `IndexError`, and accessing an index beyond the cache size (e.g. `s[3]` after consuming 3 items) should also raise `IndexError`.\n\nWith `maxlen` set, the cache is limited in size, so indexing should reflect only the cached portion:\n\n```python\ns = mi.seekable((str(n) for n in range(10)), maxlen=2)\nmi.take(5, s) # cache holds '3' and '4'\nprint(s[-1]) # expected: '4'\nprint(s[0]) # expected: '3'\n```\n\n### Expected behavior\n\n`seekable` should support index access (`s[i]`) that reads from the internal cache. Positive and negative indices should work like a standard sequence, and out-of-range indices should raise `IndexError`.\n\n### Actual behavior\n\nAny subscript access on a `seekable` instance raises:\n\n```\nTypeError: 'seekable' object is not subscriptable\n```\n\nThe `__getitem__` method is missing from the `seekable` class.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-b8af9ec2c9cf0035344f", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:6519b399aeeab335f932fa1eaa3843a028714237d8def9eea85ac185d776e89e", "task_path": "tasks/r2e-gym-b8af9ec2c9cf0035344f", "instruction": "## `iter_index` raises `ValueError` for negative `start`/`stop` on general iterables\n\nWhen calling `iter_index` with a negative `start` or `stop` argument on a general iterable (e.g., one wrapped with `iter()`), it raises a `ValueError` instead of returning the expected results.\n\nThis is because the slow code path for non-sequence iterables passes the negative indices directly to `islice()`, which does not accept negative values.\n\n### Example\n\n```python\nimport more_itertools as mi\n\niterable = 'AABCADEAF' # 'A' at indices 0, 1, 4, 7\n\n# Works fine on a list (fast path via .index())\nprint(list(mi.iter_index(list(iterable), 'A', start=-3))) # [7]\n\n# Crashes on a general iterator (slow path via islice)\nprint(list(mi.iter_index(iter(iterable), 'A', start=-3))) # ValueError!\n```\n\nOther failing combinations:\n- `stop=-2` → expected `[0, 1, 4]`\n- `start=-9` → expected `[0, 1, 4, 7]`\n- `start=-5, stop=-1` → expected `[4, 7]`\n\n### Error\n\n```\nValueError: Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n```\n\n### Expected behavior\n\n`iter_index` should handle negative `start` and `stop` values consistently regardless of whether the input is a sequence or a general iterable, mirroring the semantics of `list.index()` and `str.index()` (i.e., counting from the end of the iterable).\n\n### Actual behavior\n\nWhen the iterable is not a sequence (so the slow path using `islice` is taken), passing a negative `start` or `stop` raises a `ValueError` because `islice` only accepts non-negative integers or `None`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-c256b3744c88373661d9", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:1f1af20cb3b2a9a0f139ffb3d17de567c7e45e4e488551c29b19185d1eeeca77", "task_path": "tasks/r2e-gym-c256b3744c88373661d9", "instruction": "## `numeric_range` equality is wrong for single-element ranges with different steps\n\nTwo `numeric_range` objects that represent the same sequence of values should be considered equal, just like Python's built-in `range`. However, `numeric_range` incorrectly returns `False` when comparing single-element ranges that have different step values.\n\nFor example, `numeric_range(2, 3, 1)` and `numeric_range(2, 3, 5)` both contain exactly one element (`2`), so they should be equal. But the current `__eq__` implementation compares the `_step` attribute even for single-element ranges, causing them to be treated as unequal.\n\nHere's a minimal reproduction:\n\n```python\nimport more_itertools as mi\n\nrange1 = mi.numeric_range(2, 3, 1) # contains [2]\nrange2 = mi.numeric_range(2, 3, 5) # also contains [2]\n\nprint(list(range1)) # [2]\nprint(list(range2)) # [2]\nprint(range1 == range2) # prints False, but should be True\nprint(hash(range1) == hash(range2)) # also False, but should be True\n```\n\nFor comparison, Python's built-in `range` handles this correctly:\n\n```python\nprint(range(2, 3, 1) == range(2, 3, 5)) # True\n```\n\n### Expected behavior\n\n`numeric_range(2, 3, 1)` and `numeric_range(2, 3, 5)` should be equal (and have the same hash) because they represent the same sequence. The equality semantics should mirror Python's built-in `range`, where for single-element ranges, only the start value matters — not the step.\n\n### Actual behavior\n\nThe comparison returns `False` and raises an `AssertionError`:\n\n```\nAssertionError: numeric_range(2, 3) != numeric_range(2, 3, 5)\n```\n\nThe `__eq__` method needs to be updated to skip the step comparison when both ranges have exactly one element, and `__hash__` should be updated correspondingly to ensure equal objects have equal hashes.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-dd27f3d1022cbdcbaa19", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:5ab33c1ab0f37a192c29792dae9609b326c0000046495775857eda2bb41d70c4", "task_path": "tasks/r2e-gym-dd27f3d1022cbdcbaa19", "instruction": "## `tail()` does not raise `ValueError` for negative `n` with sized iterables\n\n### Description\n\nThe `tail()` function from `more_itertools` does not raise a `ValueError` when called with a negative `n` argument on a sized iterable (e.g., a string or list). Instead, it silently returns a result, which is unexpected behavior.\n\nHere is a minimal example to reproduce the issue:\n\n```python\nimport more_itertools as mi\n\n# Using a sized iterable (string) with a negative n\ntry:\n result = list(mi.tail(-1, 'ABCDEFG'))\n print(\"Got result:\", result) # Should NOT reach here\nexcept ValueError as e:\n print(\"Raised ValueError as expected:\", e)\n```\n\nRunning this code prints `Got result: ...` instead of raising a `ValueError`. The same negative-`n` validation is missing for sized iterables, while the expected behavior is consistent: any negative `n` should be rejected regardless of whether the iterable is sized or not.\n\n### Expected behavior\n\nCalling `mi.tail(-1, 'ABCDEFG')` should raise a `ValueError` (e.g., `'n must be at least 0'`), just as one would expect when passing an invalid negative size.\n\n### Actual behavior\n\nNo exception is raised. The function silently processes the sized iterable with the negative index, returning an unexpected result instead of signaling the invalid input.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-ea3e518d6dbb7bbca2a7", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:7965b3893ace3832b20bda9c5606a84e2c3a4111661511eea2cac50f37731a59", "task_path": "tasks/r2e-gym-ea3e518d6dbb7bbca2a7", "instruction": "## `chunked()` raises a confusing error when called with a negative `n`\n\nWhen calling `chunked()` with a negative value for `n`, the function raises a cryptic `ValueError` from `islice` instead of a clear, user-friendly error message.\n\n### Steps to reproduce\n\n```python\nimport more_itertools as mi\n\nlist(mi.chunked('ABCDE', -1))\n```\n\nThis raises:\n\n```\nValueError: Stop argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n```\n\n### Expected behavior\n\nCalling `chunked()` with a negative `n` should raise a `ValueError` with a clear message like `\"n must be at least 0\"`, consistent with how similar functions (e.g., `sliced`) handle this case.\n\n### Actual behavior\n\nThe error that surfaces is an internal `islice` error:\n\n```\nValueError: Stop argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n```\n\nThis message is confusing because it exposes an implementation detail rather than telling the user what they did wrong. There is no upfront validation of the `n` argument in `chunked()`, so the error only appears when the iterator is consumed, and the message gives no hint that the problem is the negative `n` passed by the caller.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Independent standalone pair not established by this audit; retained or recipe-native evidence is separate\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": null, \"retained\": true}", "diagnostics": []} | |
| {"task_id": "r2e-gym-024cf838c4a141f54112", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:a965a343ee490243a34b3665f963295e7e42025556bb059b8ec95b85f3b1c69b", "task_path": "tasks/r2e-gym-024cf838c4a141f54112", "instruction": "## `IndexedSet` silently wraps out-of-range negative indices instead of raising `IndexError`\n\n### Description\n\nWhen using `IndexedSet` with negative indices that are out of range, instead of raising an `IndexError`, the set silently returns a wrong element (or removes a wrong element via `pop`). This happens because negative-index normalization is applied twice — once in `__getitem__` and once inside `_get_real_index` — causing the index to wrap around a second time into a valid (but incorrect) position.\n\nFor example:\n\n```python\nfrom boltons.setutils import IndexedSet\n\nx = IndexedSet(range(10))\nx.pop(2) # now has 9 elements: [0, 1, 3, 4, 5, 6, 7, 8, 9]\n\nprint(x[-1]) # correctly returns 9\nprint(x[-9]) # correctly returns 0\n\n# This should raise IndexError, but instead returns 9 (wraps around silently)\nprint(x[-10])\n\n# This should raise IndexError, but instead silently removes element 4!\nx.pop(-15)\nprint(4 in x) # prints False — element was wrongly removed\n```\n\nThe same double-normalization bug also affects sets with multiple dead intervals (elements discarded below the compaction threshold):\n\n```python\nfrom boltons.setutils import IndexedSet\n\niset = IndexedSet(range(100))\nfor p in (5, 20, 40, 60, 80):\n iset.discard(p)\n# iset now has 95 elements, 5 dead slots\n\n# iset[-96] is out of range and should raise IndexError\nprint(iset[-96]) # silently returns a wrong element instead\n```\n\n### Expected behavior\n\nAccessing an `IndexedSet` with an out-of-range index (positive or negative) should raise `IndexError: IndexedSet index out of range`, consistent with Python list behavior. `pop` with an out-of-range negative index should also raise `IndexError` without modifying the set.\n\n### Actual behavior\n\nOut-of-range negative indices silently wrap around a second time due to double normalization in `__getitem__` and `_get_real_index`, returning wrong elements or silently removing valid elements via `pop`. No `IndexError` is raised.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-05065586ee1df120220d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:5a8c333327b3fafa3b218f6b2bd6477b7f020305d92cfb3f9e8248751aa47c7d", "task_path": "tasks/r2e-gym-05065586ee1df120220d", "instruction": "## `join_with` does not support a `strict` parameter\n\nThe `join_with` function currently has a shortcut: when only a single dict is passed, it returns that dict as-is without applying the combining function. This is usually fine, but there's no way to disable this behavior when you actually want the function to be applied even for a single dict.\n\nFor example:\n\n```python\nfrom funcy.colls import join_with\n\n# With a single dict and no strict flag, the function is skipped:\nresult = join_with(list, [{1: 1}])\nprint(result) # {1: 1} -- function was NOT applied\n\n# Trying to use strict=True to force the function to always be applied:\nresult = join_with(list, [{1: 1}], strict=True)\nprint(result) # TypeError: join_with() got an unexpected keyword argument 'strict'\n```\n\nThe second call raises:\n```\nTypeError: join_with() got an unexpected keyword argument 'strict'\n```\n\n### Expected behavior\n\n`join_with` should accept a `strict` keyword argument. When `strict=True`, the combining function should always be applied to values regardless of how many dicts are passed. So `join_with(list, [{1: 1}], strict=True)` should return `{1: [1]}` instead of `{1: 1}`.\n\n### Actual behavior\n\nCalling `join_with` with `strict=True` raises a `TypeError` because the parameter does not exist.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-05d19677b3e68435caab", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:b85d3b6f5c43cd312d294932f0303213db9a0a4f94a9967e397a581ab663706b", "task_path": "tasks/r2e-gym-05d19677b3e68435caab", "instruction": "## `in_range` returns wrong result for reversed ranges (start > end)\n\nWhen calling `in_range` with a reversed range — where `start` is greater than `end` — the function always returns `False`, even when the value clearly falls within the implied range.\n\nThis is inconsistent with lodash's documented behavior, which explicitly supports reversed ranges by swapping the bounds. For example, lodash documents `_.inRange(-3, -2, -6) // => true`, but pydash returns `False` for the same call.\n\n### Example\n\n```python\nimport pydash as _\n\n# According to lodash docs, this should be True\nprint(_.in_range(-3, -2, -6)) # prints False, expected True\n\n# Value at the inclusive lower bound after swap should be True\nprint(_.in_range(-6, -2, -6)) # prints False, expected True\n\n# Positive reversed range\nprint(_.in_range(1, 5, 0)) # prints False, expected True\n```\n\nAll three calls above return `False`, but should return `True` because after normalizing the reversed range (swapping bounds), the value lies within `[end, start)`.\n\nThe same issue affects `in_range_cmp`, since it delegates to `in_range`:\n\n```python\nprint(_.in_range_cmp(-2, -6)(-3)) # also returns False, expected True\n```\n\n### Expected behavior\n\nWhen `start > end`, the bounds should be swapped so the check becomes `end <= value < start`. This matches lodash's `_.inRange` behavior and makes reversed ranges work correctly instead of always returning `False`.\n\n### Actual behavior\n\n`in_range` uses `start <= value < end` directly without normalizing, so a reversed range like `(-2, -6)` is treated as an empty interval and always returns `False` regardless of the value.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-101ffe52033136b94813", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:dad97c369c73e8359dc67fd2ab698d245ff6c9ad06fb82680ca109f489bfc362", "task_path": "tasks/r2e-gym-101ffe52033136b94813", "instruction": "## `median` raises `IndexError` on empty collections instead of returning `NaN`\n\nCalling `_.median` with an empty list or dict raises an `IndexError` instead of gracefully returning `NaN`. This is inconsistent with `mean_by`, which returns `NaN` for empty input.\n\n### Steps to reproduce\n\n```python\nimport math\nimport pydash as _\n\nresult = _.median([]) # raises IndexError\nprint(math.isnan(result)) # should print True\n```\n\nThe same happens with an empty dict:\n\n```python\nresult = _.median({}) # also raises IndexError\n```\n\n### Error\n\n```\nIndexError: list index out of range\n```\n\nThe error originates inside `numerical.py` in the `median` function, where it tries to index into a sorted list that is empty:\n\n```python\nresult = (collection[left] + collection[right]) / 2\n ^^^^^^^^^^^^^^^^\nIndexError: list index out of range\n```\n\n### Expected behavior\n\n`_.median([])` and `_.median({})` should return `float('nan')` (i.e., `math.isnan(_.median([]))` should be `True`), consistent with how `mean_by` handles empty collections.\n\n### Actual behavior\n\nAn `IndexError: list index out of range` is raised because the empty collection takes the even-length code path and attempts to index into an empty sorted list.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-139ba1ca95d2f8786e80", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:9903f97fa1d519c448954ff4e6bd78e403264fabf56ae00e28ff09d34a3bc6af", "task_path": "tasks/r2e-gym-139ba1ca95d2f8786e80", "instruction": "## `get_real_name()` returns wrong component for multi-part dotted identifiers\n\n### Description\n\nWhen calling `get_real_name()` on a fully-qualified SQL identifier with more than two dotted parts (e.g., `db.schema.tbl.col`), the method returns an intermediate component instead of the last one (which is the actual object/column name).\n\n```python\nimport sqlparse\n\nident = sqlparse.parse(\"db.schema.tbl.col\")[0].tokens[0]\nprint(ident.get_real_name()) # prints 'schema', expected 'col'\n\n# Also broken for 3-part names:\nident2 = sqlparse.parse(\"x.y.z AS w\")[0].tokens[0]\nprint(ident2.get_real_name()) # prints 'y', expected 'z'\n```\n\nTwo-part names like `a.b` work correctly (returns `'b'`), because in that case the first dot and the last dot are the same.\n\n### Expected behavior\n\n`get_real_name()` should return the component after the **last** dot in the identifier — i.e., the actual object name (`'col'` for `db.schema.tbl.col`, `'z'` for `x.y.z`). `get_parent_name()` is documented to return the component before the first dot, so the two methods should anchor on opposite ends.\n\n### Actual behavior\n\n`get_real_name()` anchors on the **first** dot, so for `db.schema.tbl.col` it returns `'schema'` instead of `'col'`. The root cause is in `NameAliasMixin.get_real_name` in `sqlparse/sql.py`, which uses `token_next_by` to find the first punctuation dot and then returns the name token immediately after it.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-1572e851b4b09b2a8bd9", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:7f5369ed4ad61a23164c0919649719f4e6039cd00b63faa7d0c2da0b604d498f", "task_path": "tasks/r2e-gym-1572e851b4b09b2a8bd9", "instruction": "## `all_equal` makes unnecessary extra `groupby.__next__` call\n\nWhen calling `all_equal` on an iterable where all elements are equal (e.g., `iter('aaaaa')`), the internal implementation calls `__next__` on the `groupby` iterator one more time than necessary.\n\nHere's a minimal reproduction that demonstrates the problem:\n\n```python\nfrom itertools import groupby\nfrom unittest.mock import patch\nimport more_itertools as mi\n\nnext_count = 0\n\nclass CountingGroupby(groupby):\n def __next__(self):\n global next_count\n next_count += 1\n return super().__next__()\n\nwith patch('more_itertools.recipes.groupby', side_effect=CountingGroupby):\n iterable = iter('aaaaa')\n result = mi.all_equal(iterable)\n print(result) # True\n print(next_count) # prints 3, but should be 2\n print(list(iterable)) # should be [] since all items were consumed\n```\n\nFor an all-equal iterable, `all_equal` should only need to call `groupby.__next__` **twice**: once to fetch the first group, and once to confirm there is no second group (getting `StopIteration`). Instead, it calls it **3 times**, performing one extra unnecessary iteration.\n\n### Expected behavior\n\n`next_count` should be `2` after calling `all_equal` on a uniformly-equal iterable. The function should return `True` after confirming there's no second group, without making an additional `__next__` call.\n\n### Actual behavior\n\n`next_count` is `3` — the implementation calls `groupby.__next__` one extra time beyond what is needed to determine the result.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-1e255aa99a79ad763fa4", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:205f34210e00fb263dccff313c2434f5cc8ee5e1863d88df66e4537221875d2e", "task_path": "tasks/r2e-gym-1e255aa99a79ad763fa4", "instruction": "## `drop_while` and `take_while` raise `TypeError` when passed an iterator\n\nWhen calling `drop_while` or `take_while` with an iterator (any iterable that isn't directly subscriptable), a `TypeError` is raised because the functions try to slice the original input using index notation.\n\n### Example\n\n```python\nimport pydash as _\n\n# Using an iterator instead of a plain list\nresult = _.drop_while(iter([1, 2, 3, 4, 5]), lambda item: item < 3)\nprint(result) # Expected: [3, 4, 5]\n\nresult = _.take_while(iter([1, 2, 3, 4, 5]), lambda item: item < 3)\nprint(result) # Expected: [1, 2]\n```\n\n### Error\n\nFor `drop_while`:\n```\nTypeError: 'list_iterator' object is not subscriptable\n```\n\nFor `take_while`:\n```\nTypeError: 'list_iterator' object is not subscriptable\n```\n\nThe error originates from the slice operations `array[n:]` and `array[:n]` inside the respective functions. These work fine when the input is a `list`, but fail for any iterable that doesn't support subscripting (e.g., a generator or iterator).\n\n### Expected behavior\n\nBoth `drop_while` and `take_while` should work correctly with any iterable, not just lists. Passing `iter([1, 2, 3, 4, 5])` should produce the same result as passing `[1, 2, 3, 4, 5]`.\n\n### Actual behavior\n\nA `TypeError` is raised because the functions try to use slice notation on the raw input, which doesn't work for iterators.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-222c94194355d5edd3ec", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:425d341429f4ce3999e896c5bcb86cc3a98cca3d6e31f24bc733e57230c95b06", "task_path": "tasks/r2e-gym-222c94194355d5edd3ec", "instruction": "## `IndexedSet.update()` adds iterables as items instead of their elements when called with multiple arguments\n\nWhen calling `IndexedSet.update()` with more than one iterable argument, the iterables themselves get added to the set instead of their individual elements being iterated and added.\n\n### Example\n\n```python\nfrom boltons.setutils import IndexedSet\n\nitems = IndexedSet([1])\nitems.update([2, 1, 3], [], [3, 4, 2])\nprint(list(items))\n```\n\nWith tuple arguments it adds the tuples as items:\n```\n[1, (2, 1, 3), (), (3, 4, 2)]\n```\n\nWith list arguments it raises an error instead:\n```\nTypeError: unhashable type: 'list'\n```\n\nThe same problem occurs when the actual set items are tuples and multiple list-wrapped iterables are passed:\n\n```python\nfrom boltons.setutils import IndexedSet\n\nitems = IndexedSet()\nitems.update([(1, 2)], [(3, 4), (1, 2)])\nprint(list(items))\n```\n\nThis also raises `TypeError: unhashable type: 'list'` because the lists `[(1, 2)]` and `[(3, 4), (1, 2)]` are being treated as items to add rather than iterables to draw items from.\n\n### Expected behavior\n\nCalling `items.update([2, 1, 3], [], [3, 4, 2])` on an `IndexedSet([1])` should iterate through all provided iterables and add their elements, yielding `[1, 2, 3, 4]` (preserving insertion order and deduplicating). Similarly, `items.update([(1, 2)], [(3, 4), (1, 2)])` should add the tuple items `(1, 2)` and `(3, 4)`, yielding `[(1, 2), (3, 4)]`.\n\n### Actual behavior\n\nWhen multiple iterables are passed, the `update` method chains the list of iterables as a single sequence, yielding each iterable object itself rather than their contents. This means the iterables (lists, tuples, iterators) are passed directly to `add()` — causing either a `TypeError` for unhashable types like lists, or incorrect results where the iterable objects themselves end up in the set.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-236838db0ee5ca53c565", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:07bb56baf63a69e691bf9f3e5df6bcfea5d898c62a3634ffacabf280cfedca69", "task_path": "tasks/r2e-gym-236838db0ee5ca53c565", "instruction": "## `InvalidMethod` should subclass `AttributeError` for compatibility with `typing.Protocol` and `runtime_checkable`\n\n### Description\n\nWhen using `pydash`'s chaining interface with `typing.Protocol` and `@runtime_checkable`, things break unexpectedly. The root cause is that `pydash.exceptions.InvalidMethod` inherits from `Exception` instead of `AttributeError`.\n\nPython's `isinstance()` checks against `@runtime_checkable` protocols internally use `hasattr()`, which only silences `AttributeError`. If attribute lookup raises a different exception type (like a plain `Exception` subclass), it propagates instead of being caught, causing unexpected crashes.\n\nHere's a minimal example that demonstrates the problem:\n\n```python\nfrom typing import Protocol, runtime_checkable\nimport pydash as _\n\n@runtime_checkable\nclass MyProtocol(Protocol):\n def some_method(self) -> None:\n ...\n\nchain = _.chain([1, 2, 3])\n# This raises InvalidMethod instead of returning False,\n# because InvalidMethod doesn't inherit from AttributeError\nresult = isinstance(chain, MyProtocol)\n```\n\nAlso, the `InvalidMethod` exception class itself doesn't satisfy the basic expectation:\n\n```python\nimport pydash as _\n\n# This should be True but currently returns False\nprint(issubclass(_.InvalidMethod, AttributeError))\n```\n\n### Expected behavior\n\n`InvalidMethod` should be a subclass of `AttributeError` so that `hasattr()` (and by extension `isinstance()` checks against runtime-checkable protocols) correctly handle it. `issubclass(_.InvalidMethod, AttributeError)` should return `True`.\n\n### Actual behavior\n\n`issubclass(_.InvalidMethod, AttributeError)` returns `False` because `InvalidMethod` currently inherits from `Exception`. This causes incompatibility with `typing.Protocol` and `@runtime_checkable` — protocol `isinstance()` checks can raise `InvalidMethod` unexpectedly instead of returning `False`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-2d3bdefc7598cf5d56d3", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:4e083597784bc5d09202471a475e1fb152a59cc424e1f8c08f5a0547be535de2", "task_path": "tasks/r2e-gym-2d3bdefc7598cf5d56d3", "instruction": "## `pluralize()` produces wrong plural for words ending in \"x\"\n\nThe `pluralize()` function from `boltons.strutils` correctly adds \"-es\" for words ending in \"s\", \"ch\", or \"sh\", but it misses words ending in \"x\". Instead of producing \"boxes\", \"foxes\", \"taxes\", etc., it appends a bare \"s\" and produces nonsense like \"boxs\", \"foxs\", \"taxs\".\n\nHere's a simple reproduction:\n\n```python\nfrom boltons import strutils\n\npluralize = strutils.pluralize\n\nprint(pluralize('box')) # prints 'boxs' -- should be 'boxes'\nprint(pluralize('fox')) # prints 'foxs' -- should be 'foxes'\nprint(pluralize('tax')) # prints 'taxs' -- should be 'taxes'\nprint(pluralize('prefix')) # prints 'prefixs' -- should be 'prefixes'\n```\n\n### Expected behavior\n\nWords ending in \"x\" should follow the same \"-es\" rule as words ending in \"s\", \"ch\", or \"sh\":\n- `pluralize('box')` → `'boxes'`\n- `pluralize('fox')` → `'foxes'`\n- `pluralize('tax')` → `'taxes'`\n- `pluralize('prefix')` → `'prefixes'`\n\nCase preservation should also work correctly (`'Box'` → `'Boxes'`, `'FOX'` → `'FOXES'`).\n\nNote: irregular words like `'ox'` → `'oxen'` are already handled via the irregular map and should be unaffected.\n\n### Actual behavior\n\nAll words ending in \"x\" get a bare `'s'` appended, producing invalid plurals like `'boxs'`, `'foxs'`, `'taxs'`, `'prefixs'`.\n\nThe condition in `pluralize()` that checks for the \"-es\" rule only covers `word[-1] == 's'`, `word.endswith('ch')`, and `word.endswith('sh')` — \"x\" is not included.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-3313d502576d93c95e4d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:806b020e2547284137338de3c00eb50eed5b54ead0159faf8f15dc9f23b4bb54", "task_path": "tasks/r2e-gym-3313d502576d93c95e4d", "instruction": "## `every().hour.at('MM:SS')` parses minutes/seconds incorrectly\n\nWhen scheduling a job with `every().hour.at(...)`, the library supports the format `':MM'` to specify the minute within the hour. However, it does not correctly support the `'MM:SS'` format (minute:second), which would be a natural extension for also specifying the second offset.\n\n### Steps to reproduce\n\nWith the current time mocked to `2010-01-06 12:20:00`:\n\n```python\nfrom schedule import every\n\n# Expect next run at 12:30:05 (minute 30 is still ahead in the current hour)\njob = every().hour.at('30:05').do(my_job)\nprint(job.next_run) # prints 2010-01-06 13:05:00 instead of 2010-01-06 12:30:05\n```\n\nThe `'30:05'` string is intended to mean \"at minute 30, second 05 of each hour\". Since the current time is 12:20, the next run should be at 12:30:05. But instead, the scheduler produces 13:05:00 — it's treating `30` as the hour and `05` as the minute, falling into the wrong parsing branch.\n\n### Expected behavior\n\nFor an hourly job, `every().hour.at('MM:SS')` should parse the first component as the minute offset and the second component as the second offset within each hour. For example:\n- `every().hour.at('30:05')` with current time 12:20 → next run at **12:30:05** (hour=12, minute=30, second=5)\n- `every().hour.at('10:25')` with current time 12:20 → next run at **13:10:25** (hour=13, minute=10, second=25)\n- `every().hour.at('00:40')` with current time 12:20 → next run at **13:00:40** (hour=13, minute=0, second=40)\n\n### Actual behavior\n\nThe `'MM:SS'` format is not recognized for hourly jobs. The code falls through to the generic `hour, minute = time_values` branch, treating the minute value as an hour and the second value as a minute, producing completely wrong `next_run` timestamps.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `schedule`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-34bf5cbb2efdd5377ebd", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:d5474461faaa5bc8c85f8f5eaea3cadc55d9d3d2cdff2f9c2142f0ae20c34725", "task_path": "tasks/r2e-gym-34bf5cbb2efdd5377ebd", "instruction": "## `@cache` decorator's `invalidate()` raises `KeyError` when called twice on the same argument\n\nWhen using the `@cache` decorator from `funcy`, calling `.invalidate()` on a cached function with the same argument more than once raises a `KeyError`. The `invalidate()` method should be idempotent — calling it multiple times with the same argument should be safe and should not raise an error.\n\n### Reproduction\n\n```python\nfrom funcy.calc import cache\n\n@cache(timeout=60)\ndef inc(x):\n return x + 1\n\ninc(0) # populate cache\ninc.invalidate(0) # first invalidation — works fine\ninc.invalidate(0) # second invalidation — raises KeyError\n```\n\nThe second call to `inc.invalidate(0)` raises:\n\n```\nKeyError: (0,)\n```\n\nThis comes from `funcy/calc.py` in the `invalidate` function, which calls `cache.pop(key_func(*args, **kwargs))` without a default value, so it raises when the key is not present.\n\n### Expected behavior\n\nCalling `invalidate()` on a key that is not in the cache (because it was already invalidated or was never cached) should be a no-op. The method should be idempotent — calling it multiple times with the same arguments should not raise any error.\n\n### Actual behavior\n\nA `KeyError` is raised on the second call to `invalidate()` with the same argument, because the key was already removed from the cache on the first call.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-3c14370f74d576f0994a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:ea429e4dc541975d60beaec3dcf637cd2095b757461dba210946d433daf93204", "task_path": "tasks/r2e-gym-3c14370f74d576f0994a", "instruction": "## `sep` argument ignored in `args2sh` and `args2cmd`\n\nBoth `args2sh` and `args2cmd` accept a `sep` parameter to control the separator between arguments, but neither function actually uses it — they both hardcode a space `' '` regardless of what `sep` is passed.\n\n### Example\n\n```python\nfrom boltons import strutils\n\n# args2sh ignores sep\nresult = strutils.args2sh(['aa', 'bb'], sep='|')\nprint(result) # prints 'aa bb' instead of 'aa|bb'\n\n# args2cmd ignores sep too\nresult = strutils.args2cmd(['aa', 'bb'], sep='|')\nprint(result) # prints 'aa bb' instead of 'aa|bb'\n\n# Quoting/escaping should still work normally with a custom sep\nresult = strutils.args2sh(['a a', 'bb'], sep='|')\nprint(result) # prints 'a a|bb' instead of \"'a a'|bb\"\n```\n\n### Expected behavior\n\nWhen `sep='|'` is passed, arguments should be joined with `|` as the separator. Quoting and escaping of individual arguments should be unaffected by the separator choice.\n\n### Actual behavior\n\nThe `sep` argument is silently ignored. `args2sh` always joins with `' '.join(...)`, and `args2cmd` always appends a literal `' '` string between arguments, so the output is always space-separated regardless of the `sep` value provided.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-3c920dd5ccac243d2b04", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:99742ceda28772aa668ca4d4a70e938d23ad887dcdf0d69abfeedf5fd84a6069", "task_path": "tasks/r2e-gym-3c920dd5ccac243d2b04", "instruction": "## `Bits` conversion methods don't preserve empty instances\n\nWhen creating an empty `Bits` object (zero length), the conversion methods like `as_bin()` and `as_hex()` don't return empty strings as expected. Instead, `as_bin()` returns `'0'` and `as_hex()` returns a non-empty hex string. This also means round-trips through `from_bin` / `from_hex` / `from_bytes` don't preserve the empty state.\n\nHere's a minimal reproduction:\n\n```python\nfrom boltons.mathutils import Bits\n\nbits = Bits('') # empty Bits, len == 0\nprint(len(bits)) # 0\nprint(repr(bits.as_bin())) # prints '0' instead of ''\nprint(repr(bits.as_hex())) # prints a non-empty hex string instead of ''\n```\n\nThe same problem occurs for other ways of constructing zero-length `Bits`, such as `Bits([])`, `Bits('101')[:0]`, or `Bits(0, 0)`.\n\n**Expected behavior:** For any empty `Bits` instance (length 0), `as_bin()` should return `''`, `as_hex()` should return `''`, `as_bytes()` should return `b''`, and round-tripping through `Bits.from_bin(bits.as_bin())`, `Bits.from_hex(bits.as_hex())`, and `Bits.from_bytes(bits.as_bytes())` should all return an equivalent empty `Bits`.\n\n**Actual behavior:** `as_bin()` returns `'0'` for an empty `Bits`, and `from_hex('')` raises an error (since an empty string doesn't start with `'0x'`), so the round-trip is broken.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-3f3b18abb70458ce0d66", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:0adc4902c6bcbec42dc6fdccd5119daaa52ff6f4e67a7c511e04c661be751e6e", "task_path": "tasks/r2e-gym-3f3b18abb70458ce0d66", "instruction": "Title: `reraise` does not support callable `into` argument\n\n## Description\n\nThe `reraise` context manager/decorator currently does not support passing a callable as the `into` argument. When a lambda or function is passed as `into`, it should be called with the caught exception to produce the exception class or instance to raise. Instead, it tries to raise the callable itself, which causes a `TypeError`.\n\nHere's a minimal example that demonstrates the bug:\n\n```python\nfrom funcy.flow import reraise\n\nclass MyError(Exception):\n pass\n\n# This should catch ValueError and re-raise as MyError\nwith reraise(ValueError, lambda _: MyError):\n raise ValueError\n```\n\nThe intent is that the lambda receives the caught exception and returns the exception class to raise (`MyError` in this case).\n\n## Expected behavior\n\nThe code above should re-raise the caught `ValueError` as `MyError`, the same way `reraise(ValueError, MyError)` works when passing the exception class directly.\n\n## Actual behavior\n\nInstead of re-raising as `MyError`, the following error is raised:\n\n```\nTypeError: exceptions must derive from BaseException\n```\n\nThis happens because the lambda itself (a plain function object) is passed directly to the internal `raise_from` call without being invoked first to obtain the actual exception class/instance.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-4378f799cfc91f7a7828", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:55fbd1058186954a49868719e3866e60de0ed88dad5243dcfc981a3bd0152ba1", "task_path": "tasks/r2e-gym-4378f799cfc91f7a7828", "instruction": "## `chunk` raises `ZeroDivisionError` when `size` is 0 or negative\n\nCalling `pydash.chunk` with a `size` of `0` or any negative integer raises a `ZeroDivisionError` instead of returning an empty list.\n\n### Reproducing the issue\n\n```python\nimport pydash as _\n\n# Both of these raise ZeroDivisionError\nprint(_.chunk([1, 2, 3, 4, 5], 0)) # should return []\nprint(_.chunk([1, 2, 3], -1)) # should return []\n```\n\nRunning the above produces:\n\n```\nZeroDivisionError: float division by zero\n```\n\nThe error originates from the internal calculation `int(ceil(len(array) / float(size)))` in `chunk`, which divides by `size` without checking whether it is less than 1.\n\n### Expected behavior\n\nConsistent with lodash, `chunk` should return an empty list `[]` whenever `size` is less than 1 (i.e., `0` or negative), rather than raising an exception.\n\n### Actual behavior\n\n```\nZeroDivisionError: float division by zero\n```\n\nThe fix should add a guard at the top of `chunk` that returns `[]` immediately when `size < 1`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-4c7f851879d333df039f", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:ad765a36313a9faa8c8c4956c09bbd37d99225524e9cfe1896bc72d955d42298", "task_path": "tasks/r2e-gym-4c7f851879d333df039f", "instruction": "## `idle_seconds()` raises `TypeError` when no jobs are scheduled\n\nWhen calling `schedule.idle_seconds()` with no jobs scheduled (either before adding any jobs, or after canceling all jobs), a `TypeError` is raised instead of returning `None`.\n\n### Steps to reproduce\n\n```python\nimport schedule\n\n# No jobs scheduled yet\nprint(schedule.next_run()) # correctly returns None\nprint(schedule.idle_seconds()) # raises TypeError!\n```\n\nYou can also reproduce it by canceling all jobs after adding one:\n\n```python\nimport schedule\n\ndef my_job():\n pass\n\njob = schedule.every().hour.do(my_job)\nschedule.cancel_job(job)\n\nprint(schedule.next_run()) # returns None\nprint(schedule.idle_seconds()) # raises TypeError!\n```\n\n### Error message\n\n```\nTypeError: unsupported operand type(s) for -: 'NoneType' and 'datetime.datetime'\n```\n\nThis happens because internally `idle_seconds` computes `(self.next_run - datetime.datetime.now()).total_seconds()`, but when there are no scheduled jobs, `self.next_run` is `None`, making the subtraction invalid.\n\n### Expected behavior\n\n`schedule.idle_seconds()` should return `None` when there are no scheduled jobs, consistent with how `schedule.next_run()` already returns `None` in that case.\n\n### Actual behavior\n\nA `TypeError` is raised with the message: `unsupported operand type(s) for -: 'NoneType' and 'datetime.datetime'`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `schedule`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-4f27a82e923376a661ad", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:6464093abd8ade879e1b413e8aa12287696ac2b0ace701c989fe2e1552ef5cdb", "task_path": "tasks/r2e-gym-4f27a82e923376a661ad", "instruction": "## `sort_together` does not support a `strict` parameter\n\n### Description\n\nThe `sort_together` function does not accept a `strict` keyword argument. When iterables of different lengths are passed and you want to enforce that they are equal in length, there is no way to do so — the function silently truncates to the shortest iterable.\n\nFor example, the following should raise `UnequalIterablesError` but instead raises a `TypeError`:\n\n```python\nimport more_itertools as mi\n\n# These iterables have different lengths — should raise UnequalIterablesError\nmi.sort_together([(4, 3, 2, 1), ('a', 'b', 'c')], strict=True)\n```\n\nRunning this gives:\n\n```\nTypeError: sort_together() got an unexpected keyword argument 'strict'\n```\n\nSame issue with range-based iterables:\n\n```python\nmi.sort_together([range(4), range(5)], strict=True)\n# TypeError: sort_together() got an unexpected keyword argument 'strict'\n```\n\n### Expected behavior\n\n`sort_together` should accept a `strict` boolean keyword argument (defaulting to `False`). When `strict=True`, if any of the input iterables have different lengths, `UnequalIterablesError` should be raised. When `strict=False` (the default), the current behavior of trimming to the shortest iterable is preserved.\n\n### Actual behavior\n\nCalling `sort_together` with `strict=True` raises `TypeError: sort_together() got an unexpected keyword argument 'strict'` because the parameter does not exist in the function signature.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-5012179a2dd9ccb8967c", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:dec374d3df7e0a531ee4fa8718eaa42d5fb64e14ac6f874f877e52022419838b", "task_path": "tasks/r2e-gym-5012179a2dd9ccb8967c", "instruction": "The `WHERE` clause parser in `sqlparse/sql.py` does not treat the `INTO` keyword as a clause terminator. As a result, when parsing a query like `SELECT * FROM foo WHERE a = 1 INTO baz`, the `INTO` keyword and everything after it gets absorbed into the `Where` token group instead of being parsed as a separate keyword token at the statement level.\n\nTo reproduce:\n\n```python\nimport sqlparse\nfrom sqlparse import sql, tokens as T\n\ns = 'select * from foo where a = 1 into baz'\np = sqlparse.parse(s)[0]\nprint(isinstance(p.tokens[8], sql.Where)) # Should be True\nprint(p.tokens[9].ttype == T.Keyword) # IndexError: list index out of range\nprint(p.tokens[9].value == 'into')\n```\n\nAccessing `p.tokens[9]` raises an `IndexError` because `INTO` is not recognized as ending the WHERE clause — it is consumed inside the `Where` group, so there is no token at index 9.\n\nExpected behavior: The `INTO` keyword should terminate the `WHERE` clause, just like `ORDER`, `GROUP`, `LIMIT`, `UNION`, `EXCEPT`, `HAVING`, and `RETURNING` already do. After parsing, `p.tokens[8]` should be the `Where` instance containing `where a = 1`, and `p.tokens[9]` should be the `INTO` keyword token.\n\nThe fix should add `'INTO'` to the list of keywords that close a `WHERE` clause in the `Where` class definition (`M_CLOSE` tuple) inside `sqlparse/sql.py`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-55fbb6ec9b447ebe3bbd", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:5cbf4ff9e53043f016f8d2c55cda424b905d4c23843af39144d7695fbbc9e8e1", "task_path": "tasks/r2e-gym-55fbb6ec9b447ebe3bbd", "instruction": "## `IndexedSet` slicing returns wrong results after element removal\n\nSlicing an `IndexedSet` that has had elements removed produces incorrect results. The slice bounds are internally mapped into the raw item list's index space (which includes dead slots from removed elements), but `islice` consumes the iterator in the apparent (dead-slot-free) index space. This mismatch causes slices to over-count elements after any removal.\n\nAdditionally, negative slice bounds (like `x[-3:]`) raise a `ValueError` because the internal conversion produces a negative index that `islice` cannot accept.\n\n### Reproducer\n\n```python\nfrom boltons.setutils import IndexedSet\n\nx = IndexedSet(range(10))\nx.pop(2) # set is now [0, 1, 3, 4, 5, 6, 7, 8, 9]\n\n# Forward slice with positive bounds\nprint(list(x[1:4])) # should be [1, 3, 4]\n\n# Negative stop bound\nprint(list(x[-3:])) # should be [7, 8, 9]\n```\n\n### Expected behavior\n\n- `list(x[1:4])` should return `[1, 3, 4]` — the elements at apparent positions 1, 2, and 3 in the set.\n- `list(x[-3:])` should return `[7, 8, 9]` — the last three elements.\n- Slicing an `IndexedSet` with removals should produce the same result as slicing a freshly constructed `IndexedSet` with the same contents.\n\n### Actual behavior\n\n- `list(x[1:4])` returns `[1, 3, 4, 5]` — one extra element, because the stop index is inflated by the dead slot count before being passed to `islice`.\n- `list(x[-3:])` raises:\n ```\n ValueError: Indices for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n ```\n because `_get_real_index(-3)` returns a negative value that `islice` cannot handle.\n\nThe bug is in `IndexedSet.iter_slice`: it converts `start`/`stop` through `_get_real_index()` (which maps into raw `item_list` space) before handing them to `islice`, but `islice` operates on the already-filtered iterator output (apparent index space). Only negative indices need to be normalized (by adding `len(self)`); non-negative bounds should be passed to `islice` as-is.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-5770210a6843ed324b33", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:caa4e5de7aa08966e2e9a29f00bf2e850187bf5ee8690abfc2a069bb7aa1bc5b", "task_path": "tasks/r2e-gym-5770210a6843ed324b33", "instruction": "## `to_list` returns a `dict_values` view instead of a `list` when given a dict\n\nWhen calling `to_list()` with a dictionary argument, the function returns a `dict_values` view object instead of an actual `list`. This is inconsistent with the documented return type and with the behavior for all other input types (lists, tuples, scalars), which all return proper `list` instances.\n\n### Reproduce\n\n```python\nimport pydash as _\n\nresult = _.to_list({\"a\": 1, \"b\": 2, \"c\": 3})\nprint(result) # dict_values([1, 2, 3])\nprint(type(result)) # <class 'dict_values'>\nprint(isinstance(result, list)) # False\nprint(result == [1, 2, 3]) # False\n```\n\n### Expected behavior\n\n`to_list` should always return a real `list`. For a dict input like `{\"a\": 1, \"b\": 2, \"c\": 3}`, the result should be `[1, 2, 3]` with `isinstance(result, list)` being `True` and equality with `[1, 2, 3]` holding.\n\n### Actual behavior\n\nThe function returns a `dict_values` view (`dict_values([1, 2, 3])`). This view does not compare equal to a list (`dict_values([1, 2, 3]) == [1, 2, 3]` is `False`) and `isinstance(result, list)` is `False`.\n\nThe bug is in the `dict` branch of `to_list` in `src/pydash/objects.py`, which currently does `return obj.values()` instead of `return list(obj.values())`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-584a4532d13b27c6cca7", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:a24fa0896c44f2397edb14eb447317dee27f209c850ca47e1cf3fbb4eabca537", "task_path": "tasks/r2e-gym-584a4532d13b27c6cca7", "instruction": "## `_ComplementSet` `<=` and `>=` comparisons raise `AttributeError` due to typo\n\nWhen comparing two `_ComplementSet` objects using `<=` or `>=`, an `AttributeError` is raised because the code calls a misspelled method `issupserset` instead of `issuperset`.\n\n### Steps to reproduce\n\n```python\nfrom boltons.setutils import complement\n\ncab = complement('ab')\nca = complement('a')\n\n# This raises AttributeError\nresult = cab <= ca\n```\n\nThe error:\n```\nAttributeError: 'set' object has no attribute 'issupserset'. Did you mean: 'issuperset'?\n```\n\nSimilarly, `>=` between two complement sets fails:\n\n```python\nresult = ca >= cab # also raises AttributeError\n```\n\n### Expected behavior\n\n`cab <= complement('a')` should return `True` (since `complement('ab') <= complement('a')` iff `{'a'}` is a subset of `{'a', 'b'}`), and `complement('a') >= cab` should also return `True`. No exception should be raised.\n\n### Actual behavior\n\nBoth `<=` and `>=` comparisons between two `_ComplementSet` instances raise `AttributeError: 'set' object has no attribute 'issupserset'` because `_ComplementSet.__le__` and `_ComplementSet.__ge__` call `issupserset` (extra 's') instead of the correct `issuperset` method on the underlying set.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-5850ee5faf4733dfc77b", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:735309cafe273e2e3652358053386872f8b94bdd7fcaa2cd9e7435caf6c57adc", "task_path": "tasks/r2e-gym-5850ee5faf4733dfc77b", "instruction": "## DoS protection limits should raise `SQLParseError` instead of silently returning\n\n### Description\n\nWhen sqlparse hits its internal DoS protection limits (maximum token count or maximum grouping depth), it currently silently returns without raising any error. This means callers have no way to know that the SQL was not fully processed.\n\nFor example, parsing a query with a very large `IN` clause (5000 tuples) or deeply nested parentheses completes without error, but the output may be incomplete or incorrect:\n\n```python\nimport sqlparse\nfrom sqlparse.exceptions import SQLParseError\n\n# Large IN clause with 5000 tuples\ntuples = ', '.join(f'(1, {i})' for i in range(1, 5001))\nsql = f'SELECT a, b FROM t WHERE (a, b) IN ({tuples})'\n\n# Currently does NOT raise - just silently truncates processing\nresult = sqlparse.format(sql, reindent=True, keyword_case='upper')\n```\n\nSimilarly for deeply nested parentheses:\n\n```python\nsql = 'SELECT ' + '(' * 200 + '1' + ')' * 200\n# Currently does NOT raise - silently stops grouping\nresult = sqlparse.format(sql, reindent=True)\n```\n\nAnd for very large token lists:\n\n```python\nidentifiers = ', '.join(f'col{i}' for i in range(15000))\nsql = f'SELECT {identifiers} FROM table1'\n# Currently does NOT raise\nresult = sqlparse.format(sql, reindent=True)\n```\n\n### Expected behavior\n\nWhen the maximum number of tokens is exceeded, a `SQLParseError` should be raised with a message matching `\"Maximum number of tokens exceeded\"`. When the maximum grouping depth is exceeded, a `SQLParseError` should be raised with a message matching `\"Maximum grouping depth exceeded\"`. This gives callers a clear signal that the input was rejected due to DoS protection limits.\n\n### Actual behavior\n\nNo exception is raised. The grouping functions (`_group` and `_group_matching` in `sqlparse/engine/grouping.py`) silently `return` when limits are hit, so `sqlparse.format()` completes without any error even for inputs that exceed the configured limits.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-5b61d9be41c67f2bc105", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:98a84c6e65255fc76900d71f70f825f92999f318300c6266ef82bb6461a61a0d", "task_path": "tasks/r2e-gym-5b61d9be41c67f2bc105", "instruction": "## `isiterable` returns wrong result for objects with `__getitem__` but no `__iter__`\n\nThe `isiterable` function from `toolz.itertoolz` incorrectly returns `False` for objects that are iterable via the `__getitem__` protocol (i.e., they define `__getitem__` but not `__iter__`). According to Python's documentation, `iter()` supports two protocols: one using `__iter__` and one using `__getitem__` (starting from index 0). The current implementation only checks for `__iter__`, so it misses this second case.\n\nHere's a minimal example that demonstrates the bug:\n\n```python\nfrom toolz.itertoolz import isiterable\n\nclass GetItemIterable:\n def __getitem__(self, item):\n return [\"a\", \"b\", \"c\"][item]\n\n# This should be True — the object IS iterable via __getitem__\nprint(isiterable(GetItemIterable())) # prints False, but should be True\n\n# Also, objects with __iter__ = None should NOT be considered iterable,\n# even if they have __getitem__\nclass NotIterableEvenWithGetItem:\n __iter__ = None\n def __getitem__(self, item):\n return [\"a\", \"b\", \"c\"][item]\n\nprint(isiterable(NotIterableEvenWithGetItem())) # should be False\n```\n\n### Expected behavior\n\n- `isiterable(GetItemIterable())` should return `True` because Python's `iter()` can iterate over objects that define `__getitem__`.\n- `isiterable(NotIterableEvenWithGetItem())` should return `False` because explicitly setting `__iter__ = None` signals the class is not iterable, per the Python data model.\n\n### Actual behavior\n\n- `isiterable(GetItemIterable())` returns `False` — the `__getitem__`-only protocol is not recognized.\n- The current implementation uses `hasattr(x, '__iter__')`, which misses the `__getitem__` protocol and also incorrectly returns `True` for classes with `__iter__ = None` (since the attribute exists, just set to `None`).\n\nThe fix should use `iter(x)` inside a `try/except TypeError` block to correctly reflect Python's actual iteration semantics.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `toolz`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-61b6bcfdef57cdea0391", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:221b298872c5c312ec7a1dc3145c3360fbbd23095bd3af9becab9fce2c7b24af", "task_path": "tasks/r2e-gym-61b6bcfdef57cdea0391", "instruction": "## `log_durations` doesn't expose a patchable `timer` in `funcy.debug`\n\nWhen trying to test timing behavior of `log_durations` by patching the timer function used internally, it fails because `funcy.debug` has no `timer` attribute.\n\nHere's a minimal reproduction:\n\n```python\nfrom funcy.debug import log_durations\nfrom funcy.py3 import lmap\n\ndef test_log_durations(monkeypatch):\n timestamps = iter([0, 0.01, 1, 1.000025])\n monkeypatch.setattr('funcy.debug.timer', lambda: next(timestamps))\n log = []\n\n f = log_durations(log.append)(lambda: None)\n f()\n with log_durations(log.append, 'hello'):\n pass\n\n assert lmap(r'^\\s*(\\d+\\.\\d+ mk?s) in (?:<lambda>\\(\\)|hello)$', log) == ['10.00 ms', '25.00 mks']\n```\n\nThis raises:\n\n```\nAttributeError: 'module' object at funcy.debug has no attribute 'timer'\n```\n\n**Expected behavior:** `funcy.debug` should expose a module-level `timer` name (e.g., imported as `from timeit import default_timer as timer`) so that:\n1. `log_durations` uses `timer()` instead of `time.time()` for measuring elapsed time (which is more precise and monotonic).\n2. The `timer` name can be monkeypatched in tests to inject controlled timestamps.\n\n**Actual behavior:** The module uses `time.time` directly inside `log_durations` and `log_iter_durations`, so there is no `timer` attribute on the `funcy.debug` module to patch, causing an `AttributeError` when trying to monkeypatch it.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-627334bbd332d4c9de8d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:9896c7248945678050672f2db2592d80e780ad3477416d28b7e07002ddcb7b18", "task_path": "tasks/r2e-gym-627334bbd332d4c9de8d", "instruction": "## `dissoc` does not support the `factory` keyword argument\n\nThe `dissoc` function in `toolz.dicttoolz` doesn't accept a `factory` keyword argument, unlike other functions in the same module (`assoc`, `merge`, `valmap`, etc.) that all support `factory` to preserve custom mapping types.\n\nThis means that when working with custom dict-like types (e.g., `defaultdict` or a custom `Mapping` subclass), you can't pass a `factory` argument to `dissoc` to ensure the result has the correct type.\n\n### Steps to reproduce\n\n```python\nfrom collections import defaultdict\nfrom toolz.dicttoolz import dissoc\n\nd = defaultdict(int, {\"a\": 1, \"b\": 2})\nresult = dissoc(d, \"a\", factory=lambda: defaultdict(int))\n```\n\nRunning this raises:\n\n```\nTypeError: dissoc() got an unexpected keyword argument 'factory'\n```\n\n### Expected behavior\n\n`dissoc` should accept a `factory` keyword argument (defaulting to `dict`) just like `assoc` and other functions in the module. When a custom `factory` is provided, the returned mapping should be created using that factory, preserving the type of the input mapping.\n\n### Actual behavior\n\nCalling `dissoc` with a `factory` keyword argument raises a `TypeError` because the function signature only accepts `*keys` and no keyword arguments.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `toolz`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-643a3e6b9ccba6d2406d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:6b25c2edec299ce27a96d07adf0cfe7bdc578c5365d60681e3d915317b422ca9", "task_path": "tasks/r2e-gym-643a3e6b9ccba6d2406d", "instruction": "## Bug: `GUIDerator` raises `ValueError` with incorrect bounds message\n\nWhen creating a `GUIDerator` with an out-of-range `size`, the error message says `expected 20 < size <= 36`, but the actual lower bound is **inclusive** — `size=20` is valid and works fine. The message is misleading because it uses `<` instead of `<=` for the lower bound.\n\nHere's a minimal example that demonstrates the issue:\n\n```python\nfrom boltons.iterutils import GUIDerator\n\n# size=20 is actually accepted (lower bound is inclusive)\nprint(len(next(GUIDerator(size=20)))) # prints 20, works fine\n\n# but passing an invalid size gives a confusing error message\ntry:\n GUIDerator(size=19)\nexcept ValueError as e:\n print(e) # prints: expected 20 < size <= 36\n```\n\nThe error message says `20 < size <= 36`, which implies size=20 is invalid — but it's not. The real valid range is `20 <= size <= 36` (both bounds inclusive).\n\n### Expected behavior\n\nWhen an out-of-range size like `19` or `37` is passed, the `ValueError` message should say `expected 20 <= size <= 36` to correctly reflect that the lower bound is inclusive.\n\n### Actual behavior\n\nThe raised `ValueError` says `expected 20 < size <= 36`, which incorrectly suggests that size=20 is out of range, even though `GUIDerator(size=20)` works without error.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-64748de3ee01ed4b7ec1", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:6fece90f867b39a277ecca36c756e3a954d2375f3e6c1d3e6d9e0797a92cd927", "task_path": "tasks/r2e-gym-64748de3ee01ed4b7ec1", "instruction": "## `@throttle()` raises `TypeError` when called with a `timedelta` argument\n\n### Description\n\nWhen using the `@throttle()` decorator with a `timedelta` object as the period argument, it raises a `TypeError` at decoration time instead of working correctly.\n\nHere's a minimal example to reproduce:\n\n```python\nfrom datetime import timedelta\nfrom funcy.flow import throttle\n\ncalls = []\n\n@throttle(timedelta(seconds=1))\ndef throttled(x):\n calls.append(x)\n\nthrottled(1)\nthrottled(2)\n```\n\nThis raises the following error when the decorator is applied:\n\n```\nTypeError: unbound method timedelta.total_seconds() needs an argument\n```\n\nThe error occurs in `funcy/flow.py` inside the `throttle` function:\n\n```\nfuncy/flow.py:200: in throttle\n period = timedelta.total_seconds()\n ^^^^^^^^^^^^^^^^^^^^^^^^^\n```\n\n### Expected behavior\n\nPassing a `timedelta` object to `@throttle()` should work the same as passing an integer number of seconds. The decorator should correctly extract the total seconds from the `timedelta` instance and throttle calls accordingly. For example, `@throttle(timedelta(seconds=1))` should behave identically to `@throttle(1)`.\n\n### Actual behavior\n\nA `TypeError` is raised immediately when the decorator is applied, because `timedelta.total_seconds()` is being called on the `timedelta` class itself rather than on the `timedelta` instance passed as the `period` argument.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-67d12b180b736a0c0e3d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:824050b16ecd0621915b81e491b04905afea063f24919dca6e87bb681bf13502", "task_path": "tasks/r2e-gym-67d12b180b736a0c0e3d", "instruction": "## `decimal_relative_time` raises TypeError when given a timezone-aware datetime\n\nWhen calling `decimal_relative_time` (or `relative_time`) with a timezone-aware datetime and no explicit `other` argument, a `TypeError` is raised because the function always computes the default `other` as a naive datetime, then tries to subtract it from the timezone-aware input.\n\n### Reproducing the issue\n\n```python\nfrom datetime import datetime, timedelta, timezone\nfrom boltons.timeutils import decimal_relative_time, relative_time\n\n# Works fine with naive datetime\nnow_naive = datetime.now(timezone.utc).replace(tzinfo=None)\nprint(decimal_relative_time(now_naive)) # (0.0, 'seconds') - OK\n\n# Fails with timezone-aware datetime\nnow_utc = datetime.now(timezone.utc)\nprint(decimal_relative_time(now_utc)) # TypeError!\n\n# Also fails with other timezones\nnow_tz = datetime.now(timezone(timedelta(hours=5, minutes=30)))\nprint(decimal_relative_time(now_tz)) # TypeError!\n```\n\nThe error thrown is:\n```\nTypeError: can't subtract offset-naive and offset-aware datetimes\n```\n\nThis happens inside `decimal_relative_time` at the line `diff = other - d`, because `other` is always set to `datetime.now(timezone.utc).replace(tzinfo=None)` (a naive datetime) regardless of whether `d` is timezone-aware.\n\n### Expected behavior\n\nWhen no `other` is provided, `decimal_relative_time` should automatically use a default `other` that matches the timezone of `d`. If `d` is naive, `other` should be naive; if `d` is timezone-aware, `other` should be aware in the same timezone. Calling `decimal_relative_time(datetime.now(timezone.utc))` should return `(0.0, 'seconds')` just like it does for naive datetimes.\n\n### Actual behavior\n\nA `TypeError` is raised whenever a timezone-aware datetime is passed without an explicit `other` argument.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-67d2ba792fd32dbea8d8", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:004ef1c26bcf819c32923c4c942f7797eb4d8788eeeb466609dbaf7f4a886603", "task_path": "tasks/r2e-gym-67d2ba792fd32dbea8d8", "instruction": "## `BarrelList` slicing raises `ValueError` for negative slice indices\n\nWhen slicing a `BarrelList` with negative indices, a `ValueError` is raised instead of returning the expected elements. This happens because the internal `iter_slice` method passes unnormalized negative values to `islice()`, which only accepts `None` or non-negative integers.\n\n### Example\n\n```python\nfrom boltons.listutils import BarrelList\n\nreference = list(range(8))\nbl = BarrelList(reference)\n\n# This should work like a normal list slice\nkey = slice(-20, -2, 1)\nprint(list(bl[key])) # raises ValueError\nprint(reference[key]) # works fine: [0, 1, 2, 3, 4, 5]\n```\n\nRunning the above raises:\n\n```\nValueError: Stop argument for islice() must be None or an integer: 0 <= x <= sys.maxsize.\n```\n\nThe issue is in `BarrelList.iter_slice` — when start or stop are negative and the normalization (adding `len(self)`) still leaves them negative (e.g., when the absolute value exceeds the list length), the raw negative value ends up being passed to `islice()`.\n\nA broader test across many slice combinations (various negative/positive/None start, stop, and step values on lists of size 0, 1, and 8) shows many cases where `BarrelList` slicing diverges from standard `list` slicing behavior.\n\n### Expected behavior\n\n`BarrelList[start:stop:step]` should always return the same result as `list[start:stop:step]` for any combination of valid slice parameters, including negative indices and out-of-range values.\n\n### Actual behavior\n\nA `ValueError` is raised when the slice stop (or start) is negative and cannot be correctly normalized by the current logic in `iter_slice`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-6a1cdfb8f5d237efbc96", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:20c48fa8748b8d074c4bdfa5eccf5a3dea75f24661dae74c5960d15bc7f52efd", "task_path": "tasks/r2e-gym-6a1cdfb8f5d237efbc96", "instruction": "## `@decorator`-made decorators with only keyword args don't support being used without parentheses\n\nWhen creating a decorator using funcy's `@decorator` where the decorator function accepts only keyword arguments beyond `call`, the resulting decorator doesn't support being applied directly to a function (i.e., without parentheses).\n\nHere's a minimal example:\n\n```python\nfrom funcy.decorators import decorator\n\n@decorator\ndef add(call, **kwargs):\n return call() + kwargs.get(\"n\", 1)\n\ndef ten():\n return 10\n\n# This works fine:\nresult1 = add(n=2)(ten)() # => 12\nresult2 = add()(ten)() # => 11\n\n# But this raises a TypeError:\nresult3 = add(ten)() # should also return 11\n```\n\nThe last line raises:\n```\nTypeError: add() missing 1 required positional argument: 'func'\n```\n\n### Expected behavior\n\nWhen a `@decorator`-wrapped function has a single positional parameter (`call`) plus optional keyword arguments, it should be usable both with and without parentheses. That is, `add(ten)()` should behave the same as `add()(ten)()` and return `11`.\n\n### Actual behavior\n\nCalling `add(ten)` fails with a `TypeError` because the decorator factory doesn't recognize that `ten` is the function to be decorated rather than a decorator argument. The parentheses-free form is not supported for decorators that only accept keyword arguments beyond `call`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-6a5e93c0baa7ad7d4632", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:bf8ad615cd7da5b3ee47e513bd4912f78564a1c1f0293c58d687ceac2425fec7", "task_path": "tasks/r2e-gym-6a5e93c0baa7ad7d4632", "instruction": "## `fold` crashes when used with `multiprocessing.Pool().map` due to unpicklable lambda\n\nWhen calling `fold` with a `multiprocessing.Pool().map` as the `map` argument, it raises an `AttributeError` because the lambda function defined inside `fold` cannot be pickled for inter-process communication.\n\n### Reproduce\n\n```python\nfrom toolz.sandbox.parallel import fold\nfrom operator import add\nfrom multiprocessing import Pool\n\nresult = fold(add, range(10), 0, map=Pool().map)\nprint(result) # Expected: 45\n```\n\n### Error\n\n```\nAttributeError: Can't get local object 'fold.<locals>.<lambda>'\n```\n\nThe traceback shows the error originates in `toolz/sandbox/parallel.py` inside `fold`, where a lambda is passed to the pool's `map`:\n\n```python\nresults = map(lambda chunk: reduce(binop, chunk, default), chunks)\n```\n\nMultiprocessing needs to pickle the function to send it to worker processes, but lambda functions defined inside another function are not picklable.\n\n### Expected behavior\n\n`fold` should work correctly with `multiprocessing.Pool().map` and return the same result as a regular `reduce` (i.e., `45` for `fold(add, range(10), 0, map=Pool().map)`).\n\n### Actual behavior\n\nAn `AttributeError` is raised because the lambda inside `fold` cannot be pickled, making it impossible to use `fold` with any multiprocessing-based map function.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `toolz`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-6b247837df52ac26284a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:648bfa8eda5252b70b679b8f06daa3af1e1e28c9ae3ff2fbe7a3e7573d95b201", "task_path": "tasks/r2e-gym-6b247837df52ac26284a", "instruction": "## `AtomicSaver` and `iter_find_files` crash when given a `pathlib.Path` argument\n\n### Description\n\nBoth `AtomicSaver` and `iter_find_files` in `boltons.fileutils` fail when passed a `pathlib.Path` (or any `os.PathLike`) instead of a plain string path.\n\n**`AtomicSaver` with a `Path` destination:**\n\n```python\nimport pathlib\nfrom boltons import fileutils\n\ndest = pathlib.Path('/tmp/mydir') / 'output.bin'\nwith fileutils.AtomicSaver(dest) as f:\n f.write(b'hello')\n```\n\nThis raises:\n```\nTypeError: unsupported operand type(s) for +: 'PosixPath' and 'str'\n```\n\nThe error occurs internally because the code tries to build the `.part` temporary path by doing `dest_path + '.part'`, which doesn't work when `dest_path` is a `PosixPath` object.\n\n**`iter_find_files` with a `Path` directory:**\n\n```python\nimport pathlib\nfrom boltons.fileutils import iter_find_files\n\nresults = list(iter_find_files(pathlib.Path('/some/directory'), patterns=['*.py']))\n```\n\nThis raises:\n```\nAttributeError: 'PosixPath' object has no attribute 'split'\n```\n\nThe error happens because `iter_find_files` calls `.split(os.path.sep)` on the directory argument, which is a string method not available on `Path` objects.\n\n### Expected behavior\n\nBoth `AtomicSaver` and `iter_find_files` should accept `os.PathLike` objects (such as `pathlib.Path`) in addition to plain strings, since `pathlib.Path` is a standard and commonly used way to represent filesystem paths in modern Python. The functions should convert path-like objects to strings internally (e.g. using `os.fspath()`) so that callers don't need to manually call `str()` on their paths before passing them in.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-6e3e8b49dd70dcaa8ddb", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:e3a7ceb234892c894152bdbfd7d73fbec645d0f5fec622ea638f998007539e4f", "task_path": "tasks/r2e-gym-6e3e8b49dd70dcaa8ddb", "instruction": "## `pearson_type` raises `RuntimeError` and `ZeroDivisionError` for valid inputs\n\nThe `Stats.pearson_type` property fails in two ways when classifying certain distributions.\n\n### Bug 1: Incomplete classification — `RuntimeError: missed a spot`\n\nWhen the kappa value (`k = c1² / (4·c0·c2)`) is ≥ 0, the function only handles the `k < 0` branch (Type I / Beta) and falls through to an unconditional `raise RuntimeError('missed a spot')`. This means Types IV, V, and VI are never returned.\n\n```python\nfrom boltons.statsutils import Stats\n\n# Should return 4 (Type IV), raises RuntimeError instead\nprint(Stats([8, 4, 4, 4, 5, 1, 6, 5]).pearson_type)\n\n# Should return 5 (Type V)\nprint(Stats([5, 5, 2, 4, 5, 9, 5, 5]).pearson_type)\n\n# Should return 6 (Type VI)\nprint(Stats([0, 0, 0, 0, 0, 0, -11, 17]).pearson_type)\n```\n\nAll three calls raise `RuntimeError: missed a spot`.\n\n### Bug 2: Division by zero when `c0 == 0`\n\nWhen the intermediate coefficient `c0` is zero, computing `k = c1 ** 2 / (4 * c0 * c2)` raises a `ZeroDivisionError` before any guard is applied.\n\n```python\nfrom boltons.statsutils import Stats\n\n# Manually set moments to force c0 == 0 path\n# skewness=2.0, kurtosis=3.0 → expected type 1\nstats = Stats([0])\nstats.skewness = 2.0\nstats.kurtosis = 3.0\nprint(stats.pearson_type) # ZeroDivisionError: float division by zero\n```\n\n### Expected behavior\n\n- `Stats([8, 4, 4, 4, 5, 1, 6, 5]).pearson_type` should return `4`\n- `Stats([5, 5, 2, 4, 5, 9, 5, 5]).pearson_type` should return `5`\n- `Stats([0, 0, 0, 0, 0, 0, -11, 17]).pearson_type` should return `6`\n- When `c0 == 0`, `c2`'s sign should determine whether the result is Type I (c2 < 0) or Type VI (c2 ≥ 0), without raising a division error.\n\n### Actual behavior\n\n- Any input that results in `k >= 0` raises `RuntimeError: missed a spot`.\n- Any input that results in `c0 == 0` raises `ZeroDivisionError: float division by zero`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-78ddff8e97cf846b2c3d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:71e6d3ab2724a7011afd6e6f048dd4ddcdcd09f51d51022b1bcde03179ea241b", "task_path": "tasks/r2e-gym-78ddff8e97cf846b2c3d", "instruction": "## `Bits` class accepts values that exceed the declared bit length\n\nThe `Bits` class in `boltons.mathutils` has an off-by-one error in its length validation. When you explicitly pass a `len_` argument, it's supposed to raise a `ValueError` if the value can't be represented in that many bits. But because the guard uses `val > 2 ** len_` instead of `val >= 2 ** len_`, the boundary value `2 ** len_` slips through without raising.\n\nFor example, the maximum value representable in 2 bits is `3` (i.e., `2**2 - 1`). The value `4` (`2**2`) requires 3 bits, so `Bits(4, 2)` should raise a `ValueError`. Instead, it silently creates a `Bits` object with an internal binary string of `'100'` (3 bits) while reporting a length of `2`, breaking the length invariant.\n\n```python\nfrom boltons.mathutils import Bits\n\n# This should work fine — 3 fits in 2 bits\nb = Bits(3, 2)\nprint(b.as_bin()) # '11' — correct\n\n# This should raise ValueError — 4 requires 3 bits, not 2\nb2 = Bits(4, 2)\nprint(b2.as_bin()) # prints '100', but len is reported as 2 — wrong!\n\n# This should also raise ValueError — 1 cannot fit in 0 bits\nb3 = Bits(1, 0)\n```\n\n### Expected behavior\n\n`Bits(4, 2)` and `Bits(1, 0)` should both raise a `ValueError` with a message like `value 4 cannot be represented with 2 bits`, since `2 ** len_` is already one more than the maximum representable value.\n\n### Actual behavior\n\n`Bits(4, 2)` does **not** raise. It silently constructs a `Bits` object whose binary representation is `'100'` (3 characters) despite the declared length being `2`. This breaks the `len`/`__getitem__` invariant and prevents correct round-tripping.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-7be85f49c2f367a0a828", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:d1d9c29ddcc74e4bb63c7825182e81890c42ea32d8bb6844dfd7f9fb50ef9e4b", "task_path": "tasks/r2e-gym-7be85f49c2f367a0a828", "instruction": "## Bug: `BarrelList.insert` raises `IndexError` for very negative indices instead of inserting at the beginning\n\nWhen calling `insert` on a `BarrelList` with a very negative index (e.g., `-1000000000`), it raises an `IndexError` instead of inserting at position 0 like Python's built-in `list` does.\n\nHere's a minimal example to reproduce:\n\n```python\nfrom boltons.listutils import BarrelList\n\nbl = BarrelList(range(int(1e5)))\nbl._balance_list(0)\n\n# Python's built-in list treats out-of-range negative indices as 0\nbl.insert(-int(1e9), 'start')\n\nprint(bl[0]) # Expected: 'start'\nprint(len(bl)) # Expected: 100001\n```\n\nRunning this raises:\n```\nIndexError\n```\n\n### Expected behavior\n\nPython's built-in `list.insert` clamps out-of-range negative indices to 0, effectively inserting at the beginning of the list. `BarrelList.insert` should match this behavior — inserting `'start'` at index `-1000000000` should place it at position 0.\n\n### Actual behavior\n\n`BarrelList.insert` raises `IndexError` when the translated index is out of bounds (before the start of the list). The internal `_translate_index` method returns `None` for such indices, and the current code raises `IndexError` in that case instead of falling back to inserting at the beginning.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-7e85ce65d210bbbb98a0", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:56b6acdaf908d76d73cbe83aa7d7ee10e7adc36648a2dd7870a7b78041983cba", "task_path": "tasks/r2e-gym-7e85ce65d210bbbb98a0", "instruction": "## `Bits` negative indexing returns wrong result\n\nIndexing into a `Bits` object with a negative integer gives wrong results. For example, `Bits('10')[-2]` returns `False` instead of `True`, and out-of-range negative indices like `Bits('10')[-3]` return `False` silently instead of raising `IndexError`.\n\nHere's a small reproduction:\n\n```python\nfrom boltons.mathutils import Bits\n\nb = Bits('10') # bits: [True, False]\n\nprint(b[-1]) # should be False (last bit), prints False — OK\nprint(b[-2]) # should be True (first bit), prints False — WRONG\nprint(b[-3]) # should raise IndexError, but prints False instead\n```\n\n**Expected behavior:**\n- `Bits('10')[-1]` → `False` (last bit)\n- `Bits('10')[-2]` → `True` (first bit, same as index 0)\n- `Bits('0000100')[-3]` → `True` (same as index 4)\n- `Bits('10')[-3]` → raises `IndexError` (out of range)\n\n**Actual behavior:**\n- `Bits('10')[-2]` returns `False` instead of `True`\n- `Bits('10')[-3]` returns `False` instead of raising `IndexError`\n\nThe root cause is in `Bits.__getitem__`: negative indices are never adjusted to their equivalent positive position before computing the bitmask, so the shift ends up being too large and the AND with the stored value always produces 0. Negative indices should be resolved by adding `self.len` (like Python's standard sequence indexing), and then checked for being out of range.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-7f4d4ca865b835b24c0b", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:a3a3164e9d3ffa78333c54a7728fe472a2750db420fa1d29b34b35916af4c248", "task_path": "tasks/r2e-gym-7f4d4ca865b835b24c0b", "instruction": "The `TLRUCache.expire()` method currently returns `None`. It should instead return an iterable of `(key, value)` pairs for all cache entries that were expired and removed during the call.\n\nFor example, given a cache with TTU of 3 time units:\n\n```python\ncache = TLRUCache(maxsize=3, ttu=lambda k, v, t: t + 3, timer=timer)\ncache[1] = 1\ncache[2] = 2\ncache[3] = 3\n\nitems = cache.expire() # nothing expired yet\nprint(set(items)) # should print: set()\n\nitems = cache.expire(3) # key 1 expires at time 3\nprint(set(items)) # should print: {(1, 1)}\n\nitems = cache.expire(4) # key 2 expires at time 4\nprint(set(items)) # should print: {(2, 2)}\n\nitems = cache.expire(5) # key 3 expires at time 5\nprint(set(items)) # should print: {(3, 3)}\n```\n\nCurrently `cache.expire()` returns `None`, so trying to iterate over the result raises `TypeError: 'NoneType' object is not iterable`.\n\nThe fix: inside `TLRUCache.expire()`, collect each expired `(key, value)` pair before deleting the item from the cache, and return that collection at the end of the method. When no items are expired, return an empty iterable.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-84c4518b525c580b7b78", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:0c2750ea0a4211586667b2b75a3923215b2285128f08c8fb8f2e1f5b7f2c939e", "task_path": "tasks/r2e-gym-84c4518b525c580b7b78", "instruction": "## `polynomial_from_roots` raises `RecursionError` for large inputs\n\nWhen calling `polynomial_from_roots` with a large number of roots (e.g. 1500), Python hits its maximum recursion depth and raises a `RecursionError`.\n\nHere's a minimal example that reproduces the issue:\n\n```python\nfrom math import comb\nimport more_itertools as mi\n\nn = 1_500\nactual = mi.polynomial_from_roots([-1] * n)\nexpected = [comb(n, k) for k in range(n + 1)]\nprint(actual == expected)\n```\n\nRunning this crashes with a deeply nested traceback like:\n\n```\nmore_itertools/recipes.py:758: in convolve\n for x in chain(signal, repeat(0, n - 1)):\nmore_itertools/recipes.py:758: in convolve\n for x in chain(signal, repeat(0, n - 1)):\n...\nmore_itertools/recipes.py:757: in convolve\n window = deque([0], maxlen=n) * n\nRecursionError: maximum recursion depth exceeded while calling a Python object\n```\n\nThe root cause is that the current implementation of `polynomial_from_roots` uses `reduce(convolve, factors, [1])`, and because `convolve` itself is a generator that lazily chains signals together, building up 1500 nested `convolve` generators creates a recursion chain that exceeds Python's default recursion limit when finally iterated.\n\n**Expected behavior:** `polynomial_from_roots` should handle large inputs (e.g. 1500 roots) without hitting a recursion limit, returning the correct polynomial coefficients.\n\n**Actual behavior:** A `RecursionError` is raised when the number of roots is large enough to exhaust the call stack.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-85951a8af27753414e3e", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:1ac3966aa04e00497be2be540b4aa23321db9d32ba99d03fb2c47150bcc14d17", "task_path": "tasks/r2e-gym-85951a8af27753414e3e", "instruction": "## `ParsedException` drops anchor lines from Python 3.11+ tracebacks\n\nWhen parsing a traceback that contains anchor lines (the `^` and `~` highlight lines introduced in Python 3.11+), `ParsedException.from_string` silently discards them. As a result, each frame dict is missing a `source_line_anchor` key, and calling `to_string()` on the parsed exception produces a traceback without the anchor lines — so the round-trip is lossy.\n\n### Example\n\n```python\nfrom boltons.tbutils import ParsedException\n\ntb_str = \"\"\"\\\nTraceback (most recent call last):\n File \"main.py\", line 3, in <module>\n print(add(1, \"two\"))\n ^^^^^^^^^^^^^^\n File \"add.py\", line 2, in add\n return a + b\n ~~^~~\nTypeError: unsupported operand type(s) for +: 'int' and 'str'\"\"\"\n\nparsed_tb = ParsedException.from_string(tb_str)\nprint(parsed_tb.frames[0]) # missing 'source_line_anchor'\nprint(parsed_tb.to_string() == tb_str) # False — anchor lines are gone\n```\n\nThe first frame dict looks like:\n```\n{'filepath': 'main.py', 'lineno': '3', 'funcname': '<module>', 'source_line': 'print(add(1, \"two\"))'}\n```\n\nbut it should be:\n```\n{'filepath': 'main.py', 'lineno': '3', 'funcname': '<module>', 'source_line': 'print(add(1, \"two\"))', 'source_line_anchor': ' ^^^^^^^^^^^^^'}\n```\n\n### Expected behavior\n\n- `ParsedException.from_string` should store the anchor line for each frame under the key `source_line_anchor` in the frame dict.\n- `to_string()` should re-emit those anchor lines beneath the corresponding source lines, so the full traceback round-trips faithfully.\n- When the traceback arrives with extra leading indentation (e.g. pasted from a log), the anchor should be dedented by the same amount as the source line, keeping column alignment correct.\n\n### Actual behavior\n\nAnchor lines are detected (to advance the line counter) but their content is never stored. Frame dicts have no `source_line_anchor` key, and `to_string()` omits the anchor lines entirely.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-86930f5478474300343d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:eca78575cdf3c97aad1b53660e38e6721c5d04663e961fc5584cb2111d4a5dc1", "task_path": "tasks/r2e-gym-86930f5478474300343d", "instruction": "## `zip_object` and `zip_object_deep` raise `ValueError` when called with an empty list\n\n### Description\n\nCalling `zip_object` or `zip_object_deep` with an empty list raises a `ValueError` instead of returning an empty dict.\n\nThis happens when using the two-argument form where keys and values are provided as paired lists (e.g., `[[key, value], ...]`), and the input is empty.\n\n```python\nimport pydash as _\n\n# Both of these raise ValueError\nresult1 = _.zip_object([])\nresult2 = _.zip_object_deep([])\n```\n\nRunning either of these produces:\n\n```\nValueError: not enough values to unpack (expected 2, got 0)\n```\n\nThe traceback points to the line inside `zip_object` (and `zip_object_deep`) where `keys, values = unzip(keys)` is called. When `keys` is an empty list, `unzip([])` returns an empty sequence, and Python can't unpack it into two variables.\n\n### Expected Behavior\n\nBoth `_.zip_object([])` and `_.zip_object_deep([])` should return an empty dict `{}`.\n\n### Actual Behavior\n\n```\nValueError: not enough values to unpack (expected 2, got 0)\n```\n\nThe functions do not handle the case where the input list is empty and `unzip` returns nothing to unpack.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-87c5734df6fdcbc75c86", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:69af9becf5dffe844e4c1d33e53cf2dcc72032d17adf6d6c6160fdae58221f8e", "task_path": "tasks/r2e-gym-87c5734df6fdcbc75c86", "instruction": "## `last_index_of` returns -1 when the value only exists at index 0\n\nWhen calling `last_index_of` on an array where the target value's last (or only) occurrence is at index 0, the function incorrectly returns `-1` instead of `0`.\n\n### Example\n\n```python\nimport pydash as _\n\n# Value 1 is at index 0 — should return 0\nresult = _.last_index_of([1, 2, 3], 1)\nprint(result) # prints -1, expected 0\n\n# Explicitly starting search from index 0\nresult2 = _.last_index_of([1, 2, 3], 1, 0)\nprint(result2) # prints -1, expected 0\n\n# Another case: 5 is only at index 0\nresult3 = _.last_index_of([5, 2, 3], 5)\nprint(result3) # prints -1, expected 0\n```\n\n### Expected behavior\n\n`last_index_of` should return `0` in all three cases above, since the value is present at index 0 of the array.\n\n### Actual behavior\n\nThe function returns `-1`, indicating the value was not found, even though it is clearly present at index 0.\n\nNote that the sibling function `index_of` correctly finds values at index 0 — this bug is specific to `last_index_of`. The issue appears to be in the backward search loop, which stops before it ever checks index 0.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-89eb843c0aa46254505e", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:9726ce38ecdc7d83ab531cb1649ab7521362c2826b195cf2d7bbca2f23d20d07", "task_path": "tasks/r2e-gym-89eb843c0aa46254505e", "instruction": "## `mean` and `mean_by` raise `ZeroDivisionError` on empty collections\n\nCalling `_.mean([])` or `_.mean_by([])` on an empty list (or dict) raises a `ZeroDivisionError` instead of returning `NaN`.\n\n### Steps to reproduce\n\n```python\nimport math\nimport pydash as _\n\n# Both of these raise ZeroDivisionError\nprint(math.isnan(_.mean([]))) # expected: True\nprint(math.isnan(_.mean({}))) # expected: True\nprint(math.isnan(_.mean_by([]))) # expected: True\nprint(math.isnan(_.mean_by([], lambda x: x * 2))) # expected: True\n```\n\n### Error\n\n```\nZeroDivisionError: division by zero\n```\n\nThe traceback points to `numerical.py` in `mean_by`:\n\n```\nsrc/pydash/numerical.py in mean_by\n return sum_by(collection, iteratee) / len(collection)\nZeroDivisionError: division by zero\n```\n\n### Expected behavior\n\nFollowing lodash's behavior, `mean` and `mean_by` should return `NaN` when called with an empty collection, rather than raising an exception. `math.isnan(_.mean([]))` should return `True`.\n\n### Actual behavior\n\nA `ZeroDivisionError` is raised because `mean_by` unconditionally divides by `len(collection)`, which is `0` for empty collections. The fix should guard against this case and return `float('nan')` when the collection is empty.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-8b1659a113c28eeb4bb3", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:91925944fe40ac2245402bc8a2db2b543cf2862131eb0008669fdd3d451270c0", "task_path": "tasks/r2e-gym-8b1659a113c28eeb4bb3", "instruction": "## `partition_all` silently produces wrong output when a sequence has an incorrect `__len__`\n\n### Description\n\n`partition_all` uses a sequence's `__len__` to determine where the final (possibly shorter) partition ends. If a sequence's `__len__` returns an incorrect value, `partition_all` currently silently produces bad/wrong output instead of raising an error.\n\nHere's a minimal example:\n\n```python\nfrom toolz.itertoolz import partition_all\n\nclass ListWithBadLength(list):\n def __init__(self, contents, off_by=1):\n self.off_by = off_by\n super().__init__(contents)\n\n def __len__(self):\n return super().__len__() + self.off_by\n\n# A list of 2 elements that claims to have 3\ntoo_long_list = ListWithBadLength([1, 2], off_by=+1)\nresult = list(partition_all(5, too_long_list))\nprint(result) # Produces wrong output silently\n\n# A list of 2 elements that claims to have 1\ntoo_short_list = ListWithBadLength([1, 2], off_by=-1)\nresult = list(partition_all(5, too_short_list))\nprint(result) # Also produces wrong output silently\n```\n\nIn both cases, `partition_all` should raise a `LookupError` to alert the user that the sequence has an invalid `__len__`, but instead it returns incorrect results without any warning.\n\n### Expected behavior\n\nWhen a sequence's `__len__` is inconsistent with its actual contents (either reporting too large or too small a length), `partition_all` should raise a `LookupError` with a descriptive message so the user can identify and fix the problematic iterable.\n\n### Actual behavior\n\nNo exception is raised. Instead, `partition_all` silently computes the wrong partition boundary based on the incorrect `__len__` value and returns bad data.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `toolz`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-8b311d34ed68c335375a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:e9dd95dc99b821a0c0a3251ddf69215311edcdfeac90249564e690c47667dea7", "task_path": "tasks/r2e-gym-8b311d34ed68c335375a", "instruction": "## `parse_qsl` ignores the `encoding` parameter when decoding percent-encoded query strings\n\n### Description\n\nThe `urlutils.parse_qsl` function accepts an `encoding` parameter, but it is silently ignored when decoding percent-encoded characters in query string keys and values. This means that even if you pass `encoding='latin-1'`, percent-encoded bytes are always decoded as UTF-8.\n\nFor example, `%E9` is the byte for `é` (e with acute accent) in latin-1, but it is not valid UTF-8. When you ask `parse_qsl` to decode with `latin-1`, it should return `'\\xe9'`, but instead it returns the Unicode replacement character `'\\ufffd'` because it's still using UTF-8 internally.\n\n### Reproducer\n\n```python\nfrom boltons import urlutils\n\n# %E9 is 'é' in latin-1 but not valid UTF-8\nqs = 'k=%E9'\n\n# Should return [('k', '\\xe9')] but returns [('k', '\\ufffd')] instead\nresult = urlutils.parse_qsl(qs, encoding='latin-1')\nprint(result) # [('k', '\\ufffd')] <-- wrong, should be [('k', 'é')]\n\n# Keys are also affected\nresult_key = urlutils.parse_qsl('%E9=v', encoding='latin-1')\nprint(result_key) # [('\\ufffd', 'v')] <-- wrong, should be [('é', 'v')]\n```\n\n### Expected behavior\n\nWhen `encoding='latin-1'` is passed, `parse_qsl` should decode percent-encoded bytes using latin-1. So `k=%E9` should produce `[('k', 'é')]` (i.e., `[('k', '\\xe9')]`), and the default behavior (UTF-8) should remain unchanged — undecodable bytes become the replacement character `\\ufffd`.\n\n### Actual behavior\n\nThe `encoding` argument is accepted but never forwarded to the underlying `unquote` calls for keys or values. As a result, all percent-encoded sequences are always decoded as UTF-8, regardless of what encoding the caller specifies. Passing `encoding='latin-1'` with `qs = 'k=%E9'` returns `[('k', '\\ufffd')]` instead of `[('k', '\\xe9')]`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-8f98b79c50889659d632", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:c34dff11eec753e455f47f2761584ab776b8fbd5f5044d383833141b4025fdba", "task_path": "tasks/r2e-gym-8f98b79c50889659d632", "instruction": "## `ZeroDivisionError` when calling `get_histogram_counts()` on data with zero interquartile range\n\nWhen all (or nearly all) values in a `Stats` object are identical, calling `get_histogram_counts()` raises a `ZeroDivisionError`.\n\nThis happens because the Freedman-Diaconis bin-width algorithm computes `dx = 2 * (q75 - q25) / n^(1/3)`. If the interquartile range is zero (i.e., q25 == q75), then `dx` becomes `0`, and the subsequent division `(max_data - min_data) / dx` raises a `ZeroDivisionError`.\n\n### Reproducer\n\n```python\nfrom boltons.statsutils import Stats\n\n# All identical values — IQR is zero\ndata = [5] * 10\ncounts = Stats(data).get_histogram_counts() # ZeroDivisionError here\n```\n\nThe same error occurs with data like `[0] * 10 + [100]` where the IQR is also zero.\n\n### Error\n\n```\nZeroDivisionError: float division by zero\n```\n\nThe traceback points to `boltons/statsutils.py` in `_get_bin_bounds`, at the line:\n```python\nbin_count = max(1, int(ceil((max_data - min_data) / dx)))\n```\n\n### Expected behavior\n\nWhen the interquartile range is zero, `get_histogram_counts()` should gracefully return a single bin containing all data points — e.g., `[(5.0, 10)]` for `[5] * 10`. Similarly, `format_histogram()` should work without error on such data.\n\n### Fix needed\n\nThe `_get_bin_bounds` method in `statsutils.py` should check whether `dx == 0` before attempting the division, and fall back to a single-bin result in that case.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-90eec8823645d39e79fa", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:581a11fb63d77f5e6cc568a24e276b9f6258b4f563f546545fe5097f02be89f4", "task_path": "tasks/r2e-gym-90eec8823645d39e79fa", "instruction": "## `once_per` raises `TypeError` when called with unhashable arguments\n\nWhen using `once_per` or `once_per_args` decorators with arguments that are unhashable types (like `list`, `dict`, `set`, or a tuple containing a list), calling the decorated function raises a `TypeError` instead of working correctly.\n\nHere's a minimal reproduction:\n\n```python\nfrom funcy.flow import once_per\n\ncalls = []\n\n@once_per('n')\ndef call(n):\n calls.append(n)\n return 'called'\n\n# This raises TypeError: unhashable type: 'list'\nresult = call([1, 2, 3])\n```\n\nThe same happens with `once_per_args` and with other unhashable types like `dict` or `set`:\n\n```python\nfrom funcy.flow import once_per_args\n\n@once_per_args\ndef call(n):\n return 'called'\n\ncall({'a': 1}) # TypeError: unhashable type: 'dict'\ncall({1, 2}) # TypeError: unhashable type: 'set'\n```\n\n**Expected behavior:** When the argument is unhashable, `once_per` / `once_per_args` should still work — tracking seen argument values using a list-based fallback instead of a set. Calling the function with the same unhashable value a second time should return `None` (i.e., not call the wrapped function again), and calling it with a different value should invoke the function normally.\n\n**Actual behavior:** A `TypeError` is raised as soon as the decorated function is called with any unhashable argument:\n\n```\nTypeError: unhashable type: 'list'\n```\n\nThe issue is in the `once_per` implementation, which uses `isinstance(values, Hashable)` to decide whether to use a set or a list for tracking. This check incorrectly returns `True` for tuples that contain unhashable elements (since `tuple` is registered as `Hashable`), causing the code to attempt adding the value to a set, which then fails at runtime.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-9125f888769b0e475570", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:794f15323664cac5880861fc7ceac736483294d8634551bc915c04f4732d18b6", "task_path": "tasks/r2e-gym-9125f888769b0e475570", "instruction": "## `str()` on a scheduled `functools.partial` job raises `AttributeError`\n\nWhen scheduling a `functools.partial` function and converting the resulting job to a string using `str()`, an `AttributeError` is raised because `functools.partial` objects do not have a `__name__` attribute.\n\n### Steps to reproduce\n\n```python\nimport functools\nimport schedule\nfrom schedule import every\n\ndef job_fun(arg):\n pass\n\njob_fun = functools.partial(job_fun, 'foo')\njob = every().minute.do(job_fun, bar=True, somekey=23)\nprint(str(job)) # raises AttributeError\n```\n\n### Error message\n\n```\nAttributeError: 'functools.partial' object has no attribute '__name__'. Did you mean: '__ne__'?\n```\n\nThe error originates from `Job.__str__`, which directly accesses `self.job_func.__name__` without checking whether the attribute exists.\n\n### Expected behavior\n\n`str(job)` should work for jobs wrapping `functools.partial` functions, just like `repr(job)` already does. The string representation should include something identifying the partial function (e.g. `functools.partial`) along with the job's arguments and keyword arguments such as `bar=True` and `somekey=23`.\n\n### Actual behavior\n\nAn `AttributeError` is raised because `Job.__str__` unconditionally accesses `__name__` on the job function, which `functools.partial` objects do not provide. Note that `Job.__repr__` already handles this gracefully by falling back to `repr(self.job_func)`, but `Job.__str__` does not have the same fallback.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `schedule`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-96729349c8419e023e62", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:fb0e502fa1be875f5beef361e887cfbd1673707c64d6d4782952c79e34f6fc40", "task_path": "tasks/r2e-gym-96729349c8419e023e62", "instruction": "## `TTLCache.expire()` returns `None` instead of expired `(key, value)` pairs\n\n### Description\n\nCalling `TTLCache.expire()` currently returns `None`, but it should return an iterable of `(key, value)` pairs for all items that were removed from the cache during the call.\n\nFor example:\n\n```python\nfrom cachetools import TTLCache\n\ncache = TTLCache(maxsize=3, ttl=3, timer=lambda: 0)\ncache[1] = 1\ncache[2] = 2\ncache[3] = 3\n\nitems = cache.expire(3) # should expire key 1\nprint(set(items)) # expected: {(1, 1)}, actual: TypeError: 'NoneType' object is not iterable\n```\n\nThis also fails when using `datetime`-based timers:\n\n```python\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\ncache = TTLCache(maxsize=1, ttl=timedelta(days=1), timer=datetime.now)\ncache[1] = 1\n\nitems = cache.expire(datetime.now() + timedelta(days=1))\nprint(list(items)) # expected: [(1, 1)], actual: TypeError: 'NoneType' object is not iterable\n```\n\n### Expected behavior\n\n`TTLCache.expire()` should return an iterable (e.g. a list) of `(key, value)` pairs corresponding to the items that were expired and removed from the cache. If no items expired, it should return an empty iterable.\n\n### Actual behavior\n\n`TTLCache.expire()` returns `None`, causing a `TypeError: 'NoneType' object is not iterable` when the caller tries to iterate over the result.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-9adb16f0805a7fcb5846", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:535a57b938b85cd2e1883f030e3348ef00826f6c4a0d9cbaa1895d44591482cb", "task_path": "tasks/r2e-gym-9adb16f0805a7fcb5846", "instruction": "## `get_parameters()` returns empty list for SQL functions with typed literal arguments\n\nWhen calling `get_parameters()` on a parsed SQL function that uses typed literal parameters (e.g., `DATE '2023-11-14'` or `TIMESTAMP '2023-11-15'`), the method returns an empty list instead of the expected parameters.\n\n### Example\n\n```python\nimport sqlparse\n\nt = sqlparse.parse(\"foo(DATE '2023-11-14', TIMESTAMP '2023-11-15')\")[0].tokens[0].get_parameters()\nprint(len(t)) # prints 0, expected 2\n```\n\n### Expected behavior\n\n`get_parameters()` should return a list containing the two typed literal tokens (`DATE '2023-11-14'` and `TIMESTAMP '2023-11-15'`), so `len(t)` should be `2`.\n\n### Actual behavior\n\nThe method returns an empty list (`[]`), so `len(t)` is `0`.\n\n### Root cause\n\nThe `Function.get_parameters()` method in `sqlparse/sql.py` checks whether tokens are instances of `Function`, `Identifier`, or have a `T.Literal` type, but does not handle `TypedLiteral` tokens. Since typed literals like `DATE '2023-11-14'` are represented as `TypedLiteral` instances (not plain `Identifier` or `T.Literal`), they are silently skipped and never added to the result.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-9daf3bb286e3f4f93a79", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:c098d3191783c6a3ceadc62fe1fadfda8232c445a97e8192a5c354e58e6684a0", "task_path": "tasks/r2e-gym-9daf3bb286e3f4f93a79", "instruction": "## `autocurry` decorator does not preserve function metadata (docstring, name, etc.)\n\nWhen using `autocurry` as a decorator, the wrapped function loses its metadata such as `__doc__` and `__name__`. For example:\n\n```python\nfrom funcy import autocurry\n\n@autocurry\ndef f(a, b):\n 'docstring'\n\nprint(f.__doc__) # prints None, expected 'docstring'\n```\n\n### Expected behavior\n\n`f.__doc__` should be `'docstring'` — the decorator should preserve the original function's metadata.\n\n### Actual behavior\n\n`f.__doc__` is `None`. The `autocurry` wrapper replaces the original function with an inner `autocurried` closure that doesn't copy over the wrapped function's attributes.\n\n### Root cause\n\nIn `funcy/funcs.py`, the `autocurry` function defines an inner `autocurried` function but does not apply `functools.wraps(func)` to it. As a result, attributes like `__doc__`, `__name__`, and `__module__` are not propagated to the returned callable. Adding `@wraps(func)` (from `functools`) to the inner `autocurried` function should fix this.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-9dd83e0127b63cd5715a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:5a7ea5d6b15e3f86228943232681b9d9ff7057e8da3f5f0341ba607dc07363a8", "task_path": "tasks/r2e-gym-9dd83e0127b63cd5715a", "instruction": "## Bug: `Requirement('demo===x,y')` raises `InvalidSpecifier` instead of `InvalidRequirement`\n\nWhen parsing a requirement string that contains a specifier set where some tokens are invalid (e.g., `demo===x,y`), the library raises `packaging.specifiers.InvalidSpecifier` instead of `packaging.requirements.InvalidRequirement`.\n\n### Description\n\nThe specifier string `===x,y` is parsed and split into individual specifiers `['===x', 'y']`. The token `y` alone is not a valid specifier, so `SpecifierSet` raises `InvalidSpecifier`. However, since this error originates from parsing a requirement string, the expected exception type is `InvalidRequirement`.\n\nThis inconsistency also breaks the pickle `__setstate__` path: when restoring a `Requirement` from an invalid string like `demo===x,y`, the code internally calls `Requirement(requirement_string)`. If that call raises `InvalidSpecifier` instead of `InvalidRequirement`, the `__setstate__` method doesn't catch it and re-raise as `TypeError`, so the wrong exception type propagates.\n\n### Reproduction\n\n```python\nfrom packaging.requirements import InvalidRequirement, Requirement\n\n# This should raise InvalidRequirement, but currently raises InvalidSpecifier\ntry:\n Requirement('demo===x,y')\nexcept InvalidRequirement:\n print('Got expected InvalidRequirement')\nexcept Exception as e:\n print(f'Got unexpected exception: {type(e).__name__}: {e}')\n```\n\nFor the pickle path:\n\n```python\nfrom packaging.requirements import Requirement\n\nr = Requirement.__new__(Requirement)\ntry:\n r.__setstate__('demo===x,y')\nexcept TypeError as e:\n print(f'Got expected TypeError: {e}')\nexcept Exception as e:\n print(f'Got unexpected exception: {type(e).__name__}: {e}')\n```\n\n### Expected Behavior\n\n- `Requirement('demo===x,y')` should raise `InvalidRequirement` with a message matching `\"Invalid specifier: 'y'\"`.\n- `r.__setstate__('demo===x,y')` should raise `TypeError` with a message matching `\"Cannot restore Requirement\"`.\n\n### Actual Behavior\n\nBoth cases raise `packaging.specifiers.InvalidSpecifier: Invalid specifier: 'y'` instead of the expected exception types.\n\n### Fix\n\nIn `Requirement.__init__`, when constructing the `SpecifierSet` from the parsed specifier string, `InvalidSpecifier` should be caught and re-raised as `InvalidRequirement`. This ensures that all errors originating from parsing a requirement string are reported under the correct exception type.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/packaging`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-a27703f95dfc397593a0", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:14f60a4a2b5bcd94fc4b9a81a6c500195f40c9ea5df991c911dfb8112e3a6520", "task_path": "tasks/r2e-gym-a27703f95dfc397593a0", "instruction": "## `invoke()` does not raise an error when using restricted keys in the path\n\nWhen calling `invoke()` with a path that contains restricted keys like `__globals__` or `__builtins__`, no exception is raised. This is a security concern since other functions in pydash correctly block access to restricted keys.\n\n### Reproduce\n\n```python\nimport pydash as _\n\n# Should raise KeyError but doesn't\n_.invoke({}, \"__globals__\")\n_.invoke({}, \"a.__globals__.b\")\n_.invoke([], \"__builtins__\")\n_.invoke([], \"a.__builtins__.b\")\n```\n\nNone of these calls raise any exception, even though `__globals__` and `__builtins__` are restricted keys that should not be accessible.\n\n### Expected behavior\n\nEach of the above calls should raise a `KeyError` with a message containing `\"access to restricted key\"`, consistent with how other pydash functions handle restricted key access.\n\n### Actual behavior\n\nNo exception is raised. The call silently proceeds (or returns `None`) without any security check on the path components. This means restricted keys like `__globals__` and `__builtins__` can be passed to `invoke()` without triggering the expected `KeyError`.\n\nThis affects both direct restricted key paths (e.g., `\"__globals__\"`) and nested paths where a restricted key appears as a component (e.g., `\"a.__globals__.b\"`), and applies regardless of whether the object being invoked on is a `dict` or a `list`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-ab37c2e89fc16f9c7f9e", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:00cc286091e54a74c65c8bea841034ccdec7eb562a9be15d001f29bd20180fda", "task_path": "tasks/r2e-gym-ab37c2e89fc16f9c7f9e", "instruction": "## `BarrelList` slice deletion raises `IndexError` for out-of-bounds stop and multi-barrel spans\n\nThere are two related bugs in `BarrelList.__delitem__` / `del_slice` that cause `IndexError` in cases that should work fine.\n\n### Bug 1: Deleting to the end of the list raises `IndexError`\n\nWhen the `stop` index is `None` or greater than or equal to the length of the `BarrelList`, an `IndexError` is raised instead of simply deleting to the end:\n\n```python\nfrom boltons.listutils import BarrelList\n\nreference = list(range(30000))\nvalue = BarrelList(range(30000))\n\n# Any of these should work like the equivalent list operation:\ndel reference[10000:None] # works fine on a list\ndel value[10000:None] # raises IndexError!\n```\n\nThe same happens with `del value[10000:30000]` or `del value[10000:40000]` — any stop at or beyond the list length triggers the error.\n\n### Bug 2: Deleting a slice that spans more than two internal barrels raises `IndexError`\n\nWhen a delete slice crosses multiple internal barrels, the deletion logic removes intermediate barrels first, which invalidates the `stop_list_idx`, causing an `IndexError` when it tries to trim the stop barrel:\n\n```python\nfrom boltons.listutils import BarrelList\n\nreference = list(range(12))\nvalue = BarrelList()\n# Manually set up 4 sub-lists of 3 elements each\nvalue.lists = [list(range(i, i + 3)) for i in range(0, 12, 3)]\n# [[0,1,2], [3,4,5], [6,7,8], [9,10,11]]\n\ndel reference[2:10] # works fine on a list -> [0, 1, 10, 11]\ndel value[2:10] # raises IndexError!\n```\n\nThis happens for any slice that spans at least three internal barrels (i.e., `stop_list_idx - start_list_idx > 1`).\n\n### Expected behavior\n\nBoth operations should produce the same result as the equivalent slice deletion on a plain Python `list`, with no exception raised.\n\n### Actual behavior\n\nBoth cases raise `IndexError`:\n- Out-of-bounds stop: `IndexError` raised in `del_slice` when translating the stop index.\n- Multi-barrel span: `IndexError: list index out of range` raised when trying to access `self.lists[stop_list_idx]` after intermediate barrels have already been removed.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-b12859f8416d1f992b53", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:c64ad64697aa758cc7acb9c2d1fc2a9042c4bd56af901dbb16a5e25b3cc58996", "task_path": "tasks/r2e-gym-b12859f8416d1f992b53", "instruction": "## `funcutils.wraps` forwards defaulted arguments positionally instead of as keywords\n\nWhen using `boltons.funcutils.wraps` to build a wrapper function, defaulted arguments (those with a default value) are forwarded positionally in the generated invocation. This means they land in the wrapper's `*args` instead of `**kwargs`, which causes several problems.\n\n### Problem 1: Defaulted args don't reach `**kwargs`\n\nConsider a decorator that intercepts a defaulted argument from `**kwargs`:\n\n```python\nfrom boltons.funcutils import wraps\n\ndef power(x, y, msg=''):\n return (x, y, msg)\n\ndef flip(f):\n @wraps(f)\n def wrapper(*args, **kwargs):\n return f(*reversed(args), **kwargs)\n return wrapper\n\nprint(flip(power)(3, 2, msg='abc')) # expected: (2, 3, 'abc')\n```\n\nActual output: `('abc', 2, 3)` — `msg` was flattened into `*args` by the generated invocation and got reversed along with the positional args. It should have stayed in `**kwargs`.\n\n### Problem 2: `wraps` with `expected` defaulted arg causes `KeyError`\n\n```python\nfrom boltons.funcutils import wraps\n\ndef wrappable_func(a, b):\n return (a, b)\n\ndef expect_pair(func):\n @wraps(func, expected=[('c', 5)])\n def wrapped(*args, **kwargs):\n c = kwargs.pop('c') # KeyError: 'c'\n return func(*args, **kwargs) + (c,)\n return wrapped\n\nexpect_pair(wrappable_func)(1, 2) # should return (1, 2, 5)\n```\n\nRaises `KeyError: 'c'` because `c` (a defaulted expected arg) is forwarded positionally and ends up in `*args`, not `**kwargs`.\n\n### Problem 3: `wraps(g)(f)` fails when `f` has a keyword-only arg matching `g`'s defaulted positional arg\n\n```python\nfrom boltons.funcutils import wraps\n\ndef g(a: float, b=10):\n return a * b\n\ndef f(a: int, *, b=1):\n return a * b\n\nresult = wraps(g)(f)(3) # should return 30 (g's b=10 forwarded as keyword)\n```\n\nRaises `TypeError: f() takes 1 positional argument but 2 were given`, because `b=10` (a defaulted arg of `g`) is forwarded positionally to `f`, which only accepts `b` as a keyword.\n\n### Problem 4: `FunctionBuilder.get_invocation_str()` returns wrong string for defaulted args\n\n```python\nfrom boltons.funcutils import FunctionBuilder\n\nfb = FunctionBuilder(\n name='return_five',\n body='return 5',\n args='a',\n defaults=dict(a='a')\n)\nprint(fb.get_invocation_str()) # returns 'a', should return 'a=a'\n```\n\n### Expected behavior\n\nDefaulted arguments (that are not positional-only and do not precede `*varargs`) should be forwarded as keyword arguments in the generated invocation string — i.e., `a=a` instead of `a`. This ensures they arrive in the wrapper's `**kwargs` and can be intercepted or passed through correctly. Positional-only params and args preceding `*varargs` should remain positional.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-b3da366d391bf5c3f6ff", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:f6db62c7f55979ebdc58bc879e0f9e18e72ffeed05332ca2f2b0b3e6ac54ea55", "task_path": "tasks/r2e-gym-b3da366d391bf5c3f6ff", "instruction": "## `Function` object has no attribute `get_window`\n\nWhen parsing a SQL window function expression like `foo(5) over win1` or `foo(5) over (PARTITION BY c1)`, calling `get_window()` on the resulting `Function` object raises an `AttributeError` because the method does not exist.\n\n```python\nimport sqlparse\nfrom sqlparse import sql\n\np = sqlparse.parse('foo(5) over win1')[0]\nfunc = p.tokens[0]\nprint(isinstance(func, sql.Function)) # True\nprint(func.get_parameters()) # should return 1 parameter\nprint(func.get_window()) # AttributeError: 'Function' object has no attribute 'get_window'\n```\n\nSimilarly, for an inline window definition:\n\n```python\np = sqlparse.parse('foo(5) over (PARTITION BY c1)')[0]\nfunc = p.tokens[0]\nprint(func.get_window()) # AttributeError: 'Function' object has no attribute 'get_window'\n```\n\n**Expected behavior:**\n- `get_window()` should return the window specification as an `sql.Identifier` when the OVER clause references a named window (e.g., `over win1`).\n- `get_window()` should return the window specification as an `sql.Parenthesis` when the OVER clause contains an inline definition (e.g., `over (PARTITION BY c1)`).\n- `get_parameters()` should correctly return only the function's own parameters (e.g., 1 parameter for `foo(5) over win1`), not include tokens from the OVER clause.\n\n**Actual behavior:**\n`Function` has no `get_window()` method at all, so calling it raises `AttributeError: 'Function' object has no attribute 'get_window'`. Additionally, `get_parameters()` may behave incorrectly for window functions because it uses `self.tokens[-1]` to find the parenthesis, which may pick up the wrong token when an OVER clause is present.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-b712c7f649c6dc3a5dca", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:bcfeb65af9cdc45cd80eb16c78914693d8bfcc7881e8372f763fca35b2f0eb00", "task_path": "tasks/r2e-gym-b712c7f649c6dc3a5dca", "instruction": "The `raiser()` function in `funcy/flow.py` does not handle the case where a plain string is passed as the first argument. When a string like `\"text\"` is given, it should be treated as a shortcut for `Exception(\"text\")`, so that calling the returned function raises an `Exception` with that message. Currently, passing a string causes a `TypeError: exceptions must derive from BaseException` because the code attempts to raise the string directly.\n\nSteps to reproduce:\n```python\nfrom funcy.flow import raiser\n\nf = raiser(\"text\")\nf() # Should raise Exception(\"text\"), but raises TypeError instead\n```\n\nExpected behavior: `raiser(\"text\")()` raises an `Exception` whose message is `\"text\"`.\n\nActual behavior: A `TypeError` is raised with the message `exceptions must derive from BaseException`.\n\nFix: In `raiser()`, check if the first argument is a `str` and, if so, wrap it in `Exception(...)` before proceeding.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-ba2eade3603e4ed433ce", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:1645ba22633a6b1726bc16a3b9a33432552f88235868fb80259fc82ee92d10a4", "task_path": "tasks/r2e-gym-ba2eade3603e4ed433ce", "instruction": "The `@mru_cache` decorator should emit a `DeprecationWarning` when called, but currently it does not issue any warning.\n\nHere is a minimal reproduction:\n\n```python\nimport warnings\nimport cachetools.func\n\nwith warnings.catch_warnings(record=True) as w:\n warnings.simplefilter(\"always\")\n cached = cachetools.func.mru_cache(maxsize=2)(lambda n: n)\n\nprint(len(w)) # prints 0, expected 1\nprint(w[0].category) # IndexError because no warning was raised\n```\n\nUsing `mru_cache` with any argument style — `mru_cache(maxsize=2)`, `mru_cache(maxsize=None)`, `mru_cache(lambda n: n)`, or `mru_cache(maxsize=0)` — produces no deprecation warning at all.\n\n**Expected behavior:** Every call to `mru_cache` should issue exactly one `DeprecationWarning` (e.g. `\"@mru_cache is deprecated\"`) so that users are notified the decorator is deprecated.\n\n**Actual behavior:** No warning is emitted. The warning count captured inside `catch_warnings` is 0 instead of 1, causing any code that checks for the deprecation warning to fail.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-ba8170e904b225f8a608", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:3dea0dd7e09355e7627f77792a9dc73523829e4bf416e4d85cfcbd4acdabe386", "task_path": "tasks/r2e-gym-ba8170e904b225f8a608", "instruction": "## `ecoutils.get_profile(scrub=True)` still performs identifying lookups before masking them\n\nWhen calling `ecoutils.get_profile(scrub=True)`, the intent is to avoid collecting any identifying information about the host. However, the current implementation still performs the identifying lookups (hostname, fully-qualified domain name, and current working directory) and only masks them *after* the fact by overwriting the values with `'-'`.\n\nThis means that even with `scrub=True`, calls to `socket.gethostname()`, `socket.getfqdn()`, and `os.getcwd()` still happen — which defeats the purpose of scrubbing.\n\n### Reproducing the issue\n\nYou can verify that `socket.gethostname()` is called even with `scrub=True`:\n\n```python\nimport socket\nfrom boltons import ecoutils\n\ndef unreachable(*args):\n raise AssertionError('scrubbed profile resolved the host name')\n\n# Patch gethostname and getfqdn to detect if they are called\noriginal_gethostname = socket.gethostname\noriginal_getfqdn = socket.getfqdn\nsocket.gethostname = unreachable\nsocket.getfqdn = unreachable\n\ntry:\n prof = ecoutils.get_profile(scrub=True)\n print(prof['hostname']) # Should be '-', but AssertionError is raised first\nfinally:\n socket.gethostname = original_gethostname\n socket.getfqdn = original_getfqdn\n```\n\nThis raises `AssertionError: scrubbed profile resolved the host name` because `socket.gethostname()` is called unconditionally.\n\nSimilarly, you can verify `os.getcwd()` is called:\n\n```python\nimport os\nfrom boltons import ecoutils\n\ncalls = []\nreal_getcwd = os.getcwd\n\ndef recording_getcwd():\n calls.append('getcwd')\n return real_getcwd()\n\nos.getcwd = recording_getcwd\nprof = ecoutils.get_profile(scrub=True)\nos.getcwd = real_getcwd\n\nprint(calls) # Prints ['getcwd'] — but should be [] when scrubbing\nprint(prof['cwd']) # Prints '-'\n```\n\nEven though `prof['cwd']` ends up as `'-'`, `os.getcwd()` was still invoked during the call.\n\n### Expected behavior\n\nWhen `scrub=True`, `get_profile` should **not** call `socket.gethostname()`, `socket.getfqdn()`, or `os.getcwd()` at all. These fields should be set directly to `'-'` without performing the underlying system lookups.\n\n### Actual behavior\n\n- `socket.gethostname()` and `socket.getfqdn()` are called unconditionally, then overwritten with `'-'`.\n- `os.getcwd()` is called unconditionally, then overwritten with `'-'`.\n- Calling `get_profile(scrub=True)` with patched/restricted versions of these functions raises errors or records unexpected calls.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-bd9380fa137d254f7c4c", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:0c4e75bc354a3911fa6521f391e4732f75b362ef97d2df2a20aa5cdc558a2183", "task_path": "tasks/r2e-gym-bd9380fa137d254f7c4c", "instruction": "## `wraps` fails when the wrapped function has keyword-only arguments\n\nWhen using `boltons.funcutils.wraps(g)(f)` where `f` declares a parameter as keyword-only (using `*`) but `g` accepts it positionally, the generated shim incorrectly forwards the argument positionally to `f`, causing a `TypeError` at call time.\n\n### Reproducing the issue\n\n**Case 1: keyword-only arg without a default**\n\n```python\nfrom boltons.funcutils import wraps\n\ndef g(a, b):\n return a * b\n\ndef f(a, *, b): # b is keyword-only in f\n return a + b\n\n# This should return 7 (3 + 4), but raises TypeError instead\nresult = wraps(g)(f)(3, 4)\n```\n\nError:\n```\nTypeError: f() takes 1 positional argument but 2 were given\n```\n\n**Case 2: keyword-only arg with varargs in the donor**\n\n```python\nfrom boltons.funcutils import wraps\n\ndef g(a, b, *va):\n pass\n\ndef f(a, *va, b): # b is keyword-only in f\n return (a, va, b)\n\n# This should return (1, (3,), 2), but raises TypeError instead\nresult = wraps(g)(f)(1, 2, 3)\n```\n\nError:\n```\nTypeError: f() missing 1 required keyword-only argument: 'b'\n```\n\n### What's happening\n\n`get_invocation_str()` generates the call expression used inside the shim (e.g., `_call(a, b)` or `_call(a, b=b)`). It decides whether to forward each argument positionally or as a keyword based solely on the *wrapper's* (donor's) signature — it doesn't know anything about the *target* callable's signature. As a result, when the target (`f`) only accepts `b` as a keyword, but the donor (`g`) accepts it positionally, `b` gets forwarded positionally and `f` raises `TypeError`.\n\nThis also affects the varargs case: normally all args are forwarded positionally when `*varargs` is present, but if the target requires `b` as keyword-only, positional forwarding fails.\n\n### Expected behavior\n\n- `wraps(g)(f)(3, 4)` should return `7` (i.e., `3 + 4`).\n- `wraps(g)(f)(3, b=4)` should also return `7`.\n- `wraps(g)(f)(1, 2, 3)` with the varargs case should return `(1, (3,), 2)`.\n\nThe fix should make `get_invocation_str()` (or `update_wrapper`) aware of the target callable's signature so that any argument the target only accepts as a keyword is forwarded as `name=name` in the generated invocation, regardless of whether the donor's signature would pass it positionally.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-bdb3b8943c205f93f73b", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:c07ea239a38b6eb266ed68a0b7d08de3982e748dc05de0cb0158baa8660220b1", "task_path": "tasks/r2e-gym-bdb3b8943c205f93f73b", "instruction": "## `pull_at` raises `IndexError` for out-of-range or duplicate indexes\n\nWhen calling `pull_at` with an index that is out of range (or with duplicate indexes), it raises an `IndexError` instead of gracefully skipping those indexes.\n\nHere are a few cases that reproduce the problem:\n\n```python\nimport pydash as _\n\n# Case 1: empty array with index 0\nresult = _.pull_at([], 0)\nprint(result) # Expected: []\n\n# Case 2: index out of range\nresult = _.pull_at([1, 2, 3], 5)\nprint(result) # Expected: [1, 2, 3]\n\n# Case 3: duplicate index\nresult = _.pull_at([1], 0, 0)\nprint(result) # Expected: []\n```\n\nAll three cases raise:\n```\nIndexError: list assignment index out of range\n```\n\nThe error originates from `arrays.py` in the `pull_at` function, where `del array[index]` is called without any guard against invalid or already-deleted indexes.\n\n**Expected behavior:** `pull_at` should silently skip indexes that are out of range (or already removed due to a duplicate), consistent with how lodash handles this case. The function should return the array with only the valid indexes removed.\n\n**Actual behavior:** An `IndexError` is raised whenever an index is out of bounds or a duplicate index causes the second deletion attempt to reference a position that no longer exists.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-c361c55c76bf6cd10f2a", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:1480ee3f97c72c077abb5068f7426322f4868f08c96e8f93a6a2e89719aab01e", "task_path": "tasks/r2e-gym-c361c55c76bf6cd10f2a", "instruction": "## `cachetools.cached` with `lock` and `info=True` acquires lock too many times on cache miss\n\nWhen using `cachetools.cached` with both a `lock` and `info=True`, a cache miss causes the lock to be acquired **3 times** instead of the expected **2 times**. This is because the internal implementation uses a separate `with lock:` block just to increment the miss counter, even though this could be done within the same lock context as the failed cache lookup.\n\n### Example\n\n```python\nimport cachetools\n\nclass CountedLock:\n def __init__(self):\n self.count = 0\n def __enter__(self):\n self.count += 1\n def __exit__(self, *args):\n pass\n\ncache = cachetools.LRUCache(maxsize=2)\nlock = CountedLock()\n\n@cachetools.cached(cache, lock=lock, info=True)\ndef func(x):\n return x\n\nprint(lock.count) # 1 (from cache_info() call during decoration)\nfunc(0) # cache miss\nprint(lock.count) # prints 4, but should be 3\n```\n\n### Expected behavior\n\nOn a cache miss, the lock should be acquired **twice**: once for the combined cache lookup + miss counter increment, and once for storing the computed value (`setdefault`). So after one miss, `lock.count` should be `3` (1 initial + 2 for the miss).\n\n### Actual behavior\n\nThe lock is acquired **three times** on a cache miss: once for the cache lookup, once separately for incrementing the miss counter, and once for the `setdefault`. After one miss, `lock.count` is `4` instead of `3`.\n\nThis pattern compounds — with two misses, the count is `8` instead of the expected `6`. The fix is to consolidate the cache lookup and miss counter update into a single `with lock:` block in `_cached_locked_info`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-c5cceac05e2316bbc3ee", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:c82db757ac96304bb0acb6104093e1444478da3f74777908f2ac69951b06ecc8", "task_path": "tasks/r2e-gym-c5cceac05e2316bbc3ee", "instruction": "## Bug: `.at()` with timezone schedules job one day too late in certain scenarios\n\nWhen using `schedule` with a timezone argument in `.at()`, the next run time can be calculated incorrectly — specifically, it may be scheduled one full day later than expected.\n\n### Steps to reproduce\n\nConsider the following scenario where the local time is April 14, 2023 at 04:50 (Berlin/local time), and you want to schedule a job to run daily at midnight US/Central time:\n\n```python\nimport schedule\nfrom schedule import every\nimport datetime\n\n# Simulate current local time being 2023-04-14 04:50\n# US/Central time at this moment is 2023-04-13 21:50\n# The next midnight (00:00) US/Central is 2023-04-14 00:00,\n# which converts to 2023-04-14 07:00 local time.\n\ndef job():\n pass\n\nnext_run = every().day.at(\"00:00\", \"US/Central\").do(job).next_run\nprint(next_run) # Expected: 2023-04-14 07:00, Got: 2023-04-15 07:00\n```\n\n### Expected behavior\n\nSince the next scheduled US/Central midnight (00:00) is on April 14 and hasn't occurred yet in local time (local time is 04:50, and the equivalent local time is 07:00), the job should be scheduled for **April 14 at 07:00** local time.\n\n### Actual behavior\n\nThe scheduler incorrectly subtracts a day from the computed next run, then adds another day, resulting in the job being scheduled for **April 15 at 07:00** instead of April 14. The test assertion `next.day == 14` fails with:\n\n```\nassert 15 == 14\n where 15 = MockDate(2023, 4, 15, 7, 0).day\n```\n\nThe problem appears to be that when a timezone is specified, the day-adjustment logic compares the raw target time (e.g., `00:00` in US/Central) directly against the current local time (04:50), rather than comparing the converted local-time equivalent of the next run (07:00) against the current local time. Since `00:00 < 04:50`, the code incorrectly concludes the next run has already passed today and subtracts a day.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `schedule`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-c5ce2b3c06775ebf841c", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:0597a3abaa47dafa860cb0a7727a2456c0fa5ce8ed82f03b32f1bb22a80f35e6", "task_path": "tasks/r2e-gym-c5ce2b3c06775ebf841c", "instruction": "## `OrderedMultiDict.addlist()` silently drops values when passed a one-shot iterator\n\nThe docstring for `addlist()` says \"tuples and other sequences and iterables work\", but passing a one-shot iterator (such as `iter([...])` or a generator expression) as the values argument leaves the `OMD` internally inconsistent: the key appears in `keys()` but `getlist()` returns an empty list.\n\n### Reproducer\n\n```python\nfrom boltons.dictutils import OMD\n\nomd = OMD()\nomd.addlist('a', iter([1, 2, 3])) # one-shot iterator\nomd.addlist('b', (x for x in [4, 5])) # generator expression\n\nprint(omd.keys()) # ['a', 'b'] – keys are recorded\nprint(omd.getlist('a')) # [] – values are gone!\nprint(omd.get('a')) # raises IndexError\n```\n\nRunning this, `omd.keys()` shows `['a', 'b']` as if everything is fine, but `omd.getlist('a')` returns `[]` instead of `[1, 2, 3]`, and calling `omd.get('a')` raises an `IndexError` because the backing value list is empty.\n\nThe problem is that `addlist()` traverses the `v` argument **twice** internally — once to insert keys into the linked list structure, and once to extend the backing values list. A one-shot iterator is fully exhausted by the first pass, so the second pass adds nothing.\n\nThere is also a related edge case with empty generators: the `if not v` guard treats an already-exhausted generator as falsy, so the key ends up recorded with no values, causing `len(omd)` to disagree with `omd.keys()`:\n\n```python\ne_omd = OMD()\ne_omd.addlist('a', (x for x in []))\nprint(len(e_omd)) # should be 0\nprint(e_omd.keys()) # should be []\nprint(e_omd.get('a')) # should be None\n```\n\nNote: the same defect exists in the vendored `OrderedMultiDict` in `urlutils.py`.\n\n### Expected behavior\n\n- `omd.getlist('a')` should return `[1, 2, 3]` when `addlist('a', iter([1, 2, 3]))` was called.\n- `omd.get('a')` should return `3` (the last value).\n- Passing an empty generator should leave the OMD unchanged (`len == 0`, `keys() == []`).\n\n### Actual behavior\n\n`omd.getlist('a')` returns `[]`, and `omd.get('a')` raises an `IndexError`, even though `omd.keys()` correctly lists `'a'` as a key.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-cf3ece8578b5dad5ba56", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:ae756ba6d4b44d8f7443673822fac4b568079b29eda11bdcbbb35efa4e555016", "task_path": "tasks/r2e-gym-cf3ece8578b5dad5ba56", "instruction": "## `MRUCache` does not emit a `DeprecationWarning` on instantiation\n\nInstantiating `MRUCache` should emit a `DeprecationWarning` to indicate that the class is deprecated, but currently no warning is raised at all.\n\n### Steps to reproduce\n\n```python\nimport warnings\nfrom cachetools import MRUCache\n\nwith warnings.catch_warnings(record=True) as w:\n warnings.simplefilter(\"always\")\n cache = MRUCache(maxsize=2)\n\nprint(len(w)) # prints 0, expected 1\nprint(w[0].category) # IndexError: list index out of range\n```\n\nWhen `MRUCache(maxsize=2)` is called inside the `catch_warnings` block, the list of captured warnings `w` remains empty. We expect it to contain exactly one entry whose category is `DeprecationWarning`.\n\n### Expected behavior\n\nCreating an `MRUCache` instance should trigger a `DeprecationWarning` (e.g. `\"MRUCache is deprecated\"`) so that users are informed the class is going away. The warning list `w` should have length 1 and `w[0].category` should be `DeprecationWarning`.\n\n### Actual behavior\n\nNo warning is emitted. `len(w)` is `0`, causing any code that checks for the deprecation warning to fail with `AssertionError: 0 != 1`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-d24642f84b544272d42d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:1336eff21620f9aa2bd69d1ea4d9063517f85f3eb4c1b78f15cfec2c39729024", "task_path": "tasks/r2e-gym-d24642f84b544272d42d", "instruction": "## `@decorator` decorators lose their `__name__` when called with arguments\n\nWhen using `@decorator` from `funcy` to create a decorator that accepts arguments, calling the decorator with arguments returns a new decorator whose `__name__` is `'_decorator'` instead of the original decorator's name. Additionally, there's no way to introspect the decorator's underlying function, positional args, or keyword args via `_func`, `_args`, and `_kwargs`.\n\n### Example\n\n```python\nfrom funcy.decorators import decorator\n\n@decorator\ndef decor(call, x):\n return call()\n\nprint(decor.__name__) # prints 'decor' — correct\n\ndecor_x = decor(42)\nprint(decor_x.__name__) # prints '_decorator' — should be 'decor'\nprint(hasattr(decor_x, '_func')) # False — should be True\nprint(hasattr(decor_x, '_args')) # False — should be True\nprint(hasattr(decor_x, '_kwargs')) # False — should be True\n```\n\n### Expected behavior\n\n- `decor_x.__name__` should be `'decor'` (same as the original decorator's name).\n- `decor_x._func` should refer to the underlying wrapped function (`decor.__wrapped__`).\n- `decor_x._args` should be `(42,)` (the positional arguments passed when creating the decorator).\n- `decor_x._kwargs` should be `{}` (the keyword arguments passed when creating the decorator).\n\n### Actual behavior\n\n`decor_x.__name__` returns `'_decorator'` instead of `'decor'`, and none of the introspection attributes (`_func`, `_args`, `_kwargs`) are present on the returned decorator object.\n\nThe issue is in `make_decorator` — the inner `_decorator` function is not wrapped with `wraps(deco)`, so it doesn't inherit the name or other attributes from the original decorator function. The introspection attributes also need to be explicitly attached.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-d51ed8ab61ddbecf999f", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:73c11517e61e39a100c4e869f2ccd9ec1b0aa2df38d73876a676bc8b5b6ffed9", "task_path": "tasks/r2e-gym-d51ed8ab61ddbecf999f", "instruction": "## `singularize()` corrupts words that end in double 's'\n\nThe `singularize()` function in `boltons.strutils` incorrectly strips the trailing `'s'` from words that already end in `'ss'` and are already singular. For example:\n\n```python\nfrom boltons import strutils\n\nprint(strutils.singularize('glass')) # prints 'glas' (expected 'glass')\nprint(strutils.singularize('boss')) # prints 'bos' (expected 'boss')\nprint(strutils.singularize('class')) # prints 'clas' (expected 'class')\nprint(strutils.singularize('kiss')) # prints 'kis' (expected 'kiss')\nprint(strutils.singularize('address')) # prints 'addres' (expected 'address')\n```\n\nThis also breaks idempotency. The docstring implies `singularize('Glasses') == 'Glass'`, which works correctly — but then calling `singularize` on that result corrupts it further:\n\n```python\nresult = strutils.singularize('Glasses') # 'Glass' (correct)\nresult2 = strutils.singularize(result) # 'Glas' (wrong!)\n```\n\nWords ending in `'ss'` are already singular in English — their plurals end in `'sses'` (e.g. `glasses`, `bosses`), which is already handled by an earlier branch in the function. The final fallback `word[:-1]` should not apply to words ending in `'ss'`.\n\n**Expected behavior:** `singularize('glass')` should return `'glass'`, `singularize('boss')` should return `'boss'`, etc. The function should also be idempotent: applying it twice to a word like `'Glasses'` should give `'Glass'` both times, not `'Glas'` on the second call.\n\n**Actual behavior:** Any word ending in `'ss'` has its final `'s'` stripped, producing a corrupted non-word. The real plurals (`'glasses'` → `'glass'`, `'bosses'` → `'boss'`) continue to work correctly since they are handled by the `'es'`/`'ses'` branch that runs earlier.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-d5f74d9ab2fd719c19b3", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:f70bf94295d7f96104571b9136703faa83a6f581b212eb5e56eabd7f11daa8ba", "task_path": "tasks/r2e-gym-d5f74d9ab2fd719c19b3", "instruction": "## `get_real_name()` returns alias instead of actual table name when alias is present\n\n### Description\n\nWhen parsing a SQL statement where a table has an alias (e.g. `UPDATE a t SET t.b=1`), calling `get_real_name()` on the parsed statement incorrectly returns the alias (`'t'`) instead of the real table name (`'a'`).\n\nHere's a minimal example to reproduce:\n\n```python\nimport sqlparse\n\ns = \"update a t set t.b=1\"\nstmts = sqlparse.parse(s)\nprint(stmts[0].get_real_name()) # prints 't', should print 'a'\nprint(stmts[0].get_alias()) # prints 't'\n```\n\n### Expected behavior\n\n`get_real_name()` should return `'a'` — the actual table name — not `'t'`, which is the alias. `get_alias()` should return `'t'`.\n\n### Actual behavior\n\n`get_real_name()` returns `'t'` (the alias) instead of `'a'` (the real name). Both `get_real_name()` and `get_alias()` return the same value.\n\n### Root cause\n\nIn `TokenList._get_first_name`, when the first matching token is an `Identifier` or `Function`, it calls `token.get_name()` unconditionally. `get_name()` returns the alias if one is present, so `get_real_name()` ends up returning the alias. The fix should ensure that when `get_real_name()` calls `_get_first_name`, it uses `get_real_name()` recursively on sub-identifiers rather than `get_name()`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-d7daf4d241da20a11b6c", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:d117e2ce065ed47c32454e94187c1ab5b681e9e21fa102aa9b89b8bc5323e849", "task_path": "tasks/r2e-gym-d7daf4d241da20a11b6c", "instruction": "## `is_sorted` fails with objects that only implement `__lt__`\n\nPython's sorting protocol only requires objects to implement `__lt__`. However, `is_sorted` internally uses the `<=` operator (for the non-strict case), which means it breaks for objects that only define `__lt__` but not `__le__`.\n\nHere's a minimal example:\n\n```python\nimport more_itertools as mi\n\nclass BarelySortable:\n def __init__(self, value):\n self.value = value\n\n def __lt__(self, other):\n return self.value < other.value\n\nitems = [BarelySortable(x) for x in [1, 2, 3]]\nprint(mi.is_sorted(items)) # Should print True\n```\n\nThis raises:\n```\nTypeError: '<=' not supported between instances of 'BarelySortable' and 'BarelySortable'\n```\n\nThe same error occurs for any non-strict call to `is_sorted` with objects that only support `<`. Since Python's built-in `sorted()` works fine with just `__lt__`, `is_sorted` should as well.\n\n**Expected behavior:** `is_sorted` should work correctly for any object that supports the `<` operator, consistent with Python's sorting protocol.\n\n**Actual behavior:** A `TypeError` is raised because `is_sorted` attempts to use `<=` internally, which is not required by Python's sort protocol.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `more_itertools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-daff1aca5b8e118a5650", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:4d09c9ed80450b1e69c77509d81206aaff60e7e4a353538f824f8e038fd0b2ed", "task_path": "tasks/r2e-gym-daff1aca5b8e118a5650", "instruction": "## `merge_with` iteratee is not applied to nested objects\n\nWhen using `merge_with` with a custom iteratee and the source objects contain nested dictionaries, the iteratee is only applied at the top level. Any nested structures are merged without the iteratee, so the custom merge logic is silently ignored for nested values.\n\n### Example\n\n```python\nimport pydash as _\n\nobj1 = {\"fruits\": [\"apple\"], \"others\": {\"vegetables\": [\"beet\"]}}\nobj2 = {\"fruits\": [\"banana\"], \"others\": {\"vegetables\": [\"carrot\"]}}\n\ndef my_merge(a, b):\n # Concatenate lists, otherwise let pydash decide\n if isinstance(a, list):\n return a + b\n return None\n\nresult = _.merge_with(obj1, obj2, my_merge)\nprint(result)\n```\n\nThe `fruits` key is at the top level, so the iteratee is applied and the lists are concatenated correctly. But `vegetables` lives inside the nested `others` dict, so the iteratee is never called for it.\n\n### Expected behavior\n\nThe result should be:\n```\n{'fruits': ['apple', 'banana'], 'others': {'vegetables': ['beet', 'carrot']}}\n```\n\nThe iteratee should be applied recursively at every level of nesting, so `['beet']` and `['carrot']` are concatenated just like the top-level `fruits` lists.\n\n### Actual behavior\n\nThe result is:\n```\n{'fruits': ['apple', 'banana'], 'others': {'vegetables': ['carrot']}}\n```\n\nWhen `_merge_with` recurses into the nested `others` mapping, the iteratee is not forwarded to the recursive call. As a result, the nested `vegetables` lists are not concatenated — the source value simply overwrites the destination value.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/pydash`, `pydash`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-dc58657479c946e637fb", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:78c4777bcfd050b226ba439d939faf6662f4be4be4e8560f75dd986fc3b9b61e", "task_path": "tasks/r2e-gym-dc58657479c946e637fb", "instruction": "## `_pprint_tree` produces incorrect tree formatting\n\nThe `_pprint_tree` method on `TokenList` is not rendering the expected tree-style output. Instead of using branch characters (`|-` for intermediate nodes and `` `- `` for the last child), it outputs plain indented lines with a simple `| ` prefix.\n\nHere's a minimal reproduction:\n\n```python\nimport sqlparse\nfrom sqlparse.compat import StringIO\n\np = sqlparse.parse('select a0, b0, c0, d0, e0 from (select * from dual) q0 where 1=1 and 2=2')[0]\noutput = StringIO()\np._pprint_tree(f=output)\nprint(output.getvalue())\n```\n\nCurrent output (first few lines):\n```\n 0 DML 'select'\n 1 Whitespace ' '\n 2 IdentifierList 'a0, b0...'\n | 0 Identifier 'a0'\n | | 0 Name 'a0'\n```\n\n**Expected output:**\n```\n|- 0 DML 'select'\n|- 1 Whitespace ' '\n|- 2 IdentifierList 'a0, b0...'\n| |- 0 Identifier 'a0'\n| | `- 0 Name 'a0'\n...\n`- 8 Where 'where ...'\n |- 0 Keyword 'where'\n ...\n `- 6 Comparison '2=2'\n |- 0 Integer '2'\n |- 1 Comparison '='\n `- 2 Integer '2'\n```\n\nThe method needs to:\n1. Prefix each token line with `|- ` if it is not the last token in its parent, or `` `- `` if it is the last.\n2. When recursing into a group, pass an accumulated prefix string: `| ` if the current node is not last, ` ` (three spaces) if it is last, so that vertical bar lines are drawn correctly for non-terminal branches.\n3. Drop the fixed-width index formatting (`:2d`) so the index is printed as-is.\n\nWithout these changes, the tree structure is visually flat and does not distinguish last children from intermediate ones, making it hard to read deeply nested SQL parse trees.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-dd9dd3a586c2a5f7425c", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:db86da512b08ed5f93a206e224904f0e1567e6776275cc36e509a5e56e4a8aca", "task_path": "tasks/r2e-gym-dd9dd3a586c2a5f7425c", "instruction": "## Bug: `LowerBound(None, True)` and `UpperBound(None, True)` don't normalize `inclusive` and sort above their `False` counterparts\n\n### Description\n\nWhen constructing an unbounded `LowerBound` or `UpperBound` with `version=None` and `inclusive=True`, the `inclusive` attribute is not normalized to `False`. Because `None` represents negative or positive infinity, the `inclusive` flag is semantically meaningless for unbounded ends — there is only one -inf and one +inf. However, the current implementation keeps `inclusive=True`, which causes the two spellings to be treated as distinct values.\n\nThis has two concrete consequences:\n\n1. **Equality/hashing is broken**: `LowerBound(None, True)` and `LowerBound(None, False)` (i.e., `NEG_INF`) are not equal and do not share the same hash, so they appear as two separate objects in a set.\n2. **Ordering is broken**: The total ordering implementation sees `inclusive=True` as \"larger\" than `inclusive=False`, causing `LowerBound(None, True) > LowerBound(None, False)` to return `True` — i.e., one spelling of -inf sorts above the other.\n\n### Reproduction\n\n```python\nfrom packaging._ranges import LowerBound, UpperBound, NEG_INF, POS_INF\n\n# Constructing an unbounded lower bound with inclusive=True\nbound = LowerBound(None, True)\nprint(bound.inclusive) # prints True, expected False\nprint(bound == NEG_INF) # prints False, expected True\nprint(len({bound, NEG_INF})) # prints 2, expected 1\n\na, b = LowerBound(None, True), LowerBound(None, False)\nprint(a > b) # prints True, expected False (they should be equal)\nprint(a <= b) # prints False, expected True\n```\n\nSame issue applies to `UpperBound`:\n\n```python\nbound = UpperBound(None, True)\nprint(bound.inclusive) # prints True, expected False\nprint(bound == POS_INF) # prints False, expected True\n\na, b = UpperBound(None, True), UpperBound(None, False)\nprint(a > b) # prints True, expected False\n```\n\n### Expected behavior\n\n- `LowerBound(None, True).inclusive` should be `False` (forced/normalized).\n- `LowerBound(None, True)` should equal `LowerBound(None, False)` (i.e., `NEG_INF`), share the same hash, and appear as one element in a set.\n- Comparison operators between any two spellings of the unbounded end should treat them as equal: `a < b` → `False`, `a > b` → `False`, `a <= b` → `True`, `a >= b` → `True`.\n- Same normalization applies to `UpperBound(None, True)` vs `UpperBound(None, False)` (`POS_INF`).\n\n### Actual behavior\n\n- `LowerBound(None, True).inclusive` is `True`.\n- `LowerBound(None, True) != LowerBound(None, False)`, and they hash differently.\n- `LowerBound(None, True) > LowerBound(None, False)` returns `True` instead of `False`.\n- The fix should be in `LowerBound.__init__` and `UpperBound.__init__`: when `version is None`, force `inclusive = False` before storing it.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/packaging`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-ddf968daf98bf6e87a63", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:31d766c07a7317615ac16105e91ad45452397bb17918fede5296b900a94e9317", "task_path": "tasks/r2e-gym-ddf968daf98bf6e87a63", "instruction": "## `@cachedmethod` does not pass `self` to the key function\n\nWhen using `@cachedmethod` with an explicit `key` argument, `self` is not passed to the key function. This causes two problems:\n\n1. User-supplied key functions cannot incorporate `self` (the instance) into the cache key, making it impossible to have per-instance cache differentiation via the key.\n2. It creates inconsistent behavior: if `self` is unhashable (i.e., `__hash__` raises `TypeError`), passing `key=keys.hashkey` explicitly should fail because `self` cannot be hashed — but it doesn't, because `self` is silently dropped before calling the key function.\n\nHere's a minimal example to reproduce the issue:\n\n```python\nimport operator\nimport unittest\nfrom cachetools import LRUCache, cachedmethod, keys\n\nclass Unhashable:\n def __init__(self, cache):\n self.cache = cache\n\n @cachedmethod(operator.attrgetter(\"cache\"))\n def get_default(self, value):\n return value\n\n @cachedmethod(operator.attrgetter(\"cache\"), key=keys.hashkey)\n def get_hashkey(self, value):\n return value\n\n def __hash__(self):\n raise TypeError(\"unhashable type\")\n\ncached = Unhashable(LRUCache(maxsize=0))\nprint(cached.get_default(0)) # should work fine\nprint(cached.get_default(1)) # should work fine\ncached.get_hashkey(0) # should raise TypeError because self is unhashable\n```\n\n**Expected behavior:** `cached.get_hashkey(0)` should raise a `TypeError` because `self` is unhashable and `keys.hashkey` is being used as the key function — meaning `self` should be included in the key computation.\n\n**Actual behavior:** No `TypeError` is raised. The call to `cached.get_hashkey(0)` succeeds silently because `self` is never passed to the key function — it's called as `key(*args, **kwargs)` instead of `key(self, *args, **kwargs)`. As a result, the unhashable `self` is never seen by `hashkey`, and the bug goes undetected.\n\nThe fix should ensure that `self` is passed as the first argument to the key function in `cachedmethod`, and the default key function for `cachedmethod` should be updated to strip `self` before hashing (so the default behavior remains backward-compatible for cases where `self` is not needed in the key).\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-df95120c370c23e038c0", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:494c90c26cf8037eada9c86617f21e2f884da26a0cf44714528da48db9b6ce81", "task_path": "tasks/r2e-gym-df95120c370c23e038c0", "instruction": "## `repr()` crashes on a partially constructed Job (before `.do()` is called)\n\n### Description\n\nCalling `repr()` on a `Job` that has been created with `schedule.every(...)` but hasn't had `.do()` called yet raises an `AttributeError`. Since `job_func` is `None` at that point, accessing `.args` on it fails.\n\n```python\nimport schedule\n\n# Partially constructed job — no .do() called yet\njob = schedule.every(10)\nprint(repr(job)) # AttributeError: 'NoneType' object has no attribute 'args'\n```\n\nThis can happen any time you inspect or log a job before it's fully set up.\n\n### Error\n\n```\nAttributeError: 'NoneType' object has no attribute 'args'\n```\n\nThe traceback points to `Job.__repr__` in `schedule/__init__.py`, specifically the line:\n```python\nargs = [repr(x) if is_repr(x) else str(x) for x in self.job_func.args]\n```\n\n### Expected behavior\n\n`repr()` on a partially constructed job (where `job_func` is still `None`) should return a meaningful string without raising an exception. For example:\n\n```\nEvery 10 None do [None] (last run: [never], next run: [never])\n```\n\n### Actual behavior\n\nAn `AttributeError` is raised because `Job.__repr__` unconditionally accesses `self.job_func.args` without first checking whether `self.job_func` is `None`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `schedule`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-e270831f22fd1f5736c6", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:ec1717194a368580569dc58c591649db1f2fda33a2b3c9cb1801c557f2555103", "task_path": "tasks/r2e-gym-e270831f22fd1f5736c6", "instruction": "## `TIMESTAMP` typed literal not grouped correctly in sqlparse\n\nWhen parsing a SQL expression like `x > TIMESTAMP '2020-01-01 00:00:00'`, the `TIMESTAMP '...'` part is not being grouped into a `TypedLiteral` node. Instead, `TIMESTAMP` remains as a bare `Keyword` token.\n\nHere's a minimal example that demonstrates the issue:\n\n```python\nimport sqlparse\nfrom sqlparse import sql\n\nparsed = sqlparse.parse(\"x > TIMESTAMP '2020-01-01 00:00:00'\")[0]\nprint(type(parsed[4])) # Expected: <class 'sqlparse.sql.TypedLiteral'>\n # Actual: <class 'sqlparse.sql.Token'> (a Keyword)\n```\n\nFor comparison, `DATE` works correctly:\n\n```python\nparsed = sqlparse.parse(\"x > DATE '2020-01-01'\")[0]\nprint(type(parsed[4])) # Correctly returns <class 'sqlparse.sql.TypedLiteral'>\n```\n\n### Expected behavior\n\nBoth `DATE '...'` and `TIMESTAMP '...'` should be grouped as `sql.TypedLiteral` instances, since they are both typed literals in standard SQL.\n\n### Actual behavior\n\nFor `x > TIMESTAMP '2020-01-01 00:00:00'`, the token at index 4 is a `Keyword` (`TIMESTAMP`) rather than a `TypedLiteral`. The grouping logic does not recognize `TIMESTAMP` as a valid opener for a typed literal, so the keyword and the following string literal are never combined into a single `TypedLiteral` node.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `sqlparse`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-e3b20adc5e5a17d63ed0", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:b40b5474c0f56adf741d53dfaa13b7d95a65beb5d8001af38319524849f50212", "task_path": "tasks/r2e-gym-e3b20adc5e5a17d63ed0", "instruction": "## `memoize` ignores `key_func` when the function is passed directly\n\nWhen calling `memoize` with both a function as the first positional argument and a `key_func` keyword argument, the `key_func` is silently ignored. This causes a `TypeError` when the function's arguments are unhashable (e.g., lists), because the raw arguments are used as cache keys instead of being transformed by `key_func`.\n\n### Example\n\n```python\nfrom funcy.calc import memoize\n\ncalls = []\n\ndef total(values):\n calls.append(list(values))\n return sum(values)\n\n# Pass function directly along with key_func\ncached_total = memoize(total, key_func=tuple)\ncached_total([1, 2]) # Should work and return 3\n```\n\nRunning this raises:\n\n```\nTypeError: unhashable type: 'list'\n```\n\nThe error occurs inside `memoize`'s wrapper when it tries to use the raw list `[1, 2]` as a dictionary key, because `key_func=tuple` was not applied.\n\n### Expected behavior\n\nCalling `memoize(func, key_func=some_func)` should behave the same as the decorator form `@memoize(key_func=some_func)` — the `key_func` should be used to transform the arguments into a hashable cache key. In the example above, `tuple` should convert `[1, 2]` to `(1, 2)` before looking it up in the cache, so `cached_total([1, 2])` should return `3` and the result should be cached properly.\n\n### Actual behavior\n\nWhen the function is passed directly as the first positional argument (i.e., `memoize(total, key_func=tuple)`), the `key_func` argument is dropped internally and the default (no key transformation) is used instead, leading to a `TypeError` for unhashable argument types.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-e449f3a74c16c9c7b926", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:c643686098cd85530882a770861f44d9fa5003654d3e783088d62845eea76273", "task_path": "tasks/r2e-gym-e449f3a74c16c9c7b926", "instruction": "## Long-running jobs skip periods when they finish past their scheduled time\n\nWhen a job takes longer than its interval to complete (e.g., a daily job at 23:30 that takes 1.5 hours and finishes at 01:00 the next day), the scheduler incorrectly skips the current period and schedules the next run one full period ahead.\n\n### Example\n\n```python\nimport schedule\nfrom schedule import every\n\nmock_job = lambda: None\n\n# Schedule a daily job at 23:30\n# Simulate scheduling at day 1, 23:00\njob = every().day.at('23:30').do(mock_job)\n# job.next_run is day 1 at 23:30 — correct\n\n# Now simulate the job finishing on day 2 at 01:00\n# (the job started at 23:30 on day 1 and took 1.5 hours)\njob.run() # called at 2010-12-02 01:00:00\nprint(job.next_run) # Expected: 2010-12-02 23:30:00, Got: 2010-12-03 23:30:00\n```\n\nThe same issue occurs with hourly and per-minute jobs. For example, an hourly job scheduled at `:10` that is run at `13:00` (having missed its `12:10` slot because the previous run was long) should next run at `13:10`, but instead it schedules for `14:10`:\n\n```python\njob = every().hour.at(':10').do(mock_job)\n# scheduled at 12:00 → next_run is 12:10\n\njob.run() # called at 13:00 (job was long-running)\nprint(job.next_run) # Expected: 13:10, Got: 14:10\n```\n\nAnd for minute-interval jobs:\n\n```python\njob = every().minute.at(':15').do(mock_job)\n# scheduled at 10:10 → next_run is 10:10:15\n\njob.run() # called at 10:12:14\nprint(job.next_run) # Expected: 10:12:15, Got: 10:13:15\n```\n\n### Expected behavior\n\nWhen a long-running job finishes in a later period than it started, the scheduler should recognize that the current period has not yet had a run and schedule the next occurrence within that same period (not the next one). Essentially, it should not skip the period in which the job finished.\n\n### Actual behavior\n\nThe scheduler simply advances `next_run` by one full period from `last_run`, which causes it to skip the current period entirely when the job ran late. For example:\n- Daily job at 23:30, ran late and finished on day 2 at 01:00 → next scheduled for day **3** at 23:30 instead of day **2** at 23:30.\n- Hourly job at :10, ran late and finished at 13:00 → next scheduled for **14:10** instead of **13:10**.\n- Per-minute job at :15, ran late and finished at 10:12:14 → next scheduled for **10:13:15** instead of **10:12:15**.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `schedule`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-e7a52cb9c91e3553e4d1", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:0e2c43e6e24c34458a02e3e1eece5d9489ee22c5d00759444c603e6694231263", "task_path": "tasks/r2e-gym-e7a52cb9c91e3553e4d1", "instruction": "## Bug: Assigning an immediately-expired value to an existing `TLRUCache` key silently retains the stale old value\n\n### Description\n\nWhen a key already exists in a `TLRUCache` and you overwrite it with a value whose TTU (time-to-use) is already expired (i.e., `ttu` returns a time not greater than the current time), the cache silently ignores the assignment and keeps the old value instead of evicting the key.\n\nThis is surprising behavior: the caller explicitly assigned a new value to the key. Since the new value cannot be stored (it's dead-on-arrival), the key should be removed entirely rather than leaving the previous stale value in place.\n\n### Reproduction\n\n```python\nfrom cachetools import TLRUCache\n\ndef ttu(_k, value, t):\n return t + value # lifetime equals the value itself\n\ncache = TLRUCache(maxsize=2, ttu=ttu)\ncache[1] = 5 # stored fine, expires at t+5\nprint(1 in cache) # True, as expected\n\ncache[1] = 0 # ttu returns t+0 == t, so immediately expired\nprint(1 in cache) # Expected: False — but prints True!\nprint(cache.get(1)) # Expected: None — but returns 5!\nprint(len(cache)) # Expected: 0 — but returns 1!\n```\n\nAfter `cache[1] = 0`, the key `1` is unexpectedly still present in the cache holding the old value `5`. The cache's `currsize` and `len` both still report 1.\n\n### Expected behavior\n\nWhen you assign an immediately-expired value to an existing key, the old value for that key should be evicted. The key should no longer be present in the cache, `len(cache)` should be 0, and `cache.get(1)` should return `None`.\n\n### Actual behavior\n\nThe assignment is silently ignored and the previous value (`5`) remains accessible under key `1`. The cache still reports `currsize=1` and `len=1`, and iterating over the cache still yields key `1`.\n\nThe root cause is in `TLRUCache.__setitem__`: when the new value is expired, the method returns early without checking whether the key already has an existing entry that should be removed.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `src/cachetools`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-eb1b2ad1c94d96e4ae3d", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:465e919557c0f2f439506dac1a143706c97ce1dc946a6d27c7c434554b9f7e62", "task_path": "tasks/r2e-gym-eb1b2ad1c94d96e4ae3d", "instruction": "## `rpartial` does not accept keyword arguments\n\nCurrently, `rpartial` only supports positional arguments when partially applying the last arguments of a function. Passing keyword arguments to `rpartial` raises a `TypeError` immediately, before the returned function is even called.\n\n### Example\n\n```python\nfrom funcy import rpartial\n\nmerge = lambda a, b, c='bra': a + b + c\n\n# This raises TypeError: rpartial() got an unexpected keyword argument 'a'\nf = rpartial(merge, a='abra')\nresult = f(b='cada') # should return 'abracadabra'\n```\n\nAdditionally, keyword arguments passed at call time should override those provided to `rpartial`:\n\n```python\nfrom funcy import rpartial\n\nmerge = lambda a, b, c='bra': a + b + c\n\n# Partial application with positional + keyword arg\nf = rpartial(merge, 'cada', c='fancy')\nresult = f('abra', c='funcy') # should return 'abracadafuncy'\n```\n\n### Expected behavior\n\n`rpartial` should accept keyword arguments and forward them to the underlying function. Keyword arguments supplied at call time should extend and override those supplied to `rpartial`, consistent with how `func_partial` handles kwargs.\n\n### Actual behavior\n\nCalling `rpartial(merge, a='abra')` immediately raises:\n\n```\nTypeError: rpartial() got an unexpected keyword argument 'a'\n```\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `funcy`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |
| {"task_id": "r2e-gym-fa4be66a6091c0aa7f60", "recipe": "r2e_gym", "quality_status": "unverified", "bundle_hash": "sha256:cd391dcc7554aa830ac99e83163c024153f5c406613700847620f9a0e649557c", "task_path": "tasks/r2e-gym-fa4be66a6091c0aa7f60", "instruction": "## Empty type name or field name raises `IndexError` instead of `ValueError` in `namedtuple`/`namedlist`\n\nPassing an empty string as a field name or typename to `namedtuple` or `namedlist` raises an `IndexError` instead of the expected `ValueError`.\n\n### Reproduce\n\n```python\nfrom boltons.namedutils import namedtuple, namedlist\n\n# Empty field name\nnamedtuple('Point', ['x', '']) # IndexError: string index out of range\n\n# Empty type name\nnamedlist('', ['x', 'y']) # IndexError: string index out of range\n```\n\n### What's happening\n\nThe validation loop checks:\n\n```python\nif not all(c.isalnum() or c == '_' for c in name):\n raise ValueError(...)\n```\n\nBut `all()` returns `True` for an empty iterable (including an empty string), so an empty name passes this check silently. The code then proceeds to `name[0].isdigit()`, which raises `IndexError: string index out of range` because there's no character at index 0.\n\nThe same issue affects both `namedtuple` and `namedlist`, and both empty field names and empty type names.\n\n### Expected behavior\n\nPassing an empty string as a type name or field name should raise a `ValueError` with a descriptive message, not an `IndexError`.\n\n### Actual behavior\n\n```\nIndexError: string index out of range\n```\n\nThis happens in the validation loop inside both `namedtuple` and `namedlist` in `boltons/namedutils.py`.\n\nWork in `/workspace`. Submit your fix in the existing Python source files under `boltons`. Preserve the other public behavior. The environment is offline; dependencies are preinstalled. Grading runs the repository's test suite in a fresh environment, using your submitted source files.\n", "evidence_json": "{\"artifact_integrity\": true, \"blind_solver\": \"not assessed by this release audit\", \"control_scope\": \"Hash-matched baseline 0 and reference 1 in the Wave 1 audit\", \"harbor_parse\": true, \"independent_quality_review\": \"not assessed by this release audit\", \"paired_harbor_controls\": true, \"retained\": false}", "diagnostics": []} | |