<commit_before>from appython.components.api.api_exception import ApiException
from appython.components.api.api_status import ApiStatus
from flask import request
from flask.ext.restful import Resource

# import logging


class BaseApi(Resource):
    def __init__(self):
        # Defaults
        self._data = {}
        self._code = ApiStatus.OK
        self._message = 'OK'

        # If we add custom headers we need to handle options() too. See:
        # https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#Preflighted_requests
        self._headers = {
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'}

    '''
    HTTP methods<commit_msg>add Access-Control-Allow-Headers<commit_after>from appython.components.api.api_exception import ApiException
from appython.components.api.api_status import ApiStatus
from flask import request
from flask.ext.restful import Resource

# import logging


class BaseApi(Resource):
    def __init__(self):
        # Defaults
        self._data = {}
        self._code = ApiStatus.OK
        self._message = 'OK'

        # If we add custom headers we need to handle options() too. See:
        # https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS#Preflighted_requests
        self._headers = {
            'Access-Control-Allow-Origin': '*',
            'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
            'Access-Control-Allow-Headers': 'Accept, Content-Type'}

    '''
    HTTP methods
{'fraction_non_alphanumeric': 0.10647851186658114, 'fraction_numerical': 0.0, 'mean_word_length': 2.9, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3849968', 'n_tokens_mistral': 460, 'n_tokens_neox': 445, 'n_words': 105}