<commit_before>from awslambda import awslambda
from sqs import sqs
from sns import sns
from s3 import s3
from kms import kms
from iam import iam
from dynamodb import dynamodb
from troposphere import Template
from boto3.dynamodb.conditions import Key
from cStringIO import StringIO
import ConfigParser
import boto3
import yaml
import json
import sys
import os
import zipfile

# Environment Variables

config = ConfigParser.RawConfigParser()
if os.path.exists("defaults.ini"):
    config.read('defaults.ini')
else:
    config.read('default.ini')

dynamodbClient = boto3.resource('dynamodb')
s3Client = boto3.client('s3')

t = Template()

t.add_version("2010-09-09")
applicationName = "UTIL"
protocols = dynamodbClient.Table('Application').query(
    KeyConditionExpression=Key('ApplicationName').eq(applicationName)
)
resources = {}
for item in protocols['Items']:
    if item['Protocol'] == "lambda":
        t = awslambda(item, t, defaults=config)
    if item['Protocol'] == "sqs":
        t = sqs(item, t, defaults=config)
    if item['Protocol'] == "sns":
        t = sns(item, t, defaults=config)
    if item['Protocol'] == 's3':
        t = s3(item, t, defaults=config)<commit_msg>Add regex and refactor s3<commit_after>from awslambda import awslambda
from sqs import sqs
from sns import sns
from s3 import s3
from kms import kms
from iam import iam
from dynamodb import dynamodb
from troposphere import Template
from boto3.dynamodb.conditions import Key
from cStringIO import StringIO
import ConfigParser
import boto3
import yaml
import json
import sys
import os
import zipfile

# Environment Variables

config = ConfigParser.RawConfigParser()
if os.path.exists("defaults.ini"):
    config.read('defaults.ini')
else:
    config.read('default.ini')

dynamodbClient = boto3.resource('dynamodb')
s3Client = boto3.client('s3')

t = Template()

t.add_version("2010-09-09")
applicationName = "RAIL"
protocols = dynamodbClient.Table('Application').query(
    KeyConditionExpression=Key('ApplicationName').eq(applicationName)
)
resources = {}
for item in protocols['Items']:
    if item['Protocol'] == "lambda":
        t = awslambda(item, t, defaults=config)
    if item['Protocol'] == "sqs":
        t = sqs(item, t, defaults=config)
    if item['Protocol'] == "sns":
        t = sns(item, t, defaults=config)
    if item['Protocol'] == 's3':
        t = s3(item, t, defaults=config)
{'fraction_non_alphanumeric': 0.11838790931989925, 'fraction_numerical': 0.015533165407220823, 'mean_word_length': 4.660332541567696, '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': '5535129', 'n_tokens_mistral': 783, 'n_tokens_neox': 757, 'n_words': 219}