<commit_before>"""API - Resource Manager"""
import re
import jwt
import json
import yaml
import textwrap
from collections import defaultdict
from datetime import datetime, timedelta
from flask import request, make_response, abort as flask_abort
from werkzeug.wrappers import Response as ResponseBase
from validater import SchemaParser, Invalid
from . import exporters

PATTERN_ACTION = re.compile(
    r'^(get|post|put|delete|head|options|trace|patch){1}(?:_(.*))?$')
PATTERN_ENDPOINT = re.compile(r"^(?:(.*)\.)?(\w*)(?:@(.*))?$")
DEFAULT_AUTH = {
    "header": "Authorization",
    "algorithm": "HS256",
    "expiration": 3600
}


def abort(code, body=None, headers=None):
    """Abort with suitable error response

    :param code: status code
    :parma body: error content
    :param headers: response headers<commit_msg>fix import error<commit_after>"""API - Resource Manager"""
import re
import jwt
import json
import yaml
import textwrap
from collections import defaultdict
from datetime import datetime, timedelta
from flask import request, make_response, abort as flask_abort
from werkzeug.wrappers import Response as ResponseBase
from validater import SchemaParser, Invalid
from .exporters import exporters

PATTERN_ACTION = re.compile(
    r'^(get|post|put|delete|head|options|trace|patch){1}(?:_(.*))?$')
PATTERN_ENDPOINT = re.compile(r"^(?:(.*)\.)?(\w*)(?:@(.*))?$")
DEFAULT_AUTH = {
    "header": "Authorization",
    "algorithm": "HS256",
    "expiration": 3600
}


def abort(code, body=None, headers=None):
    """Abort with suitable error response

    :param code: status code
    :parma body: error content
    :param headers: response headers
{'fraction_non_alphanumeric': 0.13357400722021662, 'fraction_numerical': 0.009626955475330927, 'mean_word_length': 5.32319391634981, 'pattern_counts': {'":': 6, '<': 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': '5359871', 'n_tokens_mistral': 522, 'n_tokens_neox': 494, 'n_words': 156}