{"item_id":"intervals-bug-1","split":"test","module":"intervals","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","mutant":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return hi - lo\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","intention":{"old":"max(0, hi - lo)","new":"hi - lo"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = None\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":5,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[1], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":10,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":16,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":21,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo >= hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":27,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":32,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-2][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":38,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-2][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":43,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, ))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":49,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 1\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":54,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = None\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":60,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append(None)\n    return out\n"}]}
{"item_id":"intervals-bug-2","split":"test","module":"intervals","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","mutant":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value <= hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","intention":{"old":"value < hi","new":"value <= hi"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = None\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":5,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[1], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":10,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":16,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":21,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo >= hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":27,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":32,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-2][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":38,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-2][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":43,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, ))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":49,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 1\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":54,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = None\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":60,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append(None)\n    return out\n"}]}
{"item_id":"intervals-bug-3","split":"test","module":"intervals","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","mutant":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], hi)\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","intention":{"old":"max(hi, out[-1][1])","new":"hi"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = None\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":5,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[1], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":10,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":16,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":21,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo >= hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":27,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":32,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-2][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":38,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-2][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":43,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, ))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":49,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 1\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":54,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = None\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":60,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append(None)\n    return out\n"}]}
{"item_id":"intervals-bug-4","split":"test","module":"intervals","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","mutant":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = hi + 1\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n","intention":{"old":"cursor = max(cursor, hi)","new":"cursor = hi + 1"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = None\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":5,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[1], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":10,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":16,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":21,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo >= hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":27,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":32,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-2][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":38,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-2][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":43,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, ))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":49,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 1\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":54,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = None\n    if cursor < end:\n        out.append((cursor, end))\n    return out\n"},{"index":60,"source":"\"\"\"Intervals utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef overlap(a, b):\n    \"\"\"Return the length of the intersection of half-open integer intervals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(a[0], b[0])\n    hi = min(a[1], b[1])\n    return max(0, hi - lo)\n\n\ndef contains(span, value):\n    \"\"\"Include the lower endpoint and exclude the upper endpoint.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = span\n    if lo > hi:\n        raise ValueError(\"reversed interval\")\n    return lo <= value < hi\n\n\ndef merge(spans):\n    \"\"\"Merge overlapping or touching intervals, sorted by start; empty input is empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for lo, hi in sorted(spans):\n        if out and lo <= out[-1][1]:\n            out[-1] = (out[-1][0], max(hi, out[-1][1]))\n        else:\n            out.append((lo, hi))\n    return out\n\n\ndef gaps(spans, end):\n    \"\"\"Return uncovered intervals within [0,end); input spans already lie inside it.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    cursor = 0\n    out = []\n    for lo, hi in merge(spans):\n        if cursor < lo:\n            out.append((cursor, lo))\n        cursor = max(cursor, hi)\n    if cursor < end:\n        out.append(None)\n    return out\n"}]}
{"item_id":"ledger-bug-1","split":"test","module":"ledger","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","mutant":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += abs(amount)\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","intention":{"old":"total += amount","new":"total += abs(amount)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":3,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total -= amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":7,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value = amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":10,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":14,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(None)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":18,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 and any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":21,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(None) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":25,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) < 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":29,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"INVALID ALLOCATION\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":32,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total / w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":36,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(None)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":40,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 2\n    return parts\n"}]}
{"item_id":"ledger-bug-2","split":"test","module":"ledger","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","mutant":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = 0\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","intention":{"old":"value = opening","new":"value = 0"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":3,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total -= amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":7,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value = amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":10,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":14,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(None)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":18,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 and any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":21,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(None) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":25,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) < 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":29,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"INVALID ALLOCATION\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":32,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total / w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":36,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(None)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":40,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 2\n    return parts\n"}]}
{"item_id":"ledger-bug-3","split":"test","module":"ledger","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","mutant":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            pass\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","intention":{"old":"left.remove(value)","new":"pass"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":3,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total -= amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":7,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value = amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":10,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":14,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(None)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":18,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 and any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":21,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(None) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":25,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) < 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":29,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"INVALID ALLOCATION\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":32,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total / w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":36,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(None)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":40,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 2\n    return parts\n"}]}
{"item_id":"ledger-bug-4","split":"test","module":"ledger","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n","mutant":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[-1 - i % len(parts)] += 1\n    return parts\n","intention":{"old":"parts[i % len(parts)] += 1","new":"parts[-1 - i % len(parts)] += 1"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":3,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total -= amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":7,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value = amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":10,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":14,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(None)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":18,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 and any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":21,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(None) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":25,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) < 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":29,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"INVALID ALLOCATION\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":32,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total / w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":36,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(None)):\n        parts[i % len(parts)] += 1\n    return parts\n"},{"index":40,"source":"\"\"\"Ledger utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef balance(entries):\n    \"\"\"Sum signed integer amounts. Empty input has balance zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for amount in entries:\n        total += amount\n    return total\n\n\ndef running(entries, opening=0):\n    \"\"\"Return the balance after each entry, starting at opening.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    value = opening\n    for amount in entries:\n        value += amount\n        out.append(value)\n    return out\n\n\ndef reconcile(expected, actual):\n    \"\"\"Return missing counts by value, preserving multiplicity, sorted ascending.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = list(actual)\n    missing = []\n    for value in expected:\n        if value in left:\n            left.remove(value)\n        else:\n            missing.append(value)\n    return sorted(missing)\n\n\ndef allocate(total, weights):\n    \"\"\"Allocate nonnegative integer total proportionally; remainder goes to earliest indices.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if total < 0 or any(w < 0 for w in weights) or sum(weights) <= 0:\n        raise ValueError(\"invalid allocation\")\n    parts = [total * w // sum(weights) for w in weights]\n    for i in range(total - sum(parts)):\n        parts[i % len(parts)] += 2\n    return parts\n"}]}
{"item_id":"sequences-bug-1","split":"test","module":"sequences","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","mutant":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values) - size + 1, size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","intention":{"old":"range(0, len(values), size)","new":"range(0, len(values) - size + 1, size)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size < 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":3,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"XXsizeXX\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":6,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(None, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":10,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":13,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(None)\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":17,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(None)\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":20,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = None\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":24,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 2):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":27,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":31,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = None\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":34,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 1:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":38,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:+k]\n"}]}
{"item_id":"sequences-bug-2","split":"test","module":"sequences","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","mutant":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","intention":{"old":"len(values) - size + 1","new":"len(values) - size"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size < 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":3,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"XXsizeXX\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":6,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(None, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":10,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":13,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(None)\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":17,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(None)\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":20,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = None\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":24,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 2):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":27,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":31,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = None\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":34,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 1:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":38,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:+k]\n"}]}
{"item_id":"sequences-bug-3","split":"test","module":"sequences","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","mutant":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","intention":{"old":"value not in out","new":"value in out"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size < 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":3,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"XXsizeXX\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":6,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(None, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":10,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":13,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(None)\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":17,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(None)\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":20,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = None\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":24,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 2):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":27,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":31,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = None\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":34,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 1:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":38,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:+k]\n"}]}
{"item_id":"sequences-bug-4","split":"test","module":"sequences","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","mutant":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = -offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n","intention":{"old":"offset % len(values)","new":"-offset % len(values)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size < 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":3,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"XXsizeXX\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":6,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(None, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":10,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":13,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(None)\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":17,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(None)\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":20,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = None\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":24,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 2):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":27,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":31,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = None\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":34,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 1:\n        return list(values)\n    return values[-k:] + values[:-k]\n"},{"index":38,"source":"\"\"\"Sequences utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef chunks(values, size):\n    \"\"\"Split a list into chunks, retaining the final short chunk; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for start in range(0, len(values), size):\n        out.append(values[start:start + size])\n    return out\n\n\ndef windows(values, size):\n    \"\"\"Return overlapping full windows; reject nonpositive size.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if size <= 0:\n        raise ValueError(\"size\")\n    out = []\n    for i in range(len(values) - size + 1):\n        out.append(values[i:i + size])\n    return out\n\n\ndef unique(values):\n    \"\"\"Deduplicate while preserving the first occurrence; accept unhashable elements.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if value not in out:\n            out.append(value)\n    return out\n\n\ndef rotate(values, offset):\n    \"\"\"Positive offset rotates right; negative rotates left; empty list stays empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return []\n    k = offset % len(values)\n    if k == 0:\n        return list(values)\n    return values[-k:] + values[:+k]\n"}]}
{"item_id":"escaped_fields-bug-1","split":"test","module":"escaped_fields","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","mutant":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value)\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","intention":{"old":"value.replace(\",\", \"\\\\,\")","new":"value"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":6,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"XX\\\\XX\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":12,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", ))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":18,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"XXXX\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":24,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = True\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":30,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \"XX,XX\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":36,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf = \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":42,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":48,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", None)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":54,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = None\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":60,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"XX#XX\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":67,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = True\n    return text\n"}]}
{"item_id":"escaped_fields-bug-2","split":"test","module":"escaped_fields","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","mutant":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","intention":{"old":"return out + [buf]","new":"return out"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":6,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"XX\\\\XX\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":12,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", ))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":18,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"XXXX\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":24,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = True\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":30,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \"XX,XX\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":36,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf = \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":42,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":48,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", None)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":54,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = None\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":60,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"XX#XX\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":67,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = True\n    return text\n"}]}
{"item_id":"escaped_fields-bug-3","split":"test","module":"escaped_fields","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","mutant":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\")\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","intention":{"old":"pair.split(\"=\", 1)","new":"pair.split(\"=\")"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":6,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"XX\\\\XX\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":12,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", ))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":18,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"XXXX\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":24,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = True\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":30,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \"XX,XX\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":36,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf = \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":42,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":48,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", None)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":54,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = None\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":60,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"XX#XX\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":67,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = True\n    return text\n"}]}
{"item_id":"escaped_fields-bug-4","split":"test","module":"escaped_fields","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n","mutant":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = True\n        else:\n            escaped = False\n    return text\n","intention":{"old":"escaped = not escaped","new":"escaped = True"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":6,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"XX\\\\XX\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":12,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", ))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":18,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"XXXX\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":24,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = True\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":30,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \"XX,XX\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":36,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf = \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":42,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":48,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", None)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":54,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = None\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":60,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"XX#XX\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = False\n    return text\n"},{"index":67,"source":"\"\"\"Escaped fields utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Join fields with commas; escape literal backslashes and commas with a backslash.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        value = value.replace(\"\\\\\", \"\\\\\\\\\")\n        out.append(value.replace(\",\", \"\\\\,\"))\n    return \",\".join(out)\n\n\ndef decode(text):\n    \"\"\"Split comma fields honoring a backslash escape; a trailing backslash is literal.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out, buf = [], \"\"\n    escaped = False\n    for char in text:\n        if escaped:\n            buf += char\n            escaped = False\n        elif char == \"\\\\\":\n            escaped = True\n        elif char == \",\":\n            out.append(buf)\n            buf = \"\"\n        else:\n            buf += char\n    if escaped:\n        buf += \"\\\\\"\n    return out + [buf]\n\n\ndef key_values(pairs):\n    \"\"\"Convert key=value strings; split only at first equals; later duplicate keys replace earlier.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for pair in pairs:\n        if \"=\" not in pair:\n            raise ValueError(\"missing equals\")\n        key, value = pair.split(\"=\", 1)\n        out[key.strip()] = value\n    return out\n\n\ndef strip_comment(text):\n    \"\"\"Remove text from the first unescaped hash; retain backslash characters unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    escaped = False\n    for i, char in enumerate(text):\n        if char == \"#\" and not escaped:\n            return text[:i]\n        if char == \"\\\\\":\n            escaped = not escaped\n        else:\n            escaped = True\n    return text\n"}]}
{"item_id":"calendar_math-bug-1","split":"test","module":"calendar_math","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","mutant":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return True\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","intention":{"old":"return False","new":"return True"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year / 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":7,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 != 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":15,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 2 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":23,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 3:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":30,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (5, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":38,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 < day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":46,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"DAY\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":54,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month <= 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":61,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 2, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":69,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":77,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(month):\n        result += month_days(year, m)\n    return result\n"},{"index":85,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, )\n    return result\n"}]}
{"item_id":"calendar_math-bug-2","split":"test","module":"calendar_math","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","mutant":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","intention":{"old":"return 29 if is_leap(year) else 28","new":"return 28"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year / 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":7,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 != 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":15,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 2 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":23,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 3:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":30,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (5, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":38,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 < day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":46,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"DAY\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":54,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month <= 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":61,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 2, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":69,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":77,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(month):\n        result += month_days(year, m)\n    return result\n"},{"index":85,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, )\n    return result\n"}]}
{"item_id":"calendar_math-bug-3","split":"test","module":"calendar_math","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","mutant":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","intention":{"old":"return year + 1, 1, 1","new":"return year, 1, 1"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year / 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":7,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 != 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":15,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 2 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":23,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 3:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":30,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (5, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":38,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 < day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":46,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"DAY\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":54,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month <= 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":61,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 2, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":69,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":77,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(month):\n        result += month_days(year, m)\n    return result\n"},{"index":85,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, )\n    return result\n"}]}
{"item_id":"calendar_math-bug-4","split":"test","module":"calendar_math","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n","mutant":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month + 1):\n        result += month_days(year, m)\n    return result\n","intention":{"old":"range(1, month)","new":"range(1, month + 1)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year / 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":7,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 != 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":15,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 2 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":23,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 3:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":30,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (5, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":38,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 < day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":46,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"DAY\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":54,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month <= 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":61,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 2, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":69,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, m)\n    return result\n"},{"index":77,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(month):\n        result += month_days(year, m)\n    return result\n"},{"index":85,"source":"\"\"\"Calendar math utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef is_leap(year):\n    \"\"\"Use the Gregorian divisible-by-four, century and four-century rule.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if year % 400 == 0:\n        return True\n    if year % 100 == 0:\n        return False\n    return year % 4 == 0\n\n\ndef month_days(year, month):\n    \"\"\"Return month length; reject months outside the calendar.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= month <= 12:\n        raise ValueError(\"month\")\n    if month == 2:\n        return 29 if is_leap(year) else 28\n    if month in (4, 6, 9, 11):\n        return 30\n    return 31\n\n\ndef next_day(year, month, day):\n    \"\"\"Advance a valid calendar date by one day, rolling months and years.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    if day < month_days(year, month):\n        return year, month, day + 1\n    if month < 12:\n        return year, month + 1, 1\n    return year + 1, 1, 1\n\n\ndef ordinal(year, month, day):\n    \"\"\"Return the one-based day of year; validate day and month.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not 1 <= day <= month_days(year, month):\n        raise ValueError(\"day\")\n    result = day\n    for m in range(1, month):\n        result += month_days(year, )\n    return result\n"}]}
{"item_id":"inventory-bug-1","split":"test","module":"inventory","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","mutant":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = stock\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","intention":{"old":"out = dict(stock)","new":"out = stock"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":5,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(None, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":10,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) <= qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":15,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] += qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":20,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(None)\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":25,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(None, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":30,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":35,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":40,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = None\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":45,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":50,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed = take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":56,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"SHORTAGE\")\n    return out\n"}]}
{"item_id":"inventory-bug-2","split":"test","module":"inventory","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","mutant":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","intention":{"old":"out.get(key, 0) + qty","new":"qty"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":5,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(None, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":10,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) <= qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":15,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] += qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":20,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(None)\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":25,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(None, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":30,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":35,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":40,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = None\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":45,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":50,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed = take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":56,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"SHORTAGE\")\n    return out\n"}]}
{"item_id":"inventory-bug-3","split":"test","module":"inventory","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","mutant":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta >= 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","intention":{"old":"delta > 0","new":"delta >= 0"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":5,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(None, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":10,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) <= qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":15,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] += qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":20,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(None)\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":25,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(None, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":30,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":35,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":40,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = None\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":45,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":50,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed = take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":56,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"SHORTAGE\")\n    return out\n"}]}
{"item_id":"inventory-bug-4","split":"test","module":"inventory","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","mutant":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = qty\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n","intention":{"old":"take = min(qty, needed)","new":"take = qty"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":5,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(None, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":10,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) <= qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":15,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] += qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":20,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(None)\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":25,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(None, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":30,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":35,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":40,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = None\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":45,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":50,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed = take\n    if needed > 0:\n        raise ValueError(\"shortage\")\n    return out\n"},{"index":56,"source":"\"\"\"Inventory utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reserve(stock, requests):\n    \"\"\"Atomically reserve positive quantities; return a new mapping, never mutate stock.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in requests:\n        if qty <= 0 or out.get(key, 0) < qty:\n            raise ValueError(\"unavailable\")\n        out[key] -= qty\n    return out\n\n\ndef restock(stock, deliveries):\n    \"\"\"Add nonnegative quantities to a new mapping, including new keys.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(stock)\n    for key, qty in deliveries:\n        if qty < 0:\n            raise ValueError(\"negative\")\n        out[key] = out.get(key, 0) + qty\n    return out\n\n\ndef shortages(stock, target):\n    \"\"\"Return positive target-minus-stock amounts only.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, desired in target.items():\n        delta = desired - stock.get(key, 0)\n        if delta > 0:\n            out[key] = delta\n    return out\n\n\ndef choose(lots, needed):\n    \"\"\"Consume (name,quantity) lots in order, returning selected quantities; reject shortages.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for name, qty in lots:\n        take = min(qty, needed)\n        if take > 0:\n            out.append((name, take))\n        needed -= take\n    if needed > 0:\n        raise ValueError(\"SHORTAGE\")\n    return out\n"}]}
{"item_id":"rankings-bug-1","split":"test","module":"rankings","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","mutant":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=False)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","intention":{"old":"reverse=True","new":"reverse=False"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = None\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":3,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":7,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = None\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":11,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.rindex(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":14,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = None\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":18,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(None)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":22,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 1:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":26,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = None\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":29,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":33,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[2], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":37,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = None\n    return count / len(values)\n"},{"index":41,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count * len(values)\n"}]}
{"item_id":"rankings-bug-2","split":"test","module":"rankings","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","mutant":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other >= value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","intention":{"old":"other > value","new":"other >= value"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = None\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":3,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":7,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = None\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":11,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.rindex(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":14,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = None\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":18,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(None)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":22,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 1:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":26,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = None\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":29,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":33,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[2], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":37,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = None\n    return count / len(values)\n"},{"index":41,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count * len(values)\n"}]}
{"item_id":"rankings-bug-3","split":"test","module":"rankings","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","mutant":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","intention":{"old":"(-row[1], row[0])","new":"(row[1], row[0])"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = None\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":3,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":7,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = None\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":11,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.rindex(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":14,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = None\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":18,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(None)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":22,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 1:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":26,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = None\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":29,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":33,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[2], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":37,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = None\n    return count / len(values)\n"},{"index":41,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count * len(values)\n"}]}
{"item_id":"rankings-bug-4","split":"test","module":"rankings","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n","mutant":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x <= value)\n    return count / len(values)\n","intention":{"old":"x < value","new":"x <= value"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = None\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":3,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":7,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = None\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":11,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.rindex(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":14,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = None\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":18,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(None)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":22,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 1:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":26,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = None\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":29,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":33,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[2], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count / len(values)\n"},{"index":37,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = None\n    return count / len(values)\n"},{"index":41,"source":"\"\"\"Rankings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef dense(values):\n    \"\"\"Return descending dense ranks; equal values receive equal ranks.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    ordered = sorted(set(values), reverse=True)\n    out = []\n    for value in values:\n        out.append(ordered.index(value) + 1)\n    return out\n\n\ndef competition(values):\n    \"\"\"Return descending competition ranks, with gaps after equal values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        higher = sum(1 for other in values if other > value)\n        out.append(higher + 1)\n    return out\n\n\ndef top(records, count):\n    \"\"\"Sort (name,score) by descending score then ascending name; reject negative count.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    ordered = sorted(records, key=lambda row: (-row[1], row[0]))\n    return ordered[:count]\n\n\ndef percentile(values, value):\n    \"\"\"Fraction of values strictly below value; empty input returns zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return 0.0\n    count = sum(1 for x in values if x < value)\n    return count * len(values)\n"}]}
{"item_id":"paths-bug-1","split":"test","module":"paths","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","mutant":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            pass\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","intention":{"old":"out.pop()","new":"pass"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":5,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \"XX.XX\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":10,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(None)\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":15,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"XX/XX\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":20,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-2]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":25,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(None, 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":30,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\"XX.XX\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":35,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = None\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":40,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p - \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":45,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(None)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":50,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, ):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":56,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 2:]\n"}]}
{"item_id":"paths-bug-2","split":"test","module":"paths","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","mutant":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.split(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","intention":{"old":"base.rsplit(\".\", 1)","new":"base.split(\".\", 1)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":5,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \"XX.XX\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":10,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(None)\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":15,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"XX/XX\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":20,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-2]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":25,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(None, 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":30,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\"XX.XX\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":35,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = None\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":40,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p - \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":45,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(None)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":50,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, ):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":56,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 2:]\n"}]}
{"item_id":"paths-bug-3","split":"test","module":"paths","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","mutant":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p)\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","intention":{"old":"p + \"/\"","new":"p"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":5,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \"XX.XX\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":10,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(None)\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":15,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"XX/XX\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":20,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-2]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":25,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(None, 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":30,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\"XX.XX\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":35,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = None\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":40,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p - \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":45,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(None)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":50,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, ):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":56,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 2:]\n"}]}
{"item_id":"paths-bug-4","split":"test","module":"paths","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n","mutant":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p):]\n","intention":{"old":"c[len(p) + 1:]","new":"c[len(p):]"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":5,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \"XX.XX\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":10,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(None)\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":15,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"XX/XX\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":20,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-2]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":25,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(None, 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":30,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\"XX.XX\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":35,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = None\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":40,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p - \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":45,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(None)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":50,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, ):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 1:]\n"},{"index":56,"source":"\"\"\"Paths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef normalize(path):\n    \"\"\"Normalize slash-separated relative paths; reject attempts to ascend above root.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for part in path.split(\"/\"):\n        if part in (\"\", \".\"):\n            continue\n        if part == \"..\":\n            if not out:\n                raise ValueError(\"above root\")\n            out.pop()\n        else:\n            out.append(part)\n    return \"/\".join(out)\n\n\ndef extension(name):\n    \"\"\"Return suffix after last dot; dotfiles without another dot have no extension.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    base = name.split(\"/\")[-1]\n    if \".\" not in base[1:]:\n        return \"\"\n    return base.rsplit(\".\", 1)[1]\n\n\ndef is_child(parent, child):\n    \"\"\"True only for a strict normalized descendant, not a string-prefix sibling.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not p:\n        return bool(c)\n    return c.startswith(p + \"/\")\n\n\ndef relative(parent, child):\n    \"\"\"Remove a normalized ancestor prefix; reject non-descendants.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    p = normalize(parent)\n    c = normalize(child)\n    if not is_child(p, c):\n        raise ValueError(\"not a descendant\")\n    if not p:\n        return c\n    return c[len(p) + 2:]\n"}]}
{"item_id":"run_lengths-bug-1","split":"test","module":"run_lengths","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","mutant":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1])\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","intention":{"old":"out[-1][1] + 1","new":"out[-1][1]"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":4,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][1] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":9,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] - 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":13,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 2)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":18,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":22,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend(None)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":27,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count >= best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":31,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":36,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 1:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":40,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-2][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":45,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-2] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":50,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append(None)\n    return out\n"}]}
{"item_id":"run_lengths-bug-2","split":"test","module":"run_lengths","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","mutant":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * (count + 1))\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","intention":{"old":"[value] * count","new":"[value] * (count + 1)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":4,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][1] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":9,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] - 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":13,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 2)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":18,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":22,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend(None)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":27,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count >= best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":31,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":36,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 1:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":40,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-2][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":45,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-2] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":50,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append(None)\n    return out\n"}]}
{"item_id":"run_lengths-bug-3","split":"test","module":"run_lengths","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","mutant":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count < best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","intention":{"old":"count > best","new":"count < best"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":4,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][1] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":9,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] - 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":13,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 2)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":18,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":22,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend(None)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":27,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count >= best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":31,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":36,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 1:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":40,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-2][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":45,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-2] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":50,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append(None)\n    return out\n"}]}
{"item_id":"run_lengths-bug-4","split":"test","module":"run_lengths","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n","mutant":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, count)\n        else:\n            out.append((value, count))\n    return out\n","intention":{"old":"out[-1][1] + count","new":"count"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":4,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][1] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":9,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] - 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":13,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 2)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":18,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":22,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend(None)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":27,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count >= best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":31,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 1:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":36,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 1:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":40,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-2][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":45,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-2] = (value, out[-1][1] + count)\n        else:\n            out.append((value, count))\n    return out\n"},{"index":50,"source":"\"\"\"Run lengths utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef encode(values):\n    \"\"\"Return (value,count) consecutive runs, not global frequencies.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value in values:\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + 1)\n        else:\n            out.append((value, 1))\n    return out\n\n\ndef decode(runs):\n    \"\"\"Expand nonnegative counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        out.extend([value] * count)\n    return out\n\n\ndef longest(values):\n    \"\"\"Return the length of the longest consecutive equal run; zero for empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    best = 0\n    for value, count in encode(values):\n        if count > best:\n            best = count\n    return best\n\n\ndef compact(runs):\n    \"\"\"Combine adjacent equal runs and drop zero counts; reject negative counts.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for value, count in runs:\n        if count < 0:\n            raise ValueError(\"negative count\")\n        if count == 0:\n            continue\n        if out and out[-1][0] == value:\n            out[-1] = (value, out[-1][1] + count)\n        else:\n            out.append(None)\n    return out\n"}]}
{"item_id":"quotas-bug-1","split":"test","module":"quotas","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","mutant":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","intention":{"old":"limit - used - reserved","new":"limit - used"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(None, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":5,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, ) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":10,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"NEGATIVE\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":16,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":21,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return True\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":27,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used - amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":32,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now <= start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":38,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now + start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":43,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 and amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":49,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"XXamountXX\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":54,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, None)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":60,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount += take\n    return out\n"}]}
{"item_id":"quotas-bug-2","split":"test","module":"quotas","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","mutant":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount < limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","intention":{"old":"amount <= limit","new":"amount < limit"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(None, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":5,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, ) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":10,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"NEGATIVE\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":16,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":21,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return True\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":27,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used - amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":32,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now <= start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":38,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now + start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":43,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 and amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":49,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"XXamountXX\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":54,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, None)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":60,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount += take\n    return out\n"}]}
{"item_id":"quotas-bug-3","split":"test","module":"quotas","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","mutant":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = now // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","intention":{"old":"(now - start) // period","new":"now // period"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(None, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":5,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, ) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":10,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"NEGATIVE\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":16,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":21,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return True\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":27,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used - amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":32,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now <= start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":38,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now + start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":43,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 and amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":49,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"XXamountXX\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":54,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, None)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":60,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount += take\n    return out\n"}]}
{"item_id":"quotas-bug-4","split":"test","module":"quotas","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n","mutant":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount = 0\n    return out\n","intention":{"old":"amount -= take","new":"amount = 0"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(None, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":5,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, ) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":10,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"NEGATIVE\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":16,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":21,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return True\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":27,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used - amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":32,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now <= start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":38,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now + start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":43,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 and amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":49,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"XXamountXX\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":54,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, None)\n        out.append(size - take)\n        amount -= take\n    return out\n"},{"index":60,"source":"\"\"\"Quotas utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef available(limit, used, reserved):\n    \"\"\"Remaining nonnegative capacity after usage and reservations.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if min(limit, used, reserved) < 0:\n        raise ValueError(\"negative\")\n    left = limit - used - reserved\n    return max(0, left)\n\n\ndef admit(limit, used, amount):\n    \"\"\"Allow positive requests that fit exactly or leave room.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount <= 0:\n        return False\n    if used < 0:\n        raise ValueError(\"negative usage\")\n    return used + amount <= limit\n\n\ndef reset_times(now, start, period):\n    \"\"\"Return current period start and next boundary; reject invalid period or time.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if period <= 0 or now < start:\n        raise ValueError(\"time\")\n    index = (now - start) // period\n    current = start + index * period\n    return current, current + period\n\n\ndef consume(buckets, amount):\n    \"\"\"Consume nonnegative amount from buckets in order; return new buckets or reject.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if amount < 0 or amount > sum(buckets):\n        raise ValueError(\"amount\")\n    out = []\n    for size in buckets:\n        take = min(size, amount)\n        out.append(size - take)\n        amount += take\n    return out\n"}]}
{"item_id":"searches-bug-1","split":"test","module":"searches","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","mutant":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","intention":{"old":"values[mid] < target","new":"values[mid] <= target"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":4,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":8,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":12,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":16,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":20,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":24,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":28,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, )\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":32,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":36,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right + left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":40,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":44,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = None\n    return out\n"}]}
{"item_id":"searches-bug-2","split":"test","module":"searches","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","mutant":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","intention":{"old":"values[mid] <= target","new":"values[mid] < target"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":4,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":8,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":12,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":16,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":20,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":24,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":28,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, )\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":32,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":36,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right + left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":40,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":44,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = None\n    return out\n"}]}
{"item_id":"searches-bug-3","split":"test","module":"searches","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","mutant":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left + 1\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","intention":{"old":"right - left","new":"right - left + 1"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":4,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":8,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":12,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":16,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":20,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":24,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":28,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, )\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":32,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":36,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right + left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":40,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":44,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = None\n    return out\n"}]}
{"item_id":"searches-bug-4","split":"test","module":"searches","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n","mutant":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index + 1] = [target]\n    return out\n","intention":{"old":"out[index:index] = [target]","new":"out[index:index + 1] = [target]"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":4,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":8,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":12,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = None\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":16,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) / 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":20,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = None\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":24,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":28,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, )\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":32,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":36,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right + left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":40,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(target)\n    out = list(values)\n    out[index:index] = [target]\n    return out\n"},{"index":44,"source":"\"\"\"Searches utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef lower(values, target):\n    \"\"\"Index of first element at least target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] < target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef upper(values, target):\n    \"\"\"Index of first element greater than target in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo, hi = 0, len(values)\n    while lo < hi:\n        mid = (lo + hi) // 2\n        if values[mid] <= target:\n            lo = mid + 1\n        else:\n            hi = mid\n    return lo\n\n\ndef count(values, target):\n    \"\"\"Count target occurrences in a sorted list.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = lower(values, target)\n    right = upper(values, target)\n    if right < left:\n        return 0\n    return right - left\n\n\ndef insert(values, target):\n    \"\"\"Return new sorted list with target inserted after existing equals.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    index = upper(values, target)\n    out = list(values)\n    out[index:index] = None\n    return out\n"}]}
{"item_id":"rolling-bug-1","split":"test","module":"rolling","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","mutant":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","intention":{"old":"len(values) - width + 1","new":"len(values) - width"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width < 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":5,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = None\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":10,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(None)\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":15,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":20,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(None)\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":25,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v / w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":30,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total * sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":35,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":40,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i + 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":45,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"BOUNDS\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":50,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(min(hi, value)))\n    return out\n"},{"index":55,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, )))\n    return out\n"}]}
{"item_id":"rolling-bug-2","split":"test","module":"rolling","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","mutant":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / len(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","intention":{"old":"total / sum(weights)","new":"total / len(weights)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width < 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":5,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = None\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":10,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(None)\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":15,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":20,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(None)\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":25,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v / w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":30,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total * sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":35,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":40,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i + 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":45,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"BOUNDS\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":50,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(min(hi, value)))\n    return out\n"},{"index":55,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, )))\n    return out\n"}]}
{"item_id":"rolling-bug-3","split":"test","module":"rolling","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","mutant":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i - 1] - values[i])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","intention":{"old":"values[i] - values[i - 1]","new":"values[i - 1] - values[i]"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width < 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":5,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = None\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":10,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(None)\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":15,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":20,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(None)\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":25,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v / w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":30,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total * sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":35,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":40,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i + 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":45,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"BOUNDS\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":50,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(min(hi, value)))\n    return out\n"},{"index":55,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, )))\n    return out\n"}]}
{"item_id":"rolling-bug-4","split":"test","module":"rolling","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n","mutant":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(min(lo, max(hi, value)))\n    return out\n","intention":{"old":"max(lo, min(hi, value))","new":"min(lo, max(hi, value))"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width < 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":5,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = None\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":10,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(None)\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":15,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":20,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(None)\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":25,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v / w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":30,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total * sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":35,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":40,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i + 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":45,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"BOUNDS\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, value)))\n    return out\n"},{"index":50,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(min(hi, value)))\n    return out\n"},{"index":55,"source":"\"\"\"Rolling utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef moving_sum(values, width):\n    \"\"\"Sums of full consecutive windows; reject nonpositive width.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if width <= 0:\n        raise ValueError(\"width\")\n    out = []\n    for i in range(len(values) - width + 1):\n        out.append(sum(values[i:i + width]))\n    return out\n\n\ndef weighted(values, weights):\n    \"\"\"Weighted mean; require same nonempty length and positive weight sum.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values or len(values) != len(weights) or sum(weights) <= 0:\n        raise ValueError(\"weights\")\n    total = sum(v * w for v, w in zip(values, weights))\n    return total / sum(weights)\n\n\ndef deltas(values):\n    \"\"\"Adjacent differences in input order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = []\n    for i in range(1, len(values)):\n        out.append(values[i] - values[i - 1])\n    return out\n\n\ndef clamp(values, lo, hi):\n    \"\"\"Clamp inclusively to bounds without reordering; reject reversed bounds.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if lo > hi:\n        raise ValueError(\"bounds\")\n    out = []\n    for value in values:\n        out.append(max(lo, min(hi, )))\n    return out\n"}]}
{"item_id":"graphs-bug-1","split":"test","module":"graphs","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","mutant":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        pass\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","intention":{"old":"queue.extend(edges.get(node, []))","new":"pass"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = None\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":3,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(None)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":6,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            break\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":10,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, None))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":13,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(None)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":17,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = None\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":20,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node != end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":24,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(None)\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":27,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(None, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":31,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":34,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, None).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":38,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = None\n    return out\n"}]}
{"item_id":"graphs-bug-2","split":"test","module":"graphs","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","mutant":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 2) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","intention":{"old":"depth + 1","new":"depth + 2"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = None\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":3,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(None)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":6,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            break\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":10,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, None))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":13,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(None)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":17,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = None\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":20,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node != end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":24,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(None)\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":27,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(None, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":31,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":34,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, None).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":38,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = None\n    return out\n"}]}
{"item_id":"graphs-bug-3","split":"test","module":"graphs","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","mutant":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, [])\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","intention":{"old":"out.setdefault(target, []).append(node)","new":"out.setdefault(target, [])"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = None\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":3,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(None)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":6,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            break\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":10,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, None))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":13,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(None)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":17,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = None\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":20,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node != end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":24,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(None)\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":27,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(None, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":31,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":34,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, None).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":38,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = None\n    return out\n"}]}
{"item_id":"graphs-bug-4","split":"test","module":"graphs","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n","mutant":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(set(targets))\n    return out\n","intention":{"old":"len(targets)","new":"len(set(targets))"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = None\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":3,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(None)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":6,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            break\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":10,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, None))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":13,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(None)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":17,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = None\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":20,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node != end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":24,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(None)\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":27,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(None, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":31,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":34,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, None).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = len(targets)\n    return out\n"},{"index":38,"source":"\"\"\"Graphs utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef reachable(edges, start):\n    \"\"\"Return sorted reachable nodes including start; cycles are allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    seen = set()\n    queue = [start]\n    while queue:\n        node = queue.pop(0)\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend(edges.get(node, []))\n    return sorted(seen)\n\n\ndef distance(edges, start, end):\n    \"\"\"Shortest unweighted directed distance, or None when unreachable.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    queue = [(start, 0)]\n    seen = set()\n    while queue:\n        node, depth = queue.pop(0)\n        if node == end:\n            return depth\n        if node in seen:\n            continue\n        seen.add(node)\n        queue.extend((n, depth + 1) for n in edges.get(node, []))\n    return None\n\n\ndef reverse(edges):\n    \"\"\"Reverse directed edges, retaining all nodes, including isolated ones.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {node: [] for node in edges}\n    for node, targets in edges.items():\n        for target in targets:\n            out.setdefault(target, []).append(node)\n    return out\n\n\ndef degrees(edges):\n    \"\"\"Return outgoing edge counts for every explicit node, including duplicates.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for node, targets in edges.items():\n        out[node] = None\n    return out\n"}]}
{"item_id":"versions-bug-1","split":"test","module":"versions","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","mutant":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) < 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","intention":{"old":"len(parts) != 3","new":"len(parts) < 3"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = None\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":4,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) == 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":9,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"XXversionXX\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":14,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(None), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":19,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left >= right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":24,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(None))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":29,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(None)\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":34,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 2\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":39,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component - 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":44,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(None)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":49,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = None\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":54,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value <= high\n"}]}
{"item_id":"versions-bug-2","split":"test","module":"versions","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","mutant":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = a, b\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","intention":{"old":"left, right = parse(a), parse(b)","new":"left, right = a, b"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = None\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":4,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) == 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":9,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"XXversionXX\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":14,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(None), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":19,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left >= right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":24,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(None))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":29,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(None)\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":34,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 2\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":39,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component - 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":44,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(None)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":49,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = None\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":54,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value <= high\n"}]}
{"item_id":"versions-bug-3","split":"test","module":"versions","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","mutant":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        pass\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","intention":{"old":"values[i] = 0","new":"pass"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = None\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":4,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) == 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":9,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"XXversionXX\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":14,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(None), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":19,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left >= right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":24,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(None))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":29,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(None)\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":34,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 2\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":39,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component - 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":44,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(None)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":49,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = None\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":54,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value <= high\n"}]}
{"item_id":"versions-bug-4","split":"test","module":"versions","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n","mutant":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value <= high\n","intention":{"old":"value < high","new":"value <= high"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = None\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":4,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) == 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":9,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"XXversionXX\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":14,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(None), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":19,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left >= right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":24,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(None))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":29,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(None)\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":34,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 2\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":39,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component - 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":44,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(None)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":49,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = None\n    high = parse(maximum)\n    return low <= value < high\n"},{"index":54,"source":"\"\"\"Versions utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef parse(text):\n    \"\"\"Parse exactly three nonnegative decimal components; leading zeros accepted.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split(\".\")\n    if len(parts) != 3 or any(not p.isdecimal() for p in parts):\n        raise ValueError(\"version\")\n    return tuple(int(p) for p in parts)\n\n\ndef compare(a, b):\n    \"\"\"Return negative one, zero or one using numeric component order.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left, right = parse(a), parse(b)\n    if left < right:\n        return -1\n    if left > right:\n        return 1\n    return 0\n\n\ndef bump(text, component):\n    \"\"\"Increment selected zero-based component; reset following components to zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    values = list(parse(text))\n    if component not in (0, 1, 2):\n        raise ValueError(\"component\")\n    values[component] += 1\n    for i in range(component + 1, 3):\n        values[i] = 0\n    return \".\".join(str(v) for v in values)\n\n\ndef satisfies(text, minimum, maximum):\n    \"\"\"Inclusive minimum, exclusive maximum, comparing numeric versions.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    value = parse(text)\n    low = parse(minimum)\n    high = parse(maximum)\n    return low <= value <= high\n"}]}
{"item_id":"sparse_vectors-bug-1","split":"test","module":"sparse_vectors","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","mutant":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v >= 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","intention":{"old":"if v != 0","new":"if v >= 0"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":3,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) - value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":7,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, ) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":11,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":14,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total -= value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":18,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":22,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = None\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":26,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = None\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":29,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 1 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":33,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 1 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":37,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"INDEX\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":41,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = None\n    return out\n"}]}
{"item_id":"sparse_vectors-bug-2","split":"test","module":"sparse_vectors","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","mutant":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 1)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","intention":{"old":"b.get(key, 0)","new":"b.get(key, 1)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":3,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) - value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":7,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, ) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":11,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":14,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total -= value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":18,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":22,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = None\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":26,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = None\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":29,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 1 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":33,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 1 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":37,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"INDEX\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":41,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = None\n    return out\n"}]}
{"item_id":"sparse_vectors-bug-3","split":"test","module":"sparse_vectors","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","mutant":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product > 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","intention":{"old":"product != 0","new":"product > 0"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":3,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) - value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":7,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, ) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":11,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":14,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total -= value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":18,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":22,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = None\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":26,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = None\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":29,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 1 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":33,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 1 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":37,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"INDEX\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":41,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = None\n    return out\n"}]}
{"item_id":"sparse_vectors-bug-4","split":"test","module":"sparse_vectors","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","mutant":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k > length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n","intention":{"old":"k >= length","new":"k > length"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":3,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) - value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":7,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, ) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":11,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = None\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":14,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total -= value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":18,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":22,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = None\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":26,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = None\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":29,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 1 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":33,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 1 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":37,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"INDEX\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = value\n    return out\n"},{"index":41,"source":"\"\"\"Sparse vectors utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef add(a, b):\n    \"\"\"Add sparse dictionaries and omit zero results; inputs are unchanged.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = dict(a)\n    for key, value in b.items():\n        out[key] = out.get(key, 0) + value\n    return {k: v for k, v in out.items() if v != 0}\n\n\ndef dot(a, b):\n    \"\"\"Dot product over shared keys; missing values mean zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    total = 0\n    for key, value in a.items():\n        total += value * b.get(key, 0)\n    return total\n\n\ndef scale(a, factor):\n    \"\"\"Multiply values and omit zeros, preserving keys for negative results.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = {}\n    for key, value in a.items():\n        product = value * factor\n        if product != 0:\n            out[key] = product\n    return out\n\n\ndef dense(a, length):\n    \"\"\"Convert nonnegative integer indices within length to dense values; reject out-of-range.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if length < 0 or any(k < 0 or k >= length for k in a):\n        raise ValueError(\"index\")\n    out = [0] * length\n    for key, value in a.items():\n        out[key] = None\n    return out\n"}]}
{"item_id":"dev_strings-bug-1","split":"dev","module":"dev_strings","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","mutant":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x == y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","intention":{"old":"x != y","new":"x == y"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":2,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(None, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":5,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, ):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":8,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out = x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":11,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"XXXX\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":14,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":17,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(None)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":20,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = None\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":23,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = None\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":26,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" / extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":29,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":32,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \"XX XX\".join(parts)\n"}]}
{"item_id":"dev_strings-bug-2","split":"dev","module":"dev_strings","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","mutant":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = out + x\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","intention":{"old":"out = x + out","new":"out = out + x"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":2,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(None, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":5,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, ):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":8,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out = x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":11,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"XXXX\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":14,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":17,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(None)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":20,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = None\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":23,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = None\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":26,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" / extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":29,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":32,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \"XX XX\".join(parts)\n"}]}
{"item_id":"dev_strings-bug-3","split":"dev","module":"dev_strings","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","mutant":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text) + 1\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","intention":{"old":"width - len(text)","new":"width - len(text) + 1"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":2,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(None, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":5,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, ):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":8,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out = x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":11,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"XXXX\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":14,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":17,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(None)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":20,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = None\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":23,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = None\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":26,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" / extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":29,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":32,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \"XX XX\".join(parts)\n"}]}
{"item_id":"dev_strings-bug-4","split":"dev","module":"dev_strings","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n","mutant":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \"\".join(parts)\n","intention":{"old":"\" \".join(parts)","new":"\"\".join(parts)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = None\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":2,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(None, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":5,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, ):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":8,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out = x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":11,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"XXXX\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":14,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":17,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(None)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":20,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = None\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":23,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = None\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":26,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" / extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":29,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if parts:\n        return \"\"\n    return \" \".join(parts)\n"},{"index":32,"source":"\"\"\"Dev strings utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef prefix(a, b):\n    \"\"\"Longest common prefix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(a, b):\n        if x != y:\n            break\n        out += x\n    return out\n\n\ndef suffix(a, b):\n    \"\"\"Longest common suffix.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    out = \"\"\n    for x, y in zip(reversed(a), reversed(b)):\n        if x != y:\n            break\n        out = x + out\n    return out\n\n\ndef pad(text, width):\n    \"\"\"Right-pad with spaces without truncating.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(text) >= width:\n        return text\n    extra = width - len(text)\n    return text + \" \" * extra\n\n\ndef collapse(text):\n    \"\"\"Collapse all whitespace to single spaces and strip ends.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    parts = text.split()\n    if not parts:\n        return \"\"\n    return \"XX XX\".join(parts)\n"}]}
{"item_id":"dev_sets-bug-1","split":"dev","module":"dev_sets","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","mutant":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left | right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","intention":{"old":"left & right","new":"left | right"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":2,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":4,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = None\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":7,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":9,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":12,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left + right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":14,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":17,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":19,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":22,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(None)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":24,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    if not left:\n        return True\n    return left <= right\n"},{"index":27,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left < right\n"}]}
{"item_id":"dev_sets-bug-2","split":"dev","module":"dev_sets","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","mutant":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = right - left\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","intention":{"old":"left - right","new":"right - left"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":2,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":4,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = None\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":7,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":9,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":12,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left + right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":14,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":17,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":19,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":22,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(None)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":24,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    if not left:\n        return True\n    return left <= right\n"},{"index":27,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left < right\n"}]}
{"item_id":"dev_sets-bug-3","split":"dev","module":"dev_sets","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","mutant":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left | right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","intention":{"old":"left ^ right","new":"left | right"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":2,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":4,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = None\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":7,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":9,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":12,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left + right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":14,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":17,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":19,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":22,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(None)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":24,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    if not left:\n        return True\n    return left <= right\n"},{"index":27,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left < right\n"}]}
{"item_id":"dev_sets-bug-4","split":"dev","module":"dev_sets","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n","mutant":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left < right\n","intention":{"old":"left <= right","new":"left < right"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":2,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":4,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = None\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":7,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":9,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = None\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":12,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left + right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":14,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = None\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":17,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":19,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":22,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(None)\n    right = set(b)\n    if not left:\n        return True\n    return left <= right\n"},{"index":24,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(None)\n    if not left:\n        return True\n    return left <= right\n"},{"index":27,"source":"\"\"\"Dev sets utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef intersection(a, b):\n    \"\"\"Sorted common distinct values.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left & right\n    return sorted(result)\n\n\ndef difference(a, b):\n    \"\"\"Sorted values in a but not b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left - right\n    return sorted(result)\n\n\ndef symmetric(a, b):\n    \"\"\"Sorted values present in exactly one input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    result = left ^ right\n    return sorted(result)\n\n\ndef subset(a, b):\n    \"\"\"Whether all distinct values of a are in b, equality allowed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = set(a)\n    right = set(b)\n    if not left:\n        return True\n    return left < right\n"}]}
{"item_id":"dev_numbers-bug-1","split":"dev","module":"dev_numbers","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","mutant":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = a, b\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","intention":{"old":"abs(a), abs(b)","new":"a, b"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = None\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":3,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = None\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":7,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 1 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":11,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = None\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":15,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(None, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":19,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b != 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":22,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"XXdivisorXX\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":26,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) / b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":30,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 1 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":34,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"XXnumberXX\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":38,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n / base)\n        n //= base\n    return out or [0]\n"},{"index":42,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [1]\n"}]}
{"item_id":"dev_numbers-bug-2","split":"dev","module":"dev_numbers","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","mutant":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = a * b\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","intention":{"old":"abs(a * b)","new":"a * b"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = None\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":3,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = None\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":7,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 1 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":11,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = None\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":15,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(None, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":19,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b != 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":22,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"XXdivisorXX\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":26,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) / b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":30,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 1 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":34,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"XXnumberXX\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":38,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n / base)\n        n //= base\n    return out or [0]\n"},{"index":42,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [1]\n"}]}
{"item_id":"dev_numbers-bug-3","split":"dev","module":"dev_numbers","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","mutant":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = a // b\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","intention":{"old":"-((-a) // b)","new":"a // b"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = None\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":3,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = None\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":7,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 1 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":11,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = None\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":15,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(None, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":19,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b != 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":22,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"XXdivisorXX\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":26,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) / b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":30,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 1 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":34,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"XXnumberXX\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":38,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n / base)\n        n //= base\n    return out or [0]\n"},{"index":42,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [1]\n"}]}
{"item_id":"dev_numbers-bug-4","split":"dev","module":"dev_numbers","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n","mutant":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out\n","intention":{"old":"out or [0]","new":"out"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = None\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":3,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = None\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":7,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 1 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":11,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = None\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":15,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(None, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":19,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b != 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":22,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"XXdivisorXX\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":26,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) / b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":30,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 1 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":34,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"XXnumberXX\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [0]\n"},{"index":38,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n / base)\n        n //= base\n    return out or [0]\n"},{"index":42,"source":"\"\"\"Dev numbers utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef gcd(a, b):\n    \"\"\"Nonnegative greatest common divisor, including zeros.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    a, b = abs(a), abs(b)\n    while b:\n        a, b = b, a % b\n    return a\n\n\ndef lcm(a, b):\n    \"\"\"Nonnegative least common multiple; zero if either input is zero.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if a == 0 or b == 0:\n        return 0\n    product = abs(a * b)\n    return product // gcd(a, b)\n\n\ndef ceil_div(a, b):\n    \"\"\"Ceiling of division for integers; reject zero divisor.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if b == 0:\n        raise ValueError(\"divisor\")\n    q = -((-a) // b)\n    return q\n\n\ndef digits(n, base):\n    \"\"\"Least-significant-first digits for nonnegative integers; zero yields [0].\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if n < 0 or base < 2:\n        raise ValueError(\"number\")\n    out = []\n    while n:\n        out.append(n % base)\n        n //= base\n    return out or [1]\n"}]}
{"item_id":"dev_queue-bug-1","split":"dev","module":"dev_queue","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","mutant":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) > capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","intention":{"old":"len(queue) >= capacity","new":"len(queue) > capacity"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) > capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":2,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"XXfullXX\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":4,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = None\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":6,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(None)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":9,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"XXemptyXX\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":11,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = None\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":13,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(None)\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":15,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count <= 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":18,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"XXcountXX\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":20,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = None\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":22,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(None)\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":25,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[1]\n    return value\n"}]}
{"item_id":"dev_queue-bug-2","split":"dev","module":"dev_queue","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","mutant":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[-1]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","intention":{"old":"queue[0]","new":"queue[-1]"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) > capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":2,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"XXfullXX\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":4,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = None\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":6,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(None)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":9,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"XXemptyXX\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":11,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = None\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":13,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(None)\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":15,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count <= 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":18,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"XXcountXX\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":20,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = None\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":22,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(None)\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":25,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[1]\n    return value\n"}]}
{"item_id":"dev_queue-bug-3","split":"dev","module":"dev_queue","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","mutant":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count + 1:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","intention":{"old":"queue[count:]","new":"queue[count + 1:]"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) > capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":2,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"XXfullXX\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":4,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = None\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":6,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(None)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":9,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"XXemptyXX\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":11,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = None\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":13,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(None)\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":15,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count <= 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":18,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"XXcountXX\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":20,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = None\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":22,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(None)\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":25,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[1]\n    return value\n"}]}
{"item_id":"dev_queue-bug-4","split":"dev","module":"dev_queue","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n","mutant":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return None\n    value = queue[0]\n    return value\n","intention":{"old":"return default","new":"return None"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) > capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":2,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"XXfullXX\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":4,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = None\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":6,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(None)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":9,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"XXemptyXX\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":11,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = None\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":13,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(None)\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":15,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count <= 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":18,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"XXcountXX\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":20,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = None\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":22,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(None)\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[0]\n    return value\n"},{"index":25,"source":"\"\"\"Dev queue utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef enqueue(queue, value, capacity):\n    \"\"\"Return a new queue with a value appended; reject full queue.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if len(queue) >= capacity:\n        raise ValueError(\"full\")\n    out = list(queue)\n    out.append(value)\n    return out\n\n\ndef dequeue(queue):\n    \"\"\"Return oldest value and remaining queue; reject empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        raise ValueError(\"empty\")\n    value = queue[0]\n    return value, list(queue[1:])\n\n\ndef drain(queue, count):\n    \"\"\"Remove up to count oldest values and return taken, remaining; reject negative.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if count < 0:\n        raise ValueError(\"count\")\n    taken = list(queue[:count])\n    return taken, list(queue[count:])\n\n\ndef peek(queue, default=None):\n    \"\"\"Oldest value without removal, or default when empty.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not queue:\n        return default\n    value = queue[1]\n    return value\n"}]}
{"item_id":"dev_ranges-bug-1","split":"dev","module":"dev_ranges","bug":1,"text":"Write tests for subject.py.\n\n\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","mutant":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","intention":{"old":"stop + 1","new":"stop"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step < 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":4,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"STEP\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":8,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, None, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":12,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, ))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":16,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(None, bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":20,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[1], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":25,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":29,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo > hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":33,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(None)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":37,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[1]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":41,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[2]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":46,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left or right\n"}]}
{"item_id":"dev_ranges-bug-2","split":"dev","module":"dev_ranges","bug":2,"text":"Write tests for subject.py.\n\n\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","mutant":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo > hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","intention":{"old":"lo >= hi","new":"lo > hi"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step < 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":4,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"STEP\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":8,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, None, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":12,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, ))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":16,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(None, bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":20,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[1], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":25,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":29,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo > hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":33,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(None)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":37,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[1]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":41,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[2]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":46,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left or right\n"}]}
{"item_id":"dev_ranges-bug-3","split":"dev","module":"dev_ranges","bug":3,"text":"Write tests for subject.py.\n\n\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","mutant":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = max(values), min(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","intention":{"old":"min(values), max(values)","new":"max(values), min(values)"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step < 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":4,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"STEP\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":8,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, None, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":12,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, ))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":16,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(None, bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":20,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[1], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":25,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":29,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo > hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":33,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(None)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":37,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[1]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":41,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[2]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":46,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left or right\n"}]}
{"item_id":"dev_ranges-bug-4","split":"dev","module":"dev_ranges","bug":4,"text":"Write tests for subject.py.\n\n\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n","mutant":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left or right\n","intention":{"old":"left and right","new":"left or right"},"gold":true,"mutmut":[{"index":0,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step < 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":4,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"STEP\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":8,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, None, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":12,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, ))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":16,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(None, bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":20,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[1], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":25,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":29,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo > hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":33,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(None)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":37,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[1]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":41,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[2]\n    if a[0] > a[1]:\n        return False\n    return left and right\n"},{"index":46,"source":"\"\"\"Dev ranges utilities. Pure functions, no external dependencies.\n\nInputs follow the documented domain of each function.\nLists and mappings must not be modified unless stated.\nErrors outside the documented domain are unspecified.\n\"\"\"\n\n\ndef inclusive(start, stop, step):\n    \"\"\"Inclusive integer sequence for positive step, empty if reversed.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if step <= 0:\n        raise ValueError(\"step\")\n    values = list(range(start, stop + 1, step))\n    return values\n\n\ndef clip(span, bounds):\n    \"\"\"Intersect intervals; return None for no positive-length overlap.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    lo = max(span[0], bounds[0])\n    hi = min(span[1], bounds[1])\n    if lo >= hi:\n        return None\n    return lo, hi\n\n\ndef span(values):\n    \"\"\"Minimum and maximum, or None for empty input.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    if not values:\n        return None\n    lo, hi = min(values), max(values)\n    return lo, hi\n\n\ndef covers(a, b):\n    \"\"\"Whether closed interval a contains all of closed interval b.\n\n    This function is deterministic and has no external side effects.\n    \"\"\"\n    left = a[0] <= b[0]\n    right = a[1] >= b[1]\n    if a[0] > a[1]:\n        return False\n    return left or right\n"}]}
