<commit_before>from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from django.conf import settings

dynamic_settings = getattr(settings, 'DYNAMIC_REST', {})
class DynamicPageNumberPagination(PageNumberPagination):
  page_size_query_param = dynamic_settings.get('PAGE_SIZE_QUERY_PARAM', 'per_page')
  page_query_param = dynamic_settings.get('PAGE_QUERY_PARAM', 'page')
  max_page_size = dynamic_settings.get('MAX_PAGE_SIZE', None)

  def get_page_metadata(self):<commit_msg>add default page_size (paignation doesn't work without it)<commit_after>from rest_framework.pagination import PageNumberPagination
from rest_framework.response import Response
from django.conf import settings

dynamic_settings = getattr(settings, 'DYNAMIC_REST', {})
class DynamicPageNumberPagination(PageNumberPagination):
  page_size_query_param = dynamic_settings.get('PAGE_SIZE_QUERY_PARAM', 'per_page')
  page_query_param = dynamic_settings.get('PAGE_QUERY_PARAM', 'page')
  max_page_size = dynamic_settings.get('MAX_PAGE_SIZE', None)
  page_size = dynamic_settings.get('DEFAULT_PAGE_SIZE', 500)

  def get_page_metadata(self):
{'fraction_non_alphanumeric': 0.08808290155440414, 'fraction_numerical': 0.0025906735751295338, 'mean_word_length': 9.441441441441441, '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': '6170065', 'n_tokens_mistral': 357, 'n_tokens_neox': 351, 'n_words': 65}