




from __future__ import annotations

import csv

import requests
from bsa import BeautifulSoup



def       UpperCAmelCase       (     _snake_case = ""							):
							lowerCAmelCase   =		url or '''https://www.imdb.com/chart/top/?ref_=nv_mv_250'''
							lowerCAmelCase   =		BeautifulSoup(requests.get(_snake_case							).text						, '''html.parser'''							)
							lowerCAmelCase   =		soup.find_all('''td'''						, attrs='''titleColumn'''							)
							lowerCAmelCase   =		soup.find_all('''td'''						, class_='''ratingColumn imdbRating'''							)
							return {
							    title.a.text: float(rating.strong.text							)
							    for title, rating in zip(_snake_case						, _snake_case							)
							}



def       UpperCAmelCase       (     _snake_case = "IMDb_Top_250_Movies.csv"							):
							lowerCAmelCase   =		get_imdb_top_aaa_movies()
							with open(_snake_case						, '''w'''						, newline=''''''							) as out_file:
														lowerCAmelCase   =		csv.writer(_snake_case							)
														writer.writerow(['''Movie title''', '''IMDb rating''']							)
														for title, rating in movies.items():
																					writer.writerow([title, rating]							)


if __name__ == "__main__":
		write_movies()





import torch

from diffusers import StableDiffusionPipeline


UpperCAmelCase_						="""path-to-your-trained-model"""
UpperCAmelCase_						=StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.floataa).to("""cuda""")

UpperCAmelCase_						="""A photo of sks dog in a bucket"""
UpperCAmelCase_						=pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]

image.save("""dog-bucket.png""")



