<jupyter_start><jupyter_text>Visualizing 2nd Part<jupyter_code>import numpy as np 
import matplotlib.pyplot as plt
# For integer
arr = []
for line in open("input.txt", "r"):
    arr.append([int(x) for x in line.strip()])


step = 0
done = False
while not done:
    step += 1
    for i in range(len(arr)):
        for j in range(len(arr[0])):
            arr[i][j] += 1

            
    for i in range(len(arr)):
        for j in range(len(arr[0])):
            if arr[i][j] > 9:
                flash(i, j)
                
    done = True
    for i in range(len(arr)):
        for j in range(len(arr[0])):
            if arr[i][j] == -1:
                arr[i][j] = 0
            else:
                done = False
    np_arr=np.array(arr)
    #plt.imshow(np_arr, interpolation='none')
    plt.savefig(str(step) + "_file.png")

import cv2
import os

image_folder = './'
video_name = 'video.mp4'

images = []
for i in range(1, 238):
    images.append(str(i)+"_file.png")
frame = cv2.imread(os.path.join(image_folder, images[0]))
height, width, layers = frame.shape

video = cv2.VideoWriter(video_name, 0, 1, (width,height))

for image in images:
    video.write(cv2.imread(os.path.join(image_folder, image)))

cv2.destroyAllWindows()
video.release()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15234375, 'fraction_numerical': 0.01796875, 'mean_word_length': 2.5386740331491713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '536197', 'license': 'Apache-2.0', 'n_tokens_mistral': 482, 'n_tokens_neox': 464, 'n_words': 112, 'path': '2021/Day11/DumboOctopus.ipynb', 'repo_name': 'alizahidraja/Advent-of-code-2021', 'size': '1280'}