def found_regression_near_extreme_revisions(testcase, testcase_file_path, job_type, revision_list, min_index, max_index):
    'Test to see if we regressed near either the min or max revision.'
    last_known_crashing_revision = revision_list[max_index]
    for offset in range(1, (EXTREME_REVISIONS_TO_TEST + 1)):
        current_index = (max_index - offset)
        if (current_index < min_index):
            break
        try:
            is_crash = _testcase_reproduces_in_revision(testcase, testcase_file_path, job_type, revision_list[current_index])
        except errors.BadBuildError:
            continue
        if (not is_crash):
            save_regression_range(testcase.key.id(), revision_list[current_index], last_known_crashing_revision)
            return True
        last_known_crashing_revision = revision_list[current_index]
    for _ in range(EXTREME_REVISIONS_TO_TEST):
        min_revision = revision_list[min_index]
        try:
            crashes_in_min_revision = _testcase_reproduces_in_revision(testcase, testcase_file_path, job_type, min_revision, should_log=False)
        except errors.BadBuildError:
            if ((min_index + 1) >= max_index):
                break
            min_index += 1
            continue
        if crashes_in_min_revision:
            save_regression_range(testcase.key.id(), 0, min_revision)
            return True
        return False
    raise errors.BadBuildError(revision_list[min_index], job_type)
Test to see if we regressed near either the min or max revision.
def found_regression_near_extreme_revisions(testcase, testcase_file_path, job_type, revision_list, min_index, max_index):
    
    last_known_crashing_revision = revision_list[max_index]
    for offset in range(1, (EXTREME_REVISIONS_TO_TEST + 1)):
        current_index = (max_index - offset)
        if (current_index < min_index):
            break
        try:
            is_crash = _testcase_reproduces_in_revision(testcase, testcase_file_path, job_type, revision_list[current_index])
        except errors.BadBuildError:
            continue
        if (not is_crash):
            save_regression_range(testcase.key.id(), revision_list[current_index], last_known_crashing_revision)
            return True
        last_known_crashing_revision = revision_list[current_index]
    for _ in range(EXTREME_REVISIONS_TO_TEST):
        min_revision = revision_list[min_index]
        try:
            crashes_in_min_revision = _testcase_reproduces_in_revision(testcase, testcase_file_path, job_type, min_revision, should_log=False)
        except errors.BadBuildError:
            if ((min_index + 1) >= max_index):
                break
            min_index += 1
            continue
        if crashes_in_min_revision:
            save_regression_range(testcase.key.id(), 0, min_revision)
            return True
        return False
    raise errors.BadBuildError(revision_list[min_index], job_type)