def METHOD_NAME():
    error_handler = partial(windowed_error_handler, threshold=2)
    htex = HighThroughputExecutor(block_error_handler=error_handler)
    assert htex.block_error_handler is error_handler
    bad_state_mock = Mock()
    htex.set_bad_state_and_fail_all = bad_state_mock
    bad_jobs = {'1': JobStatus(JobState.COMPLETED),
                '2': JobStatus(JobState.FAILED)}
    htex.handle_errors(bad_jobs)
    bad_state_mock.assert_not_called()
    bad_jobs = {'1': JobStatus(JobState.COMPLETED),
                '2': JobStatus(JobState.FAILED),
                '3': JobStatus(JobState.COMPLETED)}
    htex.handle_errors(bad_jobs)
    bad_state_mock.assert_not_called()
    bad_jobs = {'1': JobStatus(JobState.COMPLETED),
                '2': JobStatus(JobState.COMPLETED),
                '3': JobStatus(JobState.COMPLETED),
                '4': JobStatus(JobState.FAILED)}
    htex.handle_errors(bad_jobs)
    bad_state_mock.assert_not_called()
    bad_jobs = {'1': JobStatus(JobState.COMPLETED),
                '2': JobStatus(JobState.COMPLETED),
                '3': JobStatus(JobState.FAILED),
                '4': JobStatus(JobState.FAILED)}
    htex.handle_errors(bad_jobs)
    bad_state_mock.assert_called()