<commit_before>"""
    marvin
    ~~~~~~

    This is the main entry point to marvin, the API endpoints for streamr.
"""

# pylint: disable=invalid-name

from celery import Celery
from flask import Flask, make_response, request
from flask.ext.principal import Principal
from flask.ext.restful import Api
from flask.ext.sqlalchemy import SQLAlchemy
from logging import getLogger
from sqlalchemy_defaults import make_lazy_configured
from os import path, environ

import logging.config
import sqlalchemy
import textwrap
import ujson
import yaml


class ApiBase(Api):
    """ Base API class used to add some extra functionality to Flask-RESTful. """
    # pylint: disable=super-on-old-class

    def handle_error(self, exception):
        """ Override handle_error to make sure the exception is handled by the correct logger. """
        generic_error_handler(exception)
        return super(ApiBase, self).handle_error(exception)

api = ApiBase()
db = SQLAlchemy()
principal = Principal()

_logger = getLogger('marvin')

@api.representation('application/json')
def _fastjson(data, code, headers=None):<commit_msg>Remove email logging on client errors<commit_after>"""
    marvin
    ~~~~~~

    This is the main entry point to marvin, the API endpoints for streamr.
"""

# pylint: disable=invalid-name

from celery import Celery
from flask import Flask, make_response, request
from flask.ext.principal import Principal
from flask.ext.restful import Api
from flask.ext.sqlalchemy import SQLAlchemy
from logging import getLogger
from sqlalchemy_defaults import make_lazy_configured
from os import path, environ
from werkzeug.exceptions import HTTPException

import logging.config
import sqlalchemy
import textwrap
import ujson
import yaml


class ApiBase(Api):
    """ Base API class used to add some extra functionality to Flask-RESTful. """
    # pylint: disable=super-on-old-class

    def handle_error(self, exception):
        """ Override handle_error to make sure the exception is handled by the correct logger. """
        # Don't do any special logging of client side errors
        if isinstance(exception, HTTPException) and (400 <= exception.code < 500):
            return super(ApiBase, self).handle_error(exception)
        generic_error_handler(exception)
        return super(ApiBase, self).handle_error(exception)

api = ApiBase()
db = SQLAlchemy()
principal = Principal()

_logger = getLogger('marvin')

@api.representation('application/json')
def _fastjson(data, code, headers=None):
{'fraction_non_alphanumeric': 0.08286629303442754, 'fraction_numerical': 0.0024019215372297837, 'mean_word_length': 4.468271334792123, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6393182', 'n_tokens_mistral': 730, 'n_tokens_neox': 690, 'n_words': 247}