


from __future__ import annotations

import csv

import requests
from bsa import BeautifulSoup


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


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


if __name__ == "__main__":
							write_movies()






def 			UpperCAmelCase_				(      UpperCAmelCase__=2_8_1_2_3  ):
					lowercase_  							=			[1] * (limit + 1)

					for i in range(2						,							int(limit**0.5  ) + 1  ):
										sum_divs[i * i] += i
										for k in range(i + 1						,							limit // i + 1  ):
															sum_divs[k * i] += k + i

					lowercase_  							=			set()
					lowercase_  							=			0

					for n in range(1						,							limit + 1  ):
										if sum_divs[n] > n:
															abundants.add(UpperCAmelCase__  )

										if not any((n - a in abundants) for a in abundants  ):
															res += n

					return res


if __name__ == "__main__":
							print(solution())


