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

from flask import Blueprint, jsonify, g, request, Response, url_for
from flask.views import MethodView
from .domain import EntityNotFoundError


def return_or_catch(f):
    def wrapper(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except EntityNotFoundError as e:
            response = Response(e.msg, status=404, mimetype='text/plain')
            return response

    return wrapper


class MeasurementList(MethodView):<commit_msg>Return api errors as json.<commit_after># -*- coding: utf-8 -*-

from flask import Blueprint, jsonify, g, request, Response, url_for
from flask.views import MethodView
from .domain import EntityNotFoundError


def return_or_catch(f):
    def wrapper(*args, **kwargs):
        try:
            return f(*args, **kwargs)
        except EntityNotFoundError as e:
            return jsonify(error=e.msg), 404

    return wrapper


class MeasurementList(MethodView):
{'fraction_non_alphanumeric': 0.10041407867494824, 'fraction_numerical': 0.008281573498964804, 'mean_word_length': 3.222707423580786, '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': '1296132', 'n_tokens_mistral': 281, 'n_tokens_neox': 260, 'n_words': 86}