<commit_before>'''
python-lambda-local: Main module

Copyright 2015 HDE, Inc.
Licensed under MIT.
'''

from __future__ import print_function
import argparse
from main import run
import sys
from multiprocessing import Process


def main():
    args = parse_args()
    try:
        p = Process(target=run, args=(args,))
        p.start()
        p.join()
    except:
        e = sys.exc_info()
        print(e[1])


def parse_args():
    parser = argparse.ArgumentParser(description="Run AWS Lambda function" +
                                     " written in Python on local machine.")
    parser.add_argument("file", metavar="FILE", type=str,
                        help="Lambda function file name")
    parser.add_argument("event", metavar="EVENT", type=str,
                        help="Event data file name.")
    parser.add_argument("-l", "--library", metavar="LIBRARY_PATH",
                        type=str, help="Path of 3rd party libraries.")
    parser.add_argument("-f", "--function", metavar="HANDLER_FUNCTION",
                        type=str, default="handler",
                        help="Lambda function handler name. \
Default: \"handler\".")
    parser.add_argument("-t", "--timeout", metavar="TIMEOUT", type=int,
                        default=3,
                        help="Seconds until lambda function timeout. \
Default: 3")
    parser.add_argument("-a", "--arn-string", metavar="ARN_STRING", type=str,
                        default="", help="arn string for function")
    parser.add_argument("-v", "--version-name", metavar="VERSION_NAME",
                        type=str, default="", help="function version name")

    return parser.parse_args()

if __name__ == "__main__":
    main()
<commit_msg>Exit with exitcode of subprocess.<commit_after>'''
python-lambda-local: Main module

Copyright 2015 HDE, Inc.
Licensed under MIT.
'''

from __future__ import print_function
import argparse
from main import run
import sys
from multiprocessing import Process


def main():
    args = parse_args()

    p = Process(target=run, args=(args,))
    p.start()
    p.join()

    sys.exit(p.exitcode)


def parse_args():
    parser = argparse.ArgumentParser(description="Run AWS Lambda function" +
                                     " written in Python on local machine.")
    parser.add_argument("file", metavar="FILE", type=str,
                        help="Lambda function file name")
    parser.add_argument("event", metavar="EVENT", type=str,
                        help="Event data file name.")
    parser.add_argument("-l", "--library", metavar="LIBRARY_PATH",
                        type=str, help="Path of 3rd party libraries.")
    parser.add_argument("-f", "--function", metavar="HANDLER_FUNCTION",
                        type=str, default="handler",
                        help="Lambda function handler name. \
Default: \"handler\".")
    parser.add_argument("-t", "--timeout", metavar="TIMEOUT", type=int,
                        default=3,
                        help="Seconds until lambda function timeout. \
Default: 3")
    parser.add_argument("-a", "--arn-string", metavar="ARN_STRING", type=str,
                        default="", help="arn string for function")
    parser.add_argument("-v", "--version-name", metavar="VERSION_NAME",
                        type=str, default="", help="function version name")

    return parser.parse_args()

if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.13486746286047188, 'fraction_numerical': 0.004369356248179435, 'mean_word_length': 2.333980582524272, 'pattern_counts': {'":': 2, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4977135', 'n_tokens_mistral': 958, 'n_tokens_neox': 925, 'n_words': 246}