<commit_before>from . import Endpoint


def endpoint(path, method):
    def decorator(func):
        endpoint_ = Endpoint(path, method)
        Endpoint.endpoints[endpoint_] = func
        return func

    return decorator
<commit_msg>Decorator "endpoint" accord name_for_lambda to function<commit_after>import boto3

from noopy.utils import to_pascal_case
from noopy.endpoint import Endpoint


def endpoint(path, method):
    def decorator(func):
        import settings
        lambda_settings = settings.LAMBDA
        client = boto3.client('lambda')
        function_prefix = 'arn:aws:lambda:{}:{}:{}'.format(
                client._client_config.region_name,
                settings.ACCOUNT_ID,
                lambda_settings['Prefix']
        )
        func.name_for_lambda = '{}{}'.format(function_prefix, to_pascal_case(func.func_name))
        endpoint_ = Endpoint(path, method)
        Endpoint.endpoints[endpoint_] = func
        return func

    return decorator

{'fraction_non_alphanumeric': 0.09202453987730061, 'fraction_numerical': 0.002044989775051125, 'mean_word_length': 2.884920634920635, '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': '6618359', 'n_tokens_mistral': 287, 'n_tokens_neox': 277, 'n_words': 60}