<commit_before>from functools import wraps
from flask import request, Response
from bson.json_util import dumps
from utils.config import get_app_configurations

def check_auth(username, password):
    """This function is called to check if a username /
    password combination is valid.
    """

    config = get_app_configurations()

    with open(config["credentials"], "r") as fh:
        u, p = fh.readline().rstrip().split(",")

    return username == u and password == p

def authenticate():
    """Sends a 401 response that enables basic auth"""
    resp = {"status": 401, "message": "Could not verify your access level for this resource. You have to login with proper credentials"}
    return Response(dumps(resp), 401,
    {'WWW-Authenticate': 'Basic realm="Login Required"'})

def requires_auth(f):
    @wraps(f)<commit_msg>Override slideset list in app configuration file<commit_after>from functools import wraps
from flask import request, Response
from bson.json_util import dumps
from utils.config import get_app_configurations

def check_auth(username, password):
    """This function is called to check if a username /
    password combination is valid.
    """

    config = get_app_configurations()

    with open(config["credentials"], "r") as fh:
        u, p = fh.readline().rstrip().split(",")

    return username == u and password == p

def authenticate():
    """Sends a 401 response that enables basic auth"""
    resp = {"status": 403, "message": "Could not verify your access level for this resource. You have to login with proper credentials"}
    return Response(dumps(resp), 403,
    {'WWW-Authenticate': 'Basic realm="Login Required"'})

def requires_auth(f):
    @wraps(f)
{'fraction_non_alphanumeric': 0.11026392961876832, 'fraction_numerical': 0.010557184750733138, 'mean_word_length': 4.1540785498489425, 'pattern_counts': {'":': 4, '<': 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': '5170199', 'n_tokens_mistral': 502, 'n_tokens_neox': 474, 'n_words': 183}