MutaFix run: more-itertools-009
ranker nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B · patcher nvidia/nemotron-3-super-120b-a12b · via Nebius Token Factory
fixedoutcome
33swall time
1model calls
$0.0002API cost
Benchmark ground truth (hidden from the agent)
- if not (len(chunk) != n): (injected bug)+ if len(chunk) != n: (original)retriever rank 1 of 20 · ranker position 1 · patched the right function yes · exact restore yes
Trace
reproduce
1 failing test(s) · 1 failed, 767 passed · 12.64s
failing tests and errors
tests/test_more.py::ChunkedTests::test_strict_being_truetests/test_more.py::ChunkedTests::test_strict_being_true
E ValueError: iterable is not divisible by n.
trace
re-ran 1 test file(s) with the trace plugin: 1 failing and 619 passing tests, 3 library functions ran in a failing test · 5.46s
retrieve
280 functions indexed, 3 reachable from
tests/test_more.py::ChunkedTests::test_strict_being_true in the static call graph. Kept 20 candidates, ranked by spectrum score (Ochiai), call graph and BM25 break ties.candidates in retriever order
more_itertools/more.py::chunked.<locals>.retmore_itertools/more.py::chunkedmore_itertools/recipes.py::takemore_itertools/more.py::dividemore_itertools/more.py::slicedmore_itertools/recipes.py::groupermore_itertools/recipes.py::_batchedmore_itertools/more.py::distributemore_itertools/more.py::filter_exceptmore_itertools/more.py::zip_offsetmore_itertools/more.py::strictly_nmore_itertools/more.py::map_exceptmore_itertools/more.py::split_intomore_itertools/more.py::onlymore_itertools/more.py::interleave_evenlymore_itertools/more.py::onemore_itertools/more.py::extractmore_itertools/more.py::sliced.<locals>.retmore_itertools/recipes.py::triplewisemore_itertools/more.py::iequals
rank
more_itertools/more.py::chunked.<locals>.retmore_itertools/more.py::chunkedmore_itertools/recipes.py::takemore_itertools/more.py::dividemore_itertools/more.py::sliced
patch
The condition in ret() incorrectly checks `len(chunk) != n` and then negates it with `not`. This means it raises an error when the chunk length IS equal to n, which is the opposite of the intended behavior. The test expects a ValueError when the iterable is not divisible by n (i.e., when a chunk has length != n). The condition should simply check `len(chunk) != n` and raise the error in that case.
--- a/more_itertools/more.py+++ b/more_itertools/more.py@@ -242,5 +242,5 @@ def ret(): for chunk in iterator:- if not (len(chunk) != n):+ if len(chunk) != n: raise ValueError('iterable is not divisible by n.') yield chunk
tests: all tests pass
Final patch
--- a/more_itertools/more.py+++ b/more_itertools/more.py@@ -242,5 +242,5 @@ def ret(): for chunk in iterator:- if not (len(chunk) != n):+ if len(chunk) != n: raise ValueError('iterable is not divisible by n.') yield chunk