


from collections.abc import Sequence







def 							lowerCAmelCase_	(   __lowerCamelCase				,      __lowerCamelCase = False      ):
							if not arr:
														return 0

							__snake_case						:     Optional[Any]									=  0 if allow_empty_subarrays else float("-inf"      )
							__snake_case						:     Optional[Any]									=  0.0
							for num in arr:
														__snake_case						:     Any									=  max(0 if allow_empty_subarrays else num				,      curr_sum + num      )
														__snake_case						:     List[Any]									=  max(__lowerCamelCase				,      __lowerCamelCase      )

							return max_sum


if __name__ == "__main__":
			from doctest import testmod

			testmod()

			_snake_case	:						Optional[int]         =							[-2, 1, -3, 4, -1, 2, 1, -5, 4]
			print(f'''{max_subarray_sum(nums) = }''')









from __future__ import annotations

import csv

import requests
from bsa import BeautifulSoup





def    __lowerCAmelCase   (    __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    __lowerCAmelCase   (    __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()






