<commit_before>import csv
from PIL import Image, ImageDraw,ImageFont



# Main image from base.jpg
im = Image.open('base.jpg').convert('RGBA')
W, H = im.size

MaxSize = 200
maxFontW = W * .90

# Open the Local Hack Day CSV
with open('data.csv', 'rb') as attendance:
	#Set the reader
    reader = csv.reader(attendance)
    #Iterate through
    for row in reader:

    	#Grab name and surname
    	first_name = row[0].upper()
    	last_name = row[1].upper()
    	full_name = first_name + " " + last_name

    	# Set font and size
        NameFont = ImageFont.truetype('fonts/Outage.ttf', venueSize)
        address = ImageFont.truetype('fonts/Lato.ttf', addressSize)
        <commit_msg>added some code from original source and cleaned it up<commit_after>import csv
from PIL import Image, ImageDraw,ImageFont


# Open the Local Hack Day CSV
with open('data.csv', 'rb') as attendance:
	#Set the reader
    reader = csv.reader(attendance)
    
    #Iterate through
    for row in reader:

		# Main image from base.jpg
		im = Image.open('base.jpg').convert('RGBA')
		W, H = im.size

		MaxSize = 200
		maxFontW = W * .90

		nameSize = MaxSize
        congrats = MaxSize/2

    	#Grab name and surname
    	first_name = row[0].upper()
    	last_name = row[1].upper()
    	full_name = first_name + " " + last_name

    	# Set font and size
        venue = ImageFont.truetype('fonts/Outage.ttf', nameSize)
        address = ImageFont.truetype('fonts/Lato.ttf', congrats)

        draw = ImageDraw.Draw(im)

        # Find size of text
        wVenue, hVenue = draw.textsize(venueName,font=venue)

        # Make size smaller until width is less than size of maxFontW
        while (wVenue > maxFontW):
            nameSize = nameSize - 10
            venue = ImageFont.truetype('fonts/Outage.ttf', nameSize)
            wVenue, hVenue = draw.textsize(venueName,font=venue)

        wAddress, hAddress = draw.textsize(addressDetails,font=address)

        while (wAddress > maxFontW):
            congrats = congrats - 10
            address = ImageFont.truetype('fonts/OpenSansRegular.ttf', congrats)
            wAddress, hAddress = draw.textsize(addressDetails,font=address)

{'fraction_non_alphanumeric': 0.10465652374366068, 'fraction_numerical': 0.00875979714153988, 'mean_word_length': 2.767361111111111, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2777440', 'n_tokens_mistral': 750, 'n_tokens_neox': 700, 'n_words': 188}