How do you structure unit tests for an API that serves predictive models? For this coding exercise, implement a validator that identifies failed test cases by checking HTTP status, required response fields, nested JSON values, and numeric values within a tolerance. Use def find_prediction_test_failures(cases, tolerance):; return the zero-based indices of failed cases.
def find_prediction_test_failures(cases, tolerance):