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

# import nacl.exceptions
# import nacl.signing
from flask import Blueprint, current_app, render_template
"""The OCSPdash homepage UI blueprint."""

# from nacl.encoding import URLSafeBase64Encoder
# from nacl.signing import VerifyKey

__all__ = [
    'ui',
]

ui = Blueprint('ui', __name__)


@ui.route('/')
def home():
    """Show the user the home view."""
    payload = current_app.manager.get_payload()
    return render_template('index.html', payload=payload)


# @ui.route('/submit', methods=['POST'])
# def submit():
#     """Show the submit view."""
#     location_id = int(request.headers['authorization'])
#
#     location = current_app.manager.get_location_by_id(location_id)
#
#     if not location.activated:
#         return abort(403, f'Not activated: {location}')
#
#     key = location.pubkey
#
#     try:
#         verify_key = VerifyKey(key=key, encoder=URLSafeBase64Encoder)
#         payload = verify_key.verify(request.data, encoder=URLSafeBase64Encoder)
#
#     except nacl.exceptions.BadSignatureError as e:
#         return abort(403, f'Bad Signature: {e}')
#
#     decoded_payload = json.loads(base64.urlsafe_b64decode(payload).decode('utf-8'))
#     current_app.manager.insert_payload(decoded_payload)
#
#     return '', 204
<commit_msg>Remove unused imports from UI blueprint<commit_after># -*- coding: utf-8 -*-

"""The OCSPdash homepage UI blueprint."""

from flask import Blueprint, current_app, render_template

__all__ = [
    'ui',
]

ui = Blueprint('ui', __name__)


@ui.route('/')
def home():
    """Show the user the home view."""
    payload = current_app.manager.get_payload()
    return render_template('index.html', payload=payload)


# @ui.route('/submit', methods=['POST'])
# def submit():
#     """Show the submit view."""
#     location_id = int(request.headers['authorization'])
#
#     location = current_app.manager.get_location_by_id(location_id)
#
#     if not location.activated:
#         return abort(403, f'Not activated: {location}')
#
#     key = location.pubkey
#
#     try:
#         verify_key = VerifyKey(key=key, encoder=URLSafeBase64Encoder)
#         payload = verify_key.verify(request.data, encoder=URLSafeBase64Encoder)
#
#     except nacl.exceptions.BadSignatureError as e:
#         return abort(403, f'Bad Signature: {e}')
#
#     decoded_payload = json.loads(base64.urlsafe_b64decode(payload).decode('utf-8'))
#     current_app.manager.insert_payload(decoded_payload)
#
#     return '', 204

{'fraction_non_alphanumeric': 0.14554178328668532, 'fraction_numerical': 0.01599360255897641, 'mean_word_length': 3.9642857142857144, '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': '3083768', 'n_tokens_mistral': 838, 'n_tokens_neox': 807, 'n_words': 169}