human
What is a the Python program you requested given the following:
Complete the below
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_global_staff
@require_POST
def generate_bulk_certificate_exceptions(request, course_id):

    ''''Add Students to certificate white list from the uploaded csv file.
    :return response in dict format.
    general_errors: [errors related to csv file e.g. csv uploading, csv attachment, content reading etc. ],
    row_errors: {
    data_format_error:              [users/data in csv file that are not well formatted],
    user_not_exist:                 [csv with none exiting users in LMS system],
    user_already_white_listed:      [users that are already white listed],
    user_not_enrolled:              [rows with not enrolled users in the given course]
    success: [list of successfully added users to the certificate white list model]'
    '''
assistant
#Here is the Python program you requested.
    user_index = 0
    notes_index = 1
    row_errors_key = ['data_format_error', 'user_not_exist', 'user_already_white_listed', 'user_not_enrolled']
    course_key = CourseKey.from_string(course_id)
    (students, general_errors, success) = ([], [], [])
    row_errors = {key: [] for key in row_errors_key}
    def build_row_errors(key, _user, row_count):
        '\n                                inner    method    to    build    dict    of    csv    data    as    row    errors.\n                                '
        row_errors[key].append(_('user    "{user}"    in    row#    {row}').format(user=_user, row=row_count))
    if ('students_list' in request.FILES):
        try:
            upload_file = request.FILES.get('students_list')
            if upload_file.name.endswith('.csv'):
                students = [row for row in csv.reader(upload_file.read().splitlines())]
            else:
                general_errors.append(_('Make    sure    that    the    file    you    upload    is    in    CSV    format    with    no    extraneous    characters    or    rows.'))
        except Exception:
            general_errors.append(_('Could    not    read    uploaded    file.'))
        finally:
            upload_file.close()
        row_num = 0
        for student in students:
            row_num += 1
            if (len(student) != 2):
                if (len(student) > 0):
                    build_row_errors('data_format_error', student[user_index], row_num)
                    log.info(u'invalid    data/format    in    csv    row#    %s', row_num)
                continue
            user = student[user_index]
            try:
                user = get_user_by_username_or_email(user)
            except ObjectDoesNotExist:
                build_row_errors('user_not_exist', user, row_num)
                log.info(u'student    %s    does    not    exist', user)
            else:
                if (len(CertificateWhitelist.get_certificate_white_list(course_key, user)) > 0):
                   ...