def METHOD_NAME(request, key=None):
    rcontroller = request.contest.controller.ranking_controller()
    choices = rcontroller.available_rankings(request)
    if key is None:
        key = choices[0][0]
    if key not in next(zip(*choices)):
        raise Http404
    context = dict()
    ranking = None
    if rcontroller.can_search_for_users():
        form = FilterUsersInRankingForm(request, request.GET)
        context['form'] = form
        if form.is_valid():
            user = form.cleaned_data.get('user')
            # Everybody can search for themselves.
            # Contest admins can search for anyone.
            if user and (is_contest_basicadmin(request) or user == request.user):
                found_pos = rcontroller.find_user_position(request, key, user)
                if found_pos:
                    users_per_page = getattr(settings, 'PARTICIPANTS_ON_PAGE', 100)
                    found_page = ((found_pos - 1) // users_per_page) + 1
                    get_dict = request.GET.copy()
                    get_dict.pop('user')
                    get_dict['page'] = str(found_page)
                    return redirect(
                        request.path + '?' + get_dict.urlencode() + '#' + str(user.id)
                    )
                else:
                    msg = _("User is not in the ranking.")
                    # Admin should receive error in form,
                    # whereas user should see it as an error message,
                    # because there is no form then.
                    if is_contest_basicadmin(request):
                        form._errors['user'] = form.error_class([msg])
                    else:
                        messages.error(request, msg)
    if ranking is None:
        # Changing request.GET is necessary!
        # The pagination library not only truncates the list of objects,
        # but also generates the links to other pages.
        # It simply copies the current url and replaces 'page'
        # with another number. If there is a different GET parameter,
        # it is included (without any change) in the url to another page.
        # If a user requests a page, he can provide any number of useless
        # GET parameters, which will be shown in urls to other pages.
        # The ranking page could be cached and those urls could be
        # visible to other users, giving them links to the ranking
        # with strange arguments (e.g. arguments, which perform a search).
        # Below, only 'user' key is deleted, because that's the only argument
        # performing an action, and I'd like to change request.GET
        # as less as possible.
        # This solution does not prevent users from sending "messages"
        # between each other (using these GET parameters).
        request.GET = request.GET.copy()
        try:
            request.GET.pop('user')
        except KeyError:
            pass
        ranking = rcontroller.get_rendered_ranking(request, key)
    context['choices'] = choices
    context['ranking'] = ranking
    context['key'] = key
    return TemplateResponse(request, 'rankings/ranking_view.html', context)