<commit_before>#!/usr/bin/env python
import boto

print 'Security group information:\n'

ec2 = boto.connect_ec2()
sgs = ec2.get_all_security_groups()

for sg in sgs:
    instances = sg.instances()
    print 'id: %s, name: %s, count: %s' % (sg.id, sg.name, len(instances))

    for inst in instances:
        tag_name = 'UNKNOWN'
        if inst.tags is not None and 'Name' in inst.tags:
            tag_name = inst.tags['Name']
        print '\tid: %s, name: %s' % (inst.id, tag_name)
<commit_msg>Update script to use boto3 instead of boto2<commit_after>#!/usr/bin/env python
import boto3

print 'Security group information:\n'

ec2 = boto3.resource('ec2')
sgs = ec2.security_groups.all()

for sg in sgs:
    tag_name = sg.group_name
    if sg.tags is not None:
        for tag in sg.tags:
            if tag['Key'] == 'Name' and tag['Value'] != '':
                tag_name = tag['Value']

    print 'id: %s, name: %s, vpc_id: %s' % (sg.id, tag_name, sg.vpc_id)
{'fraction_non_alphanumeric': 0.14656964656964658, 'fraction_numerical': 0.010395010395010396, 'mean_word_length': 2.8830645161290325, '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': '5687871', 'n_tokens_mistral': 369, 'n_tokens_neox': 357, 'n_words': 103}