<commit_before><% instances.each do |instance| -%>
resource "aws_instance" "<%= module_name_of(instance) %>" {
    ami                         = "<%= instance.image_id %>"
    availability_zone           = "<%= instance.placement.availability_zone %>"
    ebs_optimized               = <%= instance.ebs_optimized %>
    instance_type               = "<%= instance.instance_type %>"
<%- if !instance.placement.group_name.empty? -%>
    placement_group             = "<%= instance.placement.group_name %>"
<%- end -%>
    monitoring                  = <%= monitoring_state(instance) %>
    key_name                    = "<%= instance.key_name %>"
<%- if in_vpc?(instance) -%>
    subnet_id                   = "<%= instance.subnet_id %>"
    vpc_security_group_ids      = <%= instance.security_groups.map { |sg| sg.group_id }.inspect %>
<%- else -%>
    security_groups             = <%= instance.security_groups.map { |sg| sg.group_name }.inspect %>
<%- end -%>
    associate_public_ip_address = true
    private_ip                  = "<%= instance.private_ip_address %>"
<%- if instance.source_dest_check -%>
    source_dest_check           = <%= instance.source_dest_check %>
<%- end -%>

<% block_devices_of(instance).each do |block_device| -%>
<%- mapping = block_device_mapping_of(instance, block_device.volume_id) -%>
<%- if root_block_device?(mapping, instance) -%>
    root_block_device {<commit_msg>Use unless rather than if.<commit_after><% instances.each do |instance| -%>
resource "aws_instance" "<%= module_name_of(instance) %>" {
    ami                         = "<%= instance.image_id %>"
    availability_zone           = "<%= instance.placement.availability_zone %>"
    ebs_optimized               = <%= instance.ebs_optimized %>
    instance_type               = "<%= instance.instance_type %>"
<%- unless instance.placement.group_name.empty? -%>
    placement_group             = "<%= instance.placement.group_name %>"
<%- end -%>
    monitoring                  = <%= monitoring_state(instance) %>
    key_name                    = "<%= instance.key_name %>"
<%- if in_vpc?(instance) -%>
    subnet_id                   = "<%= instance.subnet_id %>"
    vpc_security_group_ids      = <%= instance.security_groups.map { |sg| sg.group_id }.inspect %>
<%- else -%>
    security_groups             = <%= instance.security_groups.map { |sg| sg.group_name }.inspect %>
<%- end -%>
    associate_public_ip_address = true
    private_ip                  = "<%= instance.private_ip_address %>"
<%- if instance.source_dest_check -%>
    source_dest_check           = <%= instance.source_dest_check %>
<%- end -%>

<% block_devices_of(instance).each do |block_device| -%>
<%- mapping = block_device_mapping_of(instance, block_device.volume_id) -%>
<%- if root_block_device?(mapping, instance) -%>
    root_block_device {
{'fraction_non_alphanumeric': 0.1568904593639576, 'fraction_numerical': 0.0, 'mean_word_length': 2.529925187032419, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 51, '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': '6702343', 'n_tokens_mistral': 940, 'n_tokens_neox': 863, 'n_words': 122}