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

N = 1
observations = []
def solve(d):
    return {'lower-bracket':('(' if d['lo'] is None or not d['li'] else '['), 'upper-bracket':(')' if d['hi'] is None or not d['ui'] else ']'), 'point-empty':(d['lo'] is not None and d['lo']==d['hi'] and not (d['li'] and d['ui'])), 'lower-operator':(None if d['lo'] is None else ('gte' if d['li'] else 'gt')), 'upper-operator':(None if d['hi'] is None else ('lte' if d['ui'] else 'lt')), 'point-short-label':(d['lo'] if d['lo']==d['hi'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': 0, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 0}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None})], 2: [({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2}), ({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None})], 3: [({'lo': 0, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None})], 4: [({'lo': 2, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None})], 5: [({'lo': 2, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2}), ({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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(d):
    return {'lower-bracket':('(' if d['lo'] is None or not d['li'] else '['), 'upper-bracket':(')' if d['hi'] is None or not d['ui'] else ']'), 'point-empty':(d['lo'] is not None and d['lo']==d['hi'] and not (d['li'] and d['ui'])), 'lower-operator':(None if d['lo'] is None else ('gte' if d['li'] else 'gt')), 'upper-operator':(None if d['hi'] is None else ('lte' if d['ui'] else 'lt')), 'point-short-label':(d['lo'] if d['li'] and d['ui'] else None)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'lo': 0, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 0}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None})], 2: [({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2}), ({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None})], 3: [({'lo': 0, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None})], 4: [({'lo': 2, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': True, 'lower-operator': 'gte', 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': None, 'point-short-label': None})], 5: [({'lo': 2, 'hi': 2, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 0, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 2, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '[', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': 'lte', 'point-short-label': 2}), ({'lo': None, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': None, 'point-short-label': None}), ({'lo': None, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lt', 'point-short-label': None}), ({'lo': None, 'hi': 2, 'li': True, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': False, 'lower-operator': None, 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': None, 'li': True, 'ui': False}, {'lower-bracket': '[', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gte', 'upper-operator': None, 'point-short-label': None}), ({'lo': 0, 'hi': 0, 'li': False, 'ui': True}, {'lower-bracket': '(', 'upper-bracket': ']', 'point-empty': True, 'lower-operator': 'gt', 'upper-operator': 'lte', 'point-short-label': None}), ({'lo': 0, 'hi': 2, 'li': False, 'ui': False}, {'lower-bracket': '(', 'upper-bracket': ')', 'point-empty': False, 'lower-operator': 'gt', 'upper-operator': 'lt', 'point-short-label': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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:
Point shorthand appears only for a closed nonempty point range is violated by the widget projection.

A range editor stores separate lower and upper inclusivity, suppresses brackets for open endpoints, and identifies empty point intervals. This example checks: Point shorthand appears only for a closed nonempty point range.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'exclusive-end':(d['end']), 'rolling-start':((d['now'] if d['live'] else d['snapshot'])-d['days']+1), 'rolling-end':((d['now'] if d['live'] else d['snapshot'])+1), 'future-warning':(d['end'] is not None and d['end']>d['now']), 'custom-reset':(None if d['custom'] else d['days']), 'display-span':(None if d['end'] is None else d['end']-d['start']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1})], 2: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12})], 3: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 2})], 4: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 2}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 2})], 5: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 7, 'display-span': 2}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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(d):
    return {'exclusive-end':((d['end'] or 0)+1), 'rolling-start':((d['now'] if d['live'] else d['snapshot'])-d['days']+1), 'rolling-end':((d['now'] if d['live'] else d['snapshot'])+1), 'future-warning':(d['end'] is not None and d['end']>d['now']), 'custom-reset':(None if d['custom'] else d['days']), 'display-span':(None if d['end'] is None else d['end']-d['start']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1})], 2: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12})], 3: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 2})], 4: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 2}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 2})], 5: [({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 7, 'display-span': 2}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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:
Inclusive date selection serializes the following day boundary is violated by the widget projection.

A stipulated day-index filter uses inclusive display dates and an exclusive serialized end, with rolling presets bound either to live now or a frozen snapshot. This example checks: Inclusive date selection serializes the following day boundary.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'exclusive-end':(None if d['end'] is None else d['end']+1), 'rolling-start':(d['now']-d['days']), 'rolling-end':((d['now'] if d['live'] else d['snapshot'])+1), 'future-warning':(d['end'] is not None and d['end']>d['now']), 'custom-reset':(None if d['custom'] else d['days']), 'display-span':(None if d['end'] is None else d['end']-d['start']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1})], 2: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 7, 'display-span': 12})], 3: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 2})], 4: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 2}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 2})], 5: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 7, 'display-span': 2}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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(d):
    return {'exclusive-end':(None if d['end'] is None else d['end']+1), 'rolling-start':(d['snapshot']-d['days']+1), 'rolling-end':((d['now'] if d['live'] else d['snapshot'])+1), 'future-warning':(d['end'] is not None and d['end']>d['now']), 'custom-reset':(None if d['custom'] else d['days']), 'display-span':(None if d['end'] is None else d['end']-d['start']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1})], 2: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 7, 'display-span': 12})], 3: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 2})], 4: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 2}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 2})], 5: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 7, 'display-span': 2}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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:
