def METHOD_NAME(request):
    if request.method == 'POST':
        form = SubmissionForm(
            request,
            request.POST,
            request.FILES,
            kind='TESTRUN',
            problem_filter=filter_testrun_problem_instances,
        )
        if form.is_valid():
            request.contest.controller.create_testrun(
                request, form.cleaned_data['problem_instance'], form.cleaned_data
            )
            return redirect('my_submissions', contest_id=request.contest.id)
    else:
        form = SubmissionForm(
            request, kind='TESTRUN', problem_filter=filter_testrun_problem_instances
        )
    problem_instances = filter_testrun_problem_instances(form.get_problem_instances())
    submissions_left = {
        pi.id: pi.controller.get_submissions_left(request, pi, 'TESTRUN')
        for pi in problem_instances
    }
    # Testrun time limits in seconds.
    time_limits = {
        pi.id: float(pi.controller.get_test_run_time_limit(pi)) / 1000
        for pi in problem_instances
    }
    # Testrun memory limits in MB.
    memory_limits = {
        pi.id: pi.controller.get_test_run_memory_limit(pi) / 1024
        for pi in problem_instances
    }
    return TemplateResponse(
        request,
        'testrun/submit.html',
        {
            'form': form,
            'submissions_left': submissions_left,
            'time_limits': time_limits,
            'memory_limits': memory_limits,
        },
    )