<commit_before>import boto3
import pprint

ec2 = boto3.resource('ec2')

for vpc in ec2.vpcs.all():
    for subnet in vpc.subnets.all():
    	response = ec2.meta.client.describe_instances(Filters=[{'Name': 'subnet-id', 'Values': [ subnet.id ]}])
    	reservations = response['Reservations']
    	if(reservations):
          list_instances = reservations[0]
          print(list_instances)<commit_msg>Updated to a function call for instances in subnet<commit_after>import boto3
import pprint

ec2 = boto3.resource('ec2')

for vpc in ec2.vpcs.all():
    for subnet in vpc.subnets.all():
    	print("List of instances in subnet: " + subnet.cidr_block)
    	for instance in subnet.instances.all():
    		print(instance.id)
{'fraction_non_alphanumeric': 0.12552301255230125, 'fraction_numerical': 0.016736401673640166, 'mean_word_length': 3.8513513513513513, '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': '6930975', 'n_tokens_mistral': 257, 'n_tokens_neox': 255, 'n_words': 57}