<jupyter_start><jupyter_text>making an  gif<jupyter_code># get all html files
path = (r"C:\Users\steff\Documents\DataScience Bootcamp\Bike\maps_html")
allFiles = glob.glob(os.path.join(path,"*.html"))
#type(allFiles)
# convert html to png
driver = selenium.webdriver.PhantomJS()
for f in allFiles:
    driver.set_window_size(800, 600)  # choose a resolution
    driver.get(r'maps_html/'+f[61:])
    #print()
    # You may need to add time.sleep(seconds) here
    driver.save_screenshot(f'maps_png/map{f[61:-5]}.png')
png_dir = (r"C:\Users\steff\Documents\DataScience Bootcamp\Bike\maps_png\\")
images = []
for file_name in os.listdir(png_dir):
    if file_name.endswith('.png'):
        file_path = os.path.join(png_dir, file_name)
        images.append(imageio.imread(file_path))
imageio.mimsave("nextbike2.gif", images)
# making a movie
image_folder = (r"C:\Users\steff\Documents\DataScience Bootcamp\Bike\maps_png\\")
video_name = 'video.avi'

images = [img for img in os.listdir(image_folder) if img.endswith(".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.1518796992481203, 'fraction_numerical': 0.014285714285714285, 'mean_word_length': 5.1336405529953915, 'pattern_counts': {'":': 0, '<': 5, '<?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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '374263', 'license': 'MIT', 'n_tokens_mistral': 518, 'n_tokens_neox': 492, 'n_words': 90, 'path': 'nextbike_folium_gifmap.ipynb', 'repo_name': 'steffmul/nextbike', 'size': '1330'}