Rolling date presets include the anchor day and honor live mode is violated by the widget projection.

A stipulated day-index filter uses inclusive display dates and an exclusive serialized end, with rolling presets bound either to live now or a frozen snapshot. This example checks: Rolling date presets include the anchor day and honor live mode.

split: open-access


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

N = 1
observations = []
def solve(d):
    return {'exclusive-end':(None if d['end'] is None else d['end']+1), 'rolling-start':((d['now'] if d['live'] else d['snapshot'])-d['days']+1), 'rolling-end':(d['now']+1), 'future-warning':(d['end'] is not None and d['end']>d['now']), 'custom-reset':(None if d['custom'] else d['days']), 'display-span':(None if d['end'] is None else d['end']-d['start']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1})], 2: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12})], 3: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 2})], 4: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 2}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 2})], 5: [({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 7, 'display-span': 2}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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(d):
    return {'exclusive-end':(None if d['end'] is None else d['end']+1), 'rolling-start':((d['now'] if d['live'] else d['snapshot'])-d['days']+1), 'rolling-end':(d['now'] if d['live'] else d['snapshot']), 'future-warning':(d['end'] is not None and d['end']>d['now']), 'custom-reset':(None if d['custom'] else d['days']), 'display-span':(None if d['end'] is None else d['end']-d['start']+1)}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 1})], 2: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12})], 3: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 0, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 1, 'display-span': -9}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 1, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 2})], 4: [({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': None}), ({'end': 0, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 1, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 7, 'display-span': -9}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 2}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 2})], 5: [({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': None}), ({'end': None, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': 10, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': False, 'custom-reset': None, 'display-span': 11}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': False}, {'exclusive-end': 11, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': 1, 'display-span': 1}), ({'end': 10, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': True}, {'exclusive-end': 11, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': 1}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': True, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 10, 'rolling-end': 11, 'future-warning': True, 'custom-reset': 1, 'display-span': 12}), ({'end': 11, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': True}, {'exclusive-end': 12, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': True, 'custom-reset': None, 'display-span': 12}), ({'end': 11, 'start': 10, 'now': 10, 'snapshot': 8, 'days': 7, 'live': False, 'custom': False}, {'exclusive-end': 12, 'rolling-start': 2, 'rolling-end': 9, 'future-warning': True, 'custom-reset': 7, 'display-span': 2}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 1, 'live': False, 'custom': True}, {'exclusive-end': None, 'rolling-start': 8, 'rolling-end': 9, 'future-warning': False, 'custom-reset': None, 'display-span': None}), ({'end': None, 'start': 0, 'now': 10, 'snapshot': 8, 'days': 7, 'live': True, 'custom': False}, {'exclusive-end': None, 'rolling-start': 4, 'rolling-end': 11, 'future-warning': False, 'custom-reset': 7, 'display-span': None})]}
for index, (data, expected) in enumerate(fixtures[N]):
    check("contract fixture " + str(index), solve(data), 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:
Rolling presets serialize an exclusive end from the selected anchor is violated by the widget projection.

A stipulated day-index filter uses inclusive display dates and an exclusive serialized end, with rolling presets bound either to live now or a frozen snapshot. This example checks: Rolling presets serialize an exclusive end from the selected anchor.

split: open-access