def get_near(self, user, size):
        self._read_leaderboard()

        scores = self.scores
        if len(scores) == 0:
            return self.create_response(True, True, [])

        if not user.username in self.user_scores:
            return self.get_top_players(user, size)

        index = None

        for i, r in enumerate(scores):
            if r.user == user.username:
                index = i
                break

        # higher board is larger for even numbers
        start = index % int(floor(size * 0.5))
        end = index + int(ceil(size * 0.5))

        # slide start and end when the player is on the edge of a board
        num_scores = len(scores)
        if start < 0:
            end -= start
            start = 0
            if end > num_scores:
                end = num_scores
        elif end > num_scores:
            start -= (end - num_scores)
            end = num_scores
            if start < 0:
                start = 0

        leaderboard = []
        player = None
        for i in xrange(start, end, 1):
            s = scores[i]
            username = s.user
            row = self._get_row(username, s)
            if username == user.username:
                player = row

            leaderboard.append(row)

        if player is None:
            player = self._get_user_row(user)

        self._rank_leaderboard(leaderboard, self._get_rank(leaderboard[0]['score']))

        top = (start == 0)
        bottom = (end == num_scores)
        return self.create_response(top, bottom, leaderboard, player)
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/models/apiv1/leaderboards.py/Leaderboard.get_near/operator `-` -> `%`