<commit_before>from django.contrib.auth.decorators import login_required
from django.contrib.gis.measure import D
from django.http import JsonResponse
from django.views.generic import View

from .models import Player


class PlayersNear(View):

    NEAR_DISTANCE = 5 # km

    def get(self, request):
        ctx = {}
        player = request.user.player
        import ipdb; ipdb.set_trace()
        if player.pos:
            near_players = Player.objects.filter(pos__distance_lte=(player.pos, D(km=self.NEAR_DISTANCE))).exclude(pk=player.pk)
            ctx['players'] = [player.serialize() for player in near_players]
        else:
            ctx['players'] = []
        return JsonResponse(ctx)

near = login_required(PlayersNear.as_view())
<commit_msg>Removed debugger<commit_after>from django.contrib.auth.decorators import login_required
from django.contrib.gis.measure import D
from django.http import JsonResponse
from django.views.generic import View

from .models import Player


class PlayersNear(View):

    NEAR_DISTANCE = 5 # km

    def get(self, request):
        ctx = {}
        player = request.user.player
        if player.pos:
            near_players = Player.objects.filter(pos__distance_lte=(player.pos, D(km=self.NEAR_DISTANCE))).exclude(pk=player.pk)
            ctx['players'] = [player.serialize() for player in near_players]
        else:
            ctx['players'] = []
        return JsonResponse(ctx)

near = login_required(PlayersNear.as_view())

{'fraction_non_alphanumeric': 0.10384356035064059, 'fraction_numerical': 0.0013486176668914363, 'mean_word_length': 3.215909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '81168', 'n_tokens_mistral': 455, 'n_tokens_neox': 432, 'n_words': 100}