<commit_before>import os.path

from flask import Blueprint, current_app

from skylines.api.json import jsonify

about_blueprint = Blueprint('about', 'skylines')


@about_blueprint.route('/imprint')
def imprint():
    content = current_app.config.get(
        'SKYLINES_IMPRINT',
        'Please set the `SKYLINES_IMPRINT` variable in the config file.')

    return jsonify(content=content)


@about_blueprint.route('/team')
def skylines_team():
    path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        '..', '..', '..', 'AUTHORS.md')
    with open(path) as f:
        content = f.read().decode('utf-8')

    return jsonify(content=content)


@about_blueprint.route('/license')
def license():
    path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        '..', '..', '..', 'LICENSE')
    with open(path) as f:
        content = f.read().decode('utf-8')

    return jsonify(content=content)<commit_msg>api/about: Read files in binary mode to decode UTF8 later<commit_after>import os.path

from flask import Blueprint, current_app

from skylines.api.json import jsonify

about_blueprint = Blueprint('about', 'skylines')


@about_blueprint.route('/imprint')
def imprint():
    content = current_app.config.get(
        'SKYLINES_IMPRINT',
        'Please set the `SKYLINES_IMPRINT` variable in the config file.')

    return jsonify(content=content)


@about_blueprint.route('/team')
def skylines_team():
    path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        '..', '..', '..', 'AUTHORS.md')
    with open(path, 'rb') as f:
        content = f.read().decode('utf-8')

    return jsonify(content=content)


@about_blueprint.route('/license')
def license():
    path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                        '..', '..', '..', 'LICENSE')
    with open(path, 'rb') as f:
        content = f.read().decode('utf-8')

    return jsonify(content=content)
{'fraction_non_alphanumeric': 0.16112789526686808, 'fraction_numerical': 0.0025176233635448137, 'mean_word_length': 3.080082135523614, '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': '331211', 'n_tokens_mistral': 673, 'n_tokens_neox': 646, 'n_words': 128}