<commit_before>import falcon
import json
import rethinkdb as r

MAX_OFFERS = 100

def get_offers(limit=MAX_OFFERS, page=1, show_all=False):
    q = r.db('voyageavecmoi').table('offers').slice(page - 1).limit(limit)\
        .order_by(r.desc('created_at'))
    if not show_all:
        q = q.filter({'confirmedAsOffer': True})

    return q

def retrieve_paging_params(params, max_limit):
    try:
        limit, page = map(int, (params.get('limit', max_limit), params.get('page', 1)))
        if page < 1:
            raise falcon.HTTPInvalidParam("Page cannot be negative or null", "page")
        elif limit < 1:
            raise falcon.HTTPInvalidParam("Limit cannot be negative or null", "limit")
        else:<commit_msg>Lower the max offers by default<commit_after>import falcon
import json
import rethinkdb as r

MAX_OFFERS = 70 # Sufficiently low to answer as fast as possible

def get_offers(limit=MAX_OFFERS, page=1, show_all=False):
    q = r.db('voyageavecmoi').table('offers').slice(page - 1).limit(limit)\
        .order_by(r.desc('created_at'))
    if not show_all:
        q = q.filter({'confirmedAsOffer': True})

    return q

def retrieve_paging_params(params, max_limit):
    try:
        limit, page = map(int, (params.get('limit', max_limit), params.get('page', 1)))
        if page < 1:
            raise falcon.HTTPInvalidParam("Page cannot be negative or null", "page")
        elif limit < 1:
            raise falcon.HTTPInvalidParam("Limit cannot be negative or null", "limit")
        else:
{'fraction_non_alphanumeric': 0.1256578947368421, 'fraction_numerical': 0.009868421052631578, 'mean_word_length': 3.2605042016806722, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1317768', 'n_tokens_mistral': 502, 'n_tokens_neox': 484, 'n_words': 136}