<commit_before>from troposphere import Join, Output, GetAtt
from troposphere import Parameter, Ref, Template
from troposphere.autoscaling import AutoScalingGroup, Tag, ScalingPolicy
from troposphere.cloudwatch import Alarm, MetricDimension
from troposphere.policies import UpdatePolicy, AutoScalingRollingUpdate, CreationPolicy, \
    AutoScalingCreationPolicy, ResourceSignal
import troposphere.elasticloadbalancing as elb
from troposphere.route53 import RecordSetType
import sys

__author__ = '<NAME>'


def generate_cloudformation_template():
    enable_elb = sys.argv[1]
    input_scaling_policies = eval(sys.argv[2])
    input_alarms = eval(sys.argv[3])

    if enable_elb == 'True':
        enable_elb = True
    else:
        enable_elb = False

    template = Template()

    template.add_description("""\
    Configures Auto Scaling Group for the app""")

    project_name = template.add_parameter(Parameter(
        "Name",
        Type="String",
        Description="Instances will be tagged with this name",
    ))

    scalecapacity = template.add_parameter(Parameter(
        "ScaleCapacity",
        Default="1",
        Type="String",
        Description="Number of api servers to run",
    ))

    minsize = template.add_parameter(Parameter(
        "MinScale",<commit_msg>Using ast.literal_eval() instead of eval as per http://stackoverflow.com/a/988251/563072<commit_after>from troposphere import Join, Output, GetAtt
from troposphere import Parameter, Ref, Template
from troposphere.autoscaling import AutoScalingGroup, Tag, ScalingPolicy
from troposphere.cloudwatch import Alarm, MetricDimension
from troposphere.policies import UpdatePolicy, AutoScalingRollingUpdate, CreationPolicy, \
    AutoScalingCreationPolicy, ResourceSignal
import troposphere.elasticloadbalancing as elb
from troposphere.route53 import RecordSetType
import sys
import ast

__author__ = '<NAME>'


def generate_cloudformation_template():
    enable_elb = sys.argv[1]
    input_scaling_policies = ast.literal_eval(sys.argv[2])
    input_alarms = ast.literal_eval(sys.argv[3])

    enable_elb = enable_elb == 'True'

    template = Template()

    template.add_description("""\
    Configures Auto Scaling Group for the app""")

    project_name = template.add_parameter(Parameter(
        "Name",
        Type="String",
        Description="Instances will be tagged with this name",
    ))

    scalecapacity = template.add_parameter(Parameter(
        "ScaleCapacity",
        Default="1",
        Type="String",
        Description="Number of api servers to run",
    ))

    minsize = template.add_parameter(Parameter(
        "MinScale",
{'fraction_non_alphanumeric': 0.08687405159332322, 'fraction_numerical': 0.009104704097116844, 'mean_word_length': 4.022857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6058755', 'n_tokens_mistral': 771, 'n_tokens_neox': 757, 'n_words': 191}