"""Original indentation demonstration. No files, network or external input. The wrong function is intentionally defective. Passing the paired checks confirms this demonstration; it does NOT approve the wrong function. """ def ready_names(rows): result = [] for row in rows: if row["ready"]: result.append(row["name"]) return result def ready_names_wrong(rows): result = [] for row in rows: if row["ready"]: result.append(row["name"]) return result cases = [ ( "unready first, ready second", [{"name": "Draft", "ready": False}, {"name": "Report", "ready": True}], ["Report"], [], ), ( "two ready rows", [{"name": "A", "ready": True}, {"name": "B", "ready": True}], ["A", "B"], ["A"], ), ("empty input", [], [], None), ] for label, rows, expected, expected_wrong in cases: actual = ready_names(rows) wrong_actual = ready_names_wrong(rows) assert actual == expected, (label, "intended function", actual, expected) assert wrong_actual == expected_wrong, (label, "counterexample", wrong_actual) print(f"{label}: intended={actual!r}; wrong={wrong_actual!r}") print("All 3 paired checks match the documented example.")