def METHOD_NAME(request):
    if (
        request.user.is_authenticated
        and can_enter_contest(request)
        and request.contest is not None
    ):
        return request.user, query_context_args(request.user, request.contest)
    ip_addr = request.META.get('REMOTE_ADDR')
    if not ip_addr:
        raise Http404(_("No IP address detected"))
    try:
        display = BalloonsDisplay.objects.get(ip_addr=ip_addr)
    except BalloonsDisplay.DoesNotExist:
        raise Http404(_("No balloons display configured for this IP: %s") % (ip_addr,))
    return display.user, query_context_args(display.user, display.contest)