'Returns True if there are more than 1 failures during last 4 runs.'

def _IsCronJobFailing(self, cron_job):

    statuses = itertools.islice(cron_job.GetValuesForAttribute(cron_job.Schema.LAST_RUN_STATUS), 0, 4)
    failures_count = 0
    for status in statuses:
        if (status.status != rdf_cronjobs.CronJobRunStatus.Status.OK):
            failures_count += 1
    return (failures_count >= 2)
