<commit_before># -*- coding: utf-8 -*-

"""
httpbin.core
~~~~~~~~~~~~

This module provides the core HttpBin experience.
"""

import base64
import json
import os
import time

import librato

from flask import Flask, Response, request, render_template, redirect, jsonify, make_response
from raven.contrib.flask import Sentry
from werkzeug.datastructures import WWWAuthenticate

from . import filters
from .helpers import get_headers, status_code, get_dict, check_basic_auth, check_digest_auth, H, ROBOT_TXT, ANGRY_ASCII
from .utils import weighted_choice
from .structures import CaseInsensitiveDict

ENV_COOKIES = (
    '_gauges_unique',
    '_gauges_unique_year',
    '_gauges_unique_month',
    '_gauges_unique_day',
    '_gauges_unique_hour',
    '__utmz',
    '__utma',
    '__utmb'
)

app = Flask(__name__)

# Setup error collection
sentry = Sentry(app)

metrics = librato.connect(
    os.environ.get('LIBRATO_USER'),
    os.environ.get('LIBRATO_TOKEN')
    ).get_counter('httpbin-requests')

# ------
# Routes
# ------

@app.after_request
def log_metrics(r):
    metrics.add(1)
    return r
<commit_msg>10 instead<commit_after># -*- coding: utf-8 -*-

"""
httpbin.core
~~~~~~~~~~~~

This module provides the core HttpBin experience.
"""

import base64
import json
import os
import time

import librato

from flask import Flask, Response, request, render_template, redirect, jsonify, make_response
from raven.contrib.flask import Sentry
from werkzeug.datastructures import WWWAuthenticate

from . import filters
from .helpers import get_headers, status_code, get_dict, check_basic_auth, check_digest_auth, H, ROBOT_TXT, ANGRY_ASCII
from .utils import weighted_choice
from .structures import CaseInsensitiveDict

ENV_COOKIES = (
    '_gauges_unique',
    '_gauges_unique_year',
    '_gauges_unique_month',
    '_gauges_unique_day',
    '_gauges_unique_hour',
    '__utmz',
    '__utma',
    '__utmb'
)

app = Flask(__name__)

# Setup error collection
sentry = Sentry(app)

metrics = librato.connect(
    os.environ.get('LIBRATO_USER'),
    os.environ.get('LIBRATO_TOKEN')
    ).get_counter('httpbin-requests')

# ------
# Routes
# ------

@app.after_request
def log_metrics(r):
    metrics.add(10)
    return r

{'fraction_non_alphanumeric': 0.11833785004516711, 'fraction_numerical': 0.004968383017163505, 'mean_word_length': 4.35024154589372, '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': '1495471', 'n_tokens_mistral': 780, 'n_tokens_neox': 761, 'n_words': 179}