<commit_before>from rest_framework import pagination
from rest_framework.response import Response

from spillway import query
from spillway.collections import NamedCRS


class FeaturePagination(pagination.PageNumberPagination):
    """Feature pagination by page number."""

    def get_paginated_response(self, data):
        paginator = self.page.paginator
        crs = NamedCRS(query.get_srid(paginator.object_list))
        data.update({'count': paginator.count,
                     'next': self.get_next_link(),
                     'previous': self.get_previous_link(),
                     'crs': crs})
        return Response(data)
<commit_msg>Only create paginated feature response for geo collections<commit_after>from rest_framework import pagination
from rest_framework.response import Response

from spillway import query
from spillway.collections import NamedCRS


class FeaturePagination(pagination.PageNumberPagination):
    """Feature pagination by page number."""

    def get_paginated_response(self, data):
        if hasattr(data, '__geo_interface__'):
            paginator = self.page.paginator
            crs = NamedCRS(query.get_srid(paginator.object_list))
            data.update({'count': paginator.count,
                         'next': self.get_next_link(),
                         'previous': self.get_previous_link(),
                         'crs': crs})
            return Response(data)
        return super(FeaturePagination, self).get_paginated_response(data)

{'fraction_non_alphanumeric': 0.0866089273817455, 'fraction_numerical': 0.0, 'mean_word_length': 2.942257217847769, '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': '7424142', 'n_tokens_mistral': 407, 'n_tokens_neox': 396, 'n_words': 93}