human
I wrote the below code

    course_key = SlashSeparatedCourseKey.from_string(course_id)
    try:
        def validator(file_storage, file_to_validate):
            '\n                                                Verifies    that    the    expected    columns    are    present.\n                                                '
            with file_storage.open(file_to_validate) as f:
                reader = unicodecsv.reader(UniversalNewlineIterator(f), encoding='utf-8')
                try:
                    fieldnames = next(reader)
                except StopIteration:
                    fieldnames = []
                msg = None
                if ('cohort' not in fieldnames):
                    msg = _("The    file    must    contain    a    'cohort'    column    containing    cohort    names.")
                elif (('email' not in fieldnames) and ('username' not in fieldnames)):
                    msg = _("The    file    must    contain    a    'username'    column,    an    'email'    column,    or    both.")
                if msg:
                    raise FileValidationException(msg)
        (__, filename) = store_uploaded_file(request, 'uploaded-file', ['.csv'], course_and_time_based_filename_generator(course_key, 'cohorts'), max_file_size=2000000, validator=validator)
        lms.djangoapps.instructor_task.api.submit_cohort_students(request, course_key, filename)
    except (FileValidationException, PermissionDenied) as err:
        return JsonResponse({'error': unicode(err)}, status=400)
    return JsonResponse()

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

@transaction.non_atomic_requests
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_POST
@require_level('staff')
@common_exceptions_400
def add_users_to_cohorts(request, course_id):