<commit_before>#!/usr/bin/python3.6
import json


def parse_event_for_request_body(event):
    return event.get('body', None)


def respond_success(message):
    return {
        'statusCode': 200,
        'headers': {
            'Content-Type': 'text/plain',
        },
        'body': message
    }


def respond_success_json(body):
    return {
        'statusCode': 200,
        'headers': {
            'Content-Type': 'application/json',
        },
        'body': body
    }


def respond_server_error(message):
    return {
        'statusCode': 500,
        'headers': {
            'Content-Type': 'text/plain',
        },
        'body': message
    }


def respond_unauthorized(message):
    return {
        'statusCode': 401,
        'headers': {
            'Content-Type': 'text/plain',
        },
        'body': message
    }


def respond_bad_request(message):
    return {
        'statusCode': 400,
        'headers': {
            'Content-Type': 'text/plain',
        },
        'body': message
    }


def respond_conflict(message):
    return {
        'statusCode': 409,
        'headers': {
            'Content-Type': 'text/plain',
        },
        'body': message
    }


def respond_not_found(message):
    return {
        'statusCode': 404,
        'headers': {
            'Content-Type': 'text/plain',
        },
        'body': message
    }<commit_msg>enable CORS for api methods<commit_after>#!/usr/bin/python3.6
import json


def parse_event_for_request_body(event):
    return event.get('body', None)


def respond_success(message):
    return {
        'statusCode': 200,
        'headers': {
            'Content-Type': 'text/plain',
            'Access-Control-Allow-Origin': '*'
        },
        'body': message
    }


def respond_success_json(body):
    return {
        'statusCode': 200,
        'headers': {
            'Content-Type': 'application/json',
            'Access-Control-Allow-Origin': '*'
        },
        'body': body
    }


def respond_server_error(message):
    return {
        'statusCode': 500,
        'headers': {
            'Content-Type': 'text/plain',
            'Access-Control-Allow-Origin': '*'
        },
        'body': message
    }


def respond_unauthorized(message):
    return {
        'statusCode': 401,
        'headers': {
            'Content-Type': 'text/plain',
            'Access-Control-Allow-Origin': '*'
        },
        'body': message
    }


def respond_bad_request(message):
    return {
        'statusCode': 400,
        'headers': {
            'Content-Type': 'text/plain',
            'Access-Control-Allow-Origin': '*'
        },
        'body': message
    }


def respond_conflict(message):
    return {
        'statusCode': 409,
        'headers': {
            'Content-Type': 'text/plain',
            'Access-Control-Allow-Origin': '*'
        },
        'body': message
    }


def respond_not_found(message):
    return {
        'statusCode': 404,
        'headers': {
            'Content-Type': 'text/plain',
            'Access-Control-Allow-Origin': '*'
        },
        'body': message
    }
{'fraction_non_alphanumeric': 0.14816, 'fraction_numerical': 0.01472, 'mean_word_length': 1.7421052631578948, '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': '67892', 'n_tokens_mistral': 992, 'n_tokens_neox': 937, 'n_words': 167}