broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(setpoint, temps):
    lead = 0
    s1 = False
    s2 = False
    out = []
    for temp in temps:
        if s1 and temp <= setpoint:
            s1 = False
            s2 = False
            lead = 1 - lead
        elif not s1 and temp > setpoint + 10:
            s1 = True
        if s1:
            if s2 and temp <= setpoint + 10:
                s2 = False
            elif not s2 and temp > setpoint + 30:
                s2 = True
        comps = [False, False]
        if s1:
            comps[lead] = True
        if s2:
            comps[1] = True
        out.append(comps)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [791, 800, 788, 797, 797, 800, 800, 794, 783, 786, 794, 800, 796, 800, 793]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [773, 772, 761, 772, 763, 774, 780, 778, 772, 783, 782, 782, 789, 780, 788, 791]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750,
    [763, 769, 774, 780, 786, 775, 770, 775, 764, 773, 765, 772, 760, 771, 761, 760, 749, 738, 740, 739]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 4',
   [750,
    [756, 768, 779, 785, 774, 770, 779, 785, 789, 793, 789, 794, 783, 795, 795, 798, 800, 800, 800, 800]],
   [[False, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [737, 734, 746, 756, 754, 757, 746, 734, 742, 746, 747, 754, 742, 743, 743, 740, 741, 730, 730]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: scenario 36',
   [750,
    [766,
     761,
     757,
     767,
     758,
     752,
     750,
     760,
     769,
     770,
     781,
     771,
     768,
     756,
     768,
     757,
     745,
     755,
     754,
     743,
     743,
     751]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [True, True],
    [True, True],
    [True, True],
    [False, True],
    [False, True],
    [False, True],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [781, 777, 789, 785, 797, 797, 794, 792, 789, 796, 791, 779, 788, 794, 800]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750,
    [789,
     800,
     793,
     797,
     800,
     800,
     800,
     789,
     799,
     800,
     797,
     794,
     798,
     787,
     798,
     794,
     800,
     791,
     785,
     774,
     785]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750, [772, 766, 758, 765, 758, 750, 747, 754, 765, 761, 757, 760]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [755, 754, 746, 745, 752, 763, 766, 771, 761, 750, 745, 748, 742, 746, 743, 738, 747, 739]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: scenario 55',
   [750,
    [781,
     773,
     761,
     758,
     754,
     765,
     767,
     761,
     750,
     742,
     742,
     753,
     752,
     764,
     767,
     760,
     767,
     770,
     773,
     785,
     790,
     790]],
   [[True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [762, 759, 748, 748, 738, 734, 743, 743, 736, 730, 730, 740, 745, 743, 754]],
   [[True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750, [799, 791, 800, 795, 787, 776, 768, 762, 752, 742, 732, 734, 742, 749]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750, [761, 772, 779, 779, 782, 785, 785, 790, 799, 800, 800, 800, 794]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 4',
   [750, [774, 775, 785, 773, 771, 769, 757, 761, 751, 747, 742, 740, 747, 741, 738, 749]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750,
    [768,
     772,
     765,
     773,
     768,
     770,
     772,
     766,
     758,
     765,
     775,
     781,
     777,
     785,
     783,
     782,
     789,
     778,
     772,
     772,
     775,
     763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [736, 737, 732, 735, 731, 730, 730, 730, 731, 742, 748, 744, 734, 732, 742, 737, 741, 745, 754]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [766,
     766,
     761,
     768,
     778,
     773,
     776,
     774,
     773,
     764,
     759,
     752,
     748,
     737,
     737,
     730,
     741,
     751,
     763,
     767,
     758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [750, 758, 750, 760, 764, 772, 773, 777, 788, 780, 788, 786, 795]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [761, 760, 765, 774, 773, 771, 770, 759, 770, 776, 781, 770, 767, 760, 769, 762, 766, 763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]],
 [['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: scenario 30',
   [750,
    [758,
     759,
     770,
     769,
     761,
     750,
     761,
     758,
     769,
     776,
     781,
     788,
     799,
     800,
     800,
     790,
     796,
     790,
     779,
     790,
     784]],
   [[False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [766, 778, 774, 767, 764, 771, 779, 770, 767, 762, 752, 755, 756, 753, 746, 758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750,
    [762,
     763,
     758,
     761,
     758,
     746,
     737,
     733,
     730,
     739,
     742,
     746,
     744,
     745,
     738,
     733,
     730,
     731,
     730,
     730,
     730,
     730]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [767, 756, 761, 750, 751, 751, 748, 739, 735, 737, 746, 750, 740, 744, 749, 760, 770, 777, 776, 772]],
   [[True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [799, 787, 790, 791, 800, 788, 778, 790, 778, 769, 758, 761, 755, 767, 764]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(setpoint, temps):
    lead = 0
    s1 = False
    s2 = False
    out = []
    for temp in temps:
        if s1 and temp <= setpoint:
            s1 = False
            s2 = False
            lead = 1 - lead
        elif not s1 and temp > setpoint + 10:
            s1 = True
        if s1:
            if s2 and temp <= setpoint + 10:
                s2 = False
            elif not s2 and temp > setpoint + 30:
                s2 = True
        comps = [False, False]
        if s1:
            comps[lead] = True
        if s2:
            comps[1 - lead if lead == 0 else 1] = True
        out.append(comps)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [791, 800, 788, 797, 797, 800, 800, 794, 783, 786, 794, 800, 796, 800, 793]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [773, 772, 761, 772, 763, 774, 780, 778, 772, 783, 782, 782, 789, 780, 788, 791]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750,
    [763, 769, 774, 780, 786, 775, 770, 775, 764, 773, 765, 772, 760, 771, 761, 760, 749, 738, 740, 739]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 4',
   [750,
    [756, 768, 779, 785, 774, 770, 779, 785, 789, 793, 789, 794, 783, 795, 795, 798, 800, 800, 800, 800]],
   [[False, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [737, 734, 746, 756, 754, 757, 746, 734, 742, 746, 747, 754, 742, 743, 743, 740, 741, 730, 730]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: scenario 36',
   [750,
    [766,
     761,
     757,
     767,
     758,
     752,
     750,
     760,
     769,
     770,
     781,
     771,
     768,
     756,
     768,
     757,
     745,
     755,
     754,
     743,
     743,
     751]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [True, True],
    [True, True],
    [True, True],
    [False, True],
    [False, True],
    [False, True],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [781, 777, 789, 785, 797, 797, 794, 792, 789, 796, 791, 779, 788, 794, 800]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750,
    [789,
     800,
     793,
     797,
     800,
     800,
     800,
     789,
     799,
     800,
     797,
     794,
     798,
     787,
     798,
     794,
     800,
     791,
     785,
     774,
     785]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750, [772, 766, 758, 765, 758, 750, 747, 754, 765, 761, 757, 760]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [755, 754, 746, 745, 752, 763, 766, 771, 761, 750, 745, 748, 742, 746, 743, 738, 747, 739]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: scenario 55',
   [750,
    [781,
     773,
     761,
     758,
     754,
     765,
     767,
     761,
     750,
     742,
     742,
     753,
     752,
     764,
     767,
     760,
     767,
     770,
     773,
     785,
     790,
     790]],
   [[True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [762, 759, 748, 748, 738, 734, 743, 743, 736, 730, 730, 740, 745, 743, 754]],
   [[True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750, [799, 791, 800, 795, 787, 776, 768, 762, 752, 742, 732, 734, 742, 749]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750, [761, 772, 779, 779, 782, 785, 785, 790, 799, 800, 800, 800, 794]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 4',
   [750, [774, 775, 785, 773, 771, 769, 757, 761, 751, 747, 742, 740, 747, 741, 738, 749]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750,
    [768,
     772,
     765,
     773,
     768,
     770,
     772,
     766,
     758,
     765,
     775,
     781,
     777,
     785,
     783,
     782,
     789,
     778,
     772,
     772,
     775,
     763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [736, 737, 732, 735, 731, 730, 730, 730, 731, 742, 748, 744, 734, 732, 742, 737, 741, 745, 754]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [766,
     766,
     761,
     768,
     778,
     773,
     776,
     774,
     773,
     764,
     759,
     752,
     748,
     737,
     737,
     730,
     741,
     751,
     763,
     767,
     758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [750, 758, 750, 760, 764, 772, 773, 777, 788, 780, 788, 786, 795]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [761, 760, 765, 774, 773, 771, 770, 759, 770, 776, 781, 770, 767, 760, 769, 762, 766, 763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]],
 [['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: scenario 30',
   [750,
    [758,
     759,
     770,
     769,
     761,
     750,
     761,
     758,
     769,
     776,
     781,
     788,
     799,
     800,
     800,
     790,
     796,
     790,
     779,
     790,
     784]],
   [[False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [766, 778, 774, 767, 764, 771, 779, 770, 767, 762, 752, 755, 756, 753, 746, 758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750,
    [762,
     763,
     758,
     761,
     758,
     746,
     737,
     733,
     730,
     739,
     742,
     746,
     744,
     745,
     738,
     733,
     730,
     731,
     730,
     730,
     730,
     730]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [767, 756, 761, 750, 751, 751, 748, 739, 735, 737, 746, 750, 740, 744, 749, 760, 770, 777, 776, 772]],
   [[True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [799, 787, 790, 791, 800, 788, 778, 790, 778, 769, 758, 761, 755, 767, 764]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
When compressor 1 is lead, stage 2 adds no capacity and compressor 0 never runs as lag.

Two-compressor cooling with lead/lag rotation, per sample in tenths F. Stage 1 starts above setpoint + 1.0 F and ends at <= setpoint (ending stage 2 too); stage 2 starts above setpoint + 3.0 F and ends at <= setpoint + 1.0 F. Stage 1 runs the lead compressor and stage 2 the other one; the lead swaps when a cooling cycle ends. Return [compressor0, compressor1] per sample.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(setpoint, temps):
    lead = 0
    s1 = False
    s2 = False
    out = []
    for temp in temps:
        if s1 and temp <= setpoint:
            s1 = False
            lead = 1 - lead
        elif not s1 and temp > setpoint + 10:
            s1 = True
        if s1:
            if s2 and temp <= setpoint + 10:
                s2 = False
            elif not s2 and temp > setpoint + 30:
                s2 = True
        comps = [False, False]
        if s1:
            comps[lead] = True
        if s2:
            comps[1 - lead] = True
        out.append(comps)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [791, 800, 788, 797, 797, 800, 800, 794, 783, 786, 794, 800, 796, 800, 793]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [773, 772, 761, 772, 763, 774, 780, 778, 772, 783, 782, 782, 789, 780, 788, 791]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750,
    [763, 769, 774, 780, 786, 775, 770, 775, 764, 773, 765, 772, 760, 771, 761, 760, 749, 738, 740, 739]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 4',
   [750,
    [756, 768, 779, 785, 774, 770, 779, 785, 789, 793, 789, 794, 783, 795, 795, 798, 800, 800, 800, 800]],
   [[False, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [737, 734, 746, 756, 754, 757, 746, 734, 742, 746, 747, 754, 742, 743, 743, 740, 741, 730, 730]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [781, 777, 789, 785, 797, 797, 794, 792, 789, 796, 791, 779, 788, 794, 800]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750,
    [789,
     800,
     793,
     797,
     800,
     800,
     800,
     789,
     799,
     800,
     797,
     794,
     798,
     787,
     798,
     794,
     800,
     791,
     785,
     774,
     785]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750, [772, 766, 758, 765, 758, 750, 747, 754, 765, 761, 757, 760]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [755, 754, 746, 745, 752, 763, 766, 771, 761, 750, 745, 748, 742, 746, 743, 738, 747, 739]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 5',
   [750, [779, 781, 782, 790, 792, 800, 800, 797, 800, 800, 800, 793, 793, 786, 793]],
   [[True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]]],
 [['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [762, 759, 748, 748, 738, 734, 743, 743, 736, 730, 730, 740, 745, 743, 754]],
   [[True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750, [799, 791, 800, 795, 787, 776, 768, 762, 752, 742, 732, 734, 742, 749]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750, [761, 772, 779, 779, 782, 785, 785, 790, 799, 800, 800, 800, 794]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 4',
   [750, [774, 775, 785, 773, 771, 769, 757, 761, 751, 747, 742, 740, 747, 741, 738, 749]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 5',
   [750, [754, 757, 767, 762, 753, 746, 755, 760, 766, 765, 761, 771]],
   [[False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750,
    [768,
     772,
     765,
     773,
     768,
     770,
     772,
     766,
     758,
     765,
     775,
     781,
     777,
     785,
     783,
     782,
     789,
     778,
     772,
     772,
     775,
     763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [736, 737, 732, 735, 731, 730, 730, 730, 731, 742, 748, 744, 734, 732, 742, 737, 741, 745, 754]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [766,
     766,
     761,
     768,
     778,
     773,
     776,
     774,
     773,
     764,
     759,
     752,
     748,
     737,
     737,
     730,
     741,
     751,
     763,
     767,
     758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [750, 758, 750, 760, 764, 772, 773, 777, 788, 780, 788, 786, 795]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [761, 760, 765, 774, 773, 771, 770, 759, 770, 776, 781, 770, 767, 760, 769, 762, 766, 763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]],
 [['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [766, 778, 774, 767, 764, 771, 779, 770, 767, 762, 752, 755, 756, 753, 746, 758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750,
    [762,
     763,
     758,
     761,
     758,
     746,
     737,
     733,
     730,
     739,
     742,
     746,
     744,
     745,
     738,
     733,
     730,
     731,
     730,
     730,
     730,
     730]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [767, 756, 761, 750, 751, 751, 748, 739, 735, 737, 746, 750, 740, 744, 749, 760, 770, 777, 776, 772]],
   [[True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [799, 787, 790, 791, 800, 788, 778, 790, 778, 769, 758, 761, 755, 767, 764]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]],
  ['control: scenario 5',
   [750, [748, 758, 752, 747, 738, 730, 730, 730, 730, 737, 746, 742, 739, 746]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(setpoint, temps):
    lead = 0
    s1 = False
    s2 = False
    out = []
    for temp in temps:
        if s1 and temp <= setpoint:
            s1 = False
            lead = 1 - lead
        elif not s1 and temp > setpoint + 10:
            s1 = True
            s2 = False
        if s1:
            if s2 and temp <= setpoint + 10:
                s2 = False
            elif not s2 and temp > setpoint + 30:
                s2 = True
        comps = [False, False]
        if s1:
            comps[lead] = True
        if s2:
            comps[1 - lead] = True
        out.append(comps)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [791, 800, 788, 797, 797, 800, 800, 794, 783, 786, 794, 800, 796, 800, 793]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [773, 772, 761, 772, 763, 774, 780, 778, 772, 783, 782, 782, 789, 780, 788, 791]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750,
    [763, 769, 774, 780, 786, 775, 770, 775, 764, 773, 765, 772, 760, 771, 761, 760, 749, 738, 740, 739]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 4',
   [750,
    [756, 768, 779, 785, 774, 770, 779, 785, 789, 793, 789, 794, 783, 795, 795, 798, 800, 800, 800, 800]],
   [[False, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [737, 734, 746, 756, 754, 757, 746, 734, 742, 746, 747, 754, 742, 743, 743, 740, 741, 730, 730]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [781, 777, 789, 785, 797, 797, 794, 792, 789, 796, 791, 779, 788, 794, 800]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750,
    [789,
     800,
     793,
     797,
     800,
     800,
     800,
     789,
     799,
     800,
     797,
     794,
     798,
     787,
     798,
     794,
     800,
     791,
     785,
     774,
     785]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750, [772, 766, 758, 765, 758, 750, 747, 754, 765, 761, 757, 760]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [755, 754, 746, 745, 752, 763, 766, 771, 761, 750, 745, 748, 742, 746, 743, 738, 747, 739]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 5',
   [750, [779, 781, 782, 790, 792, 800, 800, 797, 800, 800, 800, 793, 793, 786, 793]],
   [[True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]]],
 [['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [762, 759, 748, 748, 738, 734, 743, 743, 736, 730, 730, 740, 745, 743, 754]],
   [[True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750, [799, 791, 800, 795, 787, 776, 768, 762, 752, 742, 732, 734, 742, 749]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750, [761, 772, 779, 779, 782, 785, 785, 790, 799, 800, 800, 800, 794]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 4',
   [750, [774, 775, 785, 773, 771, 769, 757, 761, 751, 747, 742, 740, 747, 741, 738, 749]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 5',
   [750, [754, 757, 767, 762, 753, 746, 755, 760, 766, 765, 761, 771]],
   [[False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]]],
 [['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750,
    [768,
     772,
     765,
     773,
     768,
     770,
     772,
     766,
     758,
     765,
     775,
     781,
     777,
     785,
     783,
     782,
     789,
     778,
     772,
     772,
     775,
     763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [736, 737, 732, 735, 731, 730, 730, 730, 731, 742, 748, 744, 734, 732, 742, 737, 741, 745, 754]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [766,
     766,
     761,
     768,
     778,
     773,
     776,
     774,
     773,
     764,
     759,
     752,
     748,
     737,
     737,
     730,
     741,
     751,
     763,
     767,
     758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [750, 758, 750, 760, 764, 772, 773, 777, 788, 780, 788, 786, 795]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [761, 760, 765, 774, 773, 771, 770, 759, 770, 776, 781, 770, 767, 760, 769, 762, 766, 763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]],
 [['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: scenario 1',
   [750, [766, 778, 774, 767, 764, 771, 779, 770, 767, 762, 752, 755, 756, 753, 746, 758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750,
    [762,
     763,
     758,
     761,
     758,
     746,
     737,
     733,
     730,
     739,
     742,
     746,
     744,
     745,
     738,
     733,
     730,
     731,
     730,
     730,
     730,
     730]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [767, 756, 761, 750, 751, 751, 748, 739, 735, 737, 746, 750, 740, 744, 749, 760, 770, 777, 776, 772]],
   [[True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [799, 787, 790, 791, 800, 788, 778, 790, 778, 769, 758, 761, 755, 767, 764]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]],
  ['control: scenario 5',
   [750, [748, 758, 752, 747, 738, 730, 730, 730, 730, 737, 746, 742, 739, 746]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The next cooling cycle starts with both compressors at once.

Two-compressor cooling with lead/lag rotation, per sample in tenths F. Stage 1 starts above setpoint + 1.0 F and ends at <= setpoint (ending stage 2 too); stage 2 starts above setpoint + 3.0 F and ends at <= setpoint + 1.0 F. Stage 1 runs the lead compressor and stage 2 the other one; the lead swaps when a cooling cycle ends. Return [compressor0, compressor1] per sample.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(setpoint, temps):
    lead = 0
    s1 = False
    s2 = False
    out = []
    for temp in temps:
        if s1 and temp <= setpoint:
            s1 = False
            s2 = False
            lead = 1 - lead
        elif not s1 and temp > setpoint + 10:
            s1 = True
        if s1:
            if s2 and temp <= setpoint:
                s2 = False
            elif not s2 and temp > setpoint + 30:
                s2 = True
        comps = [False, False]
        if s1:
            comps[lead] = True
        if s2:
            comps[1 - lead] = True
        out.append(comps)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [791, 800, 788, 797, 797, 800, 800, 794, 783, 786, 794, 800, 796, 800, 793]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [773, 772, 761, 772, 763, 774, 780, 778, 772, 783, 782, 782, 789, 780, 788, 791]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: scenario 3',
   [750,
    [763, 769, 774, 780, 786, 775, 770, 775, 764, 773, 765, 772, 760, 771, 761, 760, 749, 738, 740, 739]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 4',
   [750,
    [756, 768, 779, 785, 774, 770, 779, 785, 789, 793, 789, 794, 783, 795, 795, 798, 800, 800, 800, 800]],
   [[False, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [737, 734, 746, 756, 754, 757, 746, 734, 742, 746, 747, 754, 742, 743, 743, 740, 741, 730, 730]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: scenario 38',
   [750, [787, 782, 777, 765, 776, 773, 769, 769, 771, 760, 758, 765, 769, 775, 784, 794]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [781, 777, 789, 785, 797, 797, 794, 792, 789, 796, 791, 779, 788, 794, 800]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750,
    [789,
     800,
     793,
     797,
     800,
     800,
     800,
     789,
     799,
     800,
     797,
     794,
     798,
     787,
     798,
     794,
     800,
     791,
     785,
     774,
     785]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750, [772, 766, 758, 765, 758, 750, 747, 754, 765, 761, 757, 760]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [755, 754, 746, 745, 752, 763, 766, 771, 761, 750, 745, 748, 742, 746, 743, 738, 747, 739]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: scenario 2',
   [750, [799, 791, 800, 795, 787, 776, 768, 762, 752, 742, 732, 734, 742, 749]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['regression: scenario 56',
   [750,
    [783, 782, 771, 760, 765, 760, 772, 764, 762, 767, 776, 782, 777, 779, 772, 777, 773, 778, 780, 786]],
   [[True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [762, 759, 748, 748, 738, 734, 743, 743, 736, 730, 730, 740, 745, 743, 754]],
   [[True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750, [761, 772, 779, 779, 782, 785, 785, 790, 799, 800, 800, 800, 794]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: scenario 4',
   [750, [774, 775, 785, 773, 771, 769, 757, 761, 751, 747, 742, 740, 747, 741, 738, 749]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: scenario 7',
   [750, [781, 777, 770, 762, 759, 748, 747, 746, 753, 754, 766, 776, 768, 767]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750,
    [768,
     772,
     765,
     773,
     768,
     770,
     772,
     766,
     758,
     765,
     775,
     781,
     777,
     785,
     783,
     782,
     789,
     778,
     772,
     772,
     775,
     763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [736, 737, 732, 735, 731, 730, 730, 730, 731, 742, 748, 744, 734, 732, 742, 737, 741, 745, 754]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [766,
     766,
     761,
     768,
     778,
     773,
     776,
     774,
     773,
     764,
     759,
     752,
     748,
     737,
     737,
     730,
     741,
     751,
     763,
     767,
     758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [750, 758, 750, 760, 764, 772, 773, 777, 788, 780, 788, 786, 795]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]]],
 [['regression: scenario 13',
   [750, [788, 792, 787, 775, 767, 774, 771, 768, 765, 757, 768, 779, 785, 784, 782, 782, 778]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [766, 778, 774, 767, 764, 771, 779, 770, 767, 762, 752, 755, 756, 753, 746, 758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750,
    [762,
     763,
     758,
     761,
     758,
     746,
     737,
     733,
     730,
     739,
     742,
     746,
     744,
     745,
     738,
     733,
     730,
     731,
     730,
     730,
     730,
     730]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [767, 756, 761, 750, 751, 751, 748, 739, 735, 737, 746, 750, 740, 744, 749, 760, 770, 777, 776, 772]],
   [[True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['regression: scenario 4',
   [750, [799, 787, 790, 791, 800, 788, 778, 790, 778, 769, 758, 761, 755, 767, 764]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(setpoint, temps):
    lead = 0
    s1 = False
    s2 = False
    out = []
    for temp in temps:
        if s1 and temp <= setpoint:
            s1 = False
            s2 = False
            lead = 1 - lead
        elif not s1 and temp > setpoint + 10:
            s1 = True
        if s1:
            if s2 and temp < setpoint + 10:
                s2 = False
            elif not s2 and temp > setpoint + 30:
                s2 = True
        comps = [False, False]
        if s1:
            comps[lead] = True
        if s2:
            comps[1 - lead] = True
        out.append(comps)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [791, 800, 788, 797, 797, 800, 800, 794, 783, 786, 794, 800, 796, 800, 793]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [773, 772, 761, 772, 763, 774, 780, 778, 772, 783, 782, 782, 789, 780, 788, 791]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: scenario 3',
   [750,
    [763, 769, 774, 780, 786, 775, 770, 775, 764, 773, 765, 772, 760, 771, 761, 760, 749, 738, 740, 739]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 4',
   [750,
    [756, 768, 779, 785, 774, 770, 779, 785, 789, 793, 789, 794, 783, 795, 795, 798, 800, 800, 800, 800]],
   [[False, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 5',
   [750, [737, 734, 746, 756, 754, 757, 746, 734, 742, 746, 747, 754, 742, 743, 743, 740, 741, 730, 730]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: scenario 38',
   [750, [787, 782, 777, 765, 776, 773, 769, 769, 771, 760, 758, 765, 769, 775, 784, 794]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [781, 777, 789, 785, 797, 797, 794, 792, 789, 796, 791, 779, 788, 794, 800]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750,
    [789,
     800,
     793,
     797,
     800,
     800,
     800,
     789,
     799,
     800,
     797,
     794,
     798,
     787,
     798,
     794,
     800,
     791,
     785,
     774,
     785]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 3',
   [750, [772, 766, 758, 765, 758, 750, 747, 754, 765, 761, 757, 760]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [755, 754, 746, 745, 752, 763, 766, 771, 761, 750, 745, 748, 742, 746, 743, 738, 747, 739]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: scenario 2',
   [750, [799, 791, 800, 795, 787, 776, 768, 762, 752, 742, 732, 734, 742, 749]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['regression: scenario 56',
   [750,
    [783, 782, 771, 760, 765, 760, 772, 764, 762, 767, 776, 782, 777, 779, 772, 777, 773, 778, 780, 786]],
   [[True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [762, 759, 748, 748, 738, 734, 743, 743, 736, 730, 730, 740, 745, 743, 754]],
   [[True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750, [761, 772, 779, 779, 782, 785, 785, 790, 799, 800, 800, 800, 794]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: scenario 4',
   [750, [774, 775, 785, 773, 771, 769, 757, 761, 751, 747, 742, 740, 747, 741, 738, 749]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]]],
 [['regression: scenario 7',
   [750, [781, 777, 770, 762, 759, 748, 747, 746, 753, 754, 766, 776, 768, 767]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750,
    [768,
     772,
     765,
     773,
     768,
     770,
     772,
     766,
     758,
     765,
     775,
     781,
     777,
     785,
     783,
     782,
     789,
     778,
     772,
     772,
     775,
     763]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['control: scenario 2',
   [750, [736, 737, 732, 735, 731, 730, 730, 730, 731, 742, 748, 744, 734, 732, 742, 737, 741, 745, 754]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [766,
     766,
     761,
     768,
     778,
     773,
     776,
     774,
     773,
     764,
     759,
     752,
     748,
     737,
     737,
     730,
     741,
     751,
     763,
     767,
     758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True]]],
  ['control: scenario 4',
   [750, [750, 758, 750, 760, 764, 772, 773, 777, 788, 780, 788, 786, 795]],
   [[False, False],
    [False, False],
    [False, False],
    [False, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]]],
 [['regression: scenario 13',
   [750, [788, 792, 787, 775, 767, 774, 771, 768, 765, 757, 768, 779, 785, 784, 782, 782, 778]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True]]],
  ['regression: stage two exit',
   [750, [790, 775, 765, 761, 760, 755, 750]],
   [[True, True], [True, True], [True, True], [True, True], [True, False], [True, False], [False, False]]],
  ['regression: two cycles',
   [750, [765, 770, 785, 770, 758, 750, 762, 790, 750]],
   [[True, False],
    [True, False],
    [True, True],
    [True, True],
    [True, False],
    [False, False],
    [False, True],
    [True, True],
    [False, False]]],
  ['control: back to back cycles',
   [750, [761, 750, 761, 781, 750, 790, 790]],
   [[True, False], [False, False], [False, True], [True, True], [False, False], [True, True], [True, True]]],
  ['control: scenario 1',
   [750, [766, 778, 774, 767, 764, 771, 779, 770, 767, 762, 752, 755, 756, 753, 746, 758]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False]]],
  ['control: scenario 2',
   [750,
    [762,
     763,
     758,
     761,
     758,
     746,
     737,
     733,
     730,
     739,
     742,
     746,
     744,
     745,
     738,
     733,
     730,
     731,
     730,
     730,
     730,
     730]],
   [[True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False]]],
  ['control: scenario 3',
   [750,
    [767, 756, 761, 750, 751, 751, 748, 739, 735, 737, 746, 750, 740, 744, 749, 760, 770, 777, 776, 772]],
   [[True, False],
    [True, False],
    [True, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, False],
    [False, True],
    [False, True],
    [False, True],
    [False, True]]],
  ['regression: scenario 4',
   [750, [799, 787, 790, 791, 800, 788, 778, 790, 778, 769, 758, 761, 755, 767, 764]],
   [[True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, True],
    [True, False],
    [True, False],
    [True, False],
    [True, False],
    [True, False]]]]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The lag compressor runs to the end of every cycle, overcooling and short-cycling the lead.

Two-compressor cooling with lead/lag rotation, per sample in tenths F. Stage 1 starts above setpoint + 1.0 F and ends at <= setpoint (ending stage 2 too); stage 2 starts above setpoint + 3.0 F and ends at <= setpoint + 1.0 F. Stage 1 runs the lead compressor and stage 2 the other one; the lead swaps when a cooling cycle ends. Return [compressor0, compressor1] per sample.

split: open-access