def num_error_trials(experiment_id: int) -> int:
    return sum(((1 if (t['state'] == 'ERROR') else 0) for t in experiment_trials(experiment_id)))
def num_error_trials(experiment_id: int) -> int:
    return sum(((1 if (t['state'] == 'ERROR') else 0) for t in experiment_trials(experiment_id)))