
'''simple docstring'''





from __future__ import annotations




def 				__magic_name__				(     __lowerCAmelCase			:		List[str]	,						__lowerCAmelCase			:		int	,						__lowerCAmelCase			:		Optional[int]							)    ->     tuple[float, float]:
				assert (
				    c % greatest_common_divisor(SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__							) == 0
				)  # greatest_common_divisor(a,b) function implemented below
				(__lowerCamelCase)					      =			extended_gcd(SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__							)  # extended_gcd(a,b) function implemented below
				__lowerCamelCase					      =			c / d
				return (r * x, r * y)




def 				__magic_name__				(     __lowerCAmelCase			:		Dict	,						__lowerCAmelCase			:		Union[str, Any]	,						__lowerCAmelCase			:		Dict	,						__lowerCAmelCase			:		int = 2							)    ->     None:
				(__lowerCamelCase)					      =			diophantine(SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__							)  # Initial value
				__lowerCamelCase					      =			greatest_common_divisor(SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__							)
				__lowerCamelCase					      =			a // d
				__lowerCamelCase					      =			b // d

				for i in range(SCREAMING_SNAKE_CASE__							):
								__lowerCamelCase					      =			xa + i * q
								__lowerCamelCase					      =			ya - i * p
								print(SCREAMING_SNAKE_CASE__	,						SCREAMING_SNAKE_CASE__							)




def 				__magic_name__				(     __lowerCAmelCase			:		Tuple	,						__lowerCAmelCase			:		List[str]							)    ->     int:


				if a < b:
								__lowerCamelCase					      =			b, a

				while a % b != 0:
								__lowerCamelCase					      =			b, a % b

				return b




def 				__magic_name__				(     __lowerCAmelCase			:		Dict	,						__lowerCAmelCase			:		Union[str, Any]							)    ->     tuple[int, int, int]:
				assert a >= 0 and b >= 0

				if b == 0:
								__lowerCamelCase					      =			a, 1, 0
				else:
								(__lowerCamelCase)					      =			extended_gcd(SCREAMING_SNAKE_CASE__	,						a % b							)
								__lowerCamelCase					      =			q
								__lowerCamelCase					      =			p - q * (a // b)

				assert a % d == 0 and b % d == 0
				assert d == a * x + b * y

				return (d, x, y)


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

					testmod(name="diophantine", verbose=True)
					testmod(name="diophantine_all_soln", verbose=True)
					testmod(name="extended_gcd", verbose=True)
					testmod(name="greatest_common_divisor", verbose=True)





import bsa
import requests




def 				__magic_name__				(     __lowerCAmelCase			:		bsa.element.ResultSet							)    ->     dict[str, str]:
				return {
				    "name": soup.ha.a.text,
				    "genre": soup.find('''span'''	,						class_='''genre'''							).text.strip(),
				    "rating": soup.strong.text,
				    "page_link": f'''https://www.imdb.com{soup.a.get('href'							)}''',
				}




def 				__magic_name__				(     __lowerCAmelCase			:		int = 5							)    ->     tuple:
				__lowerCamelCase					      =			int(float(__lowerCAmelCase							)							)
				if num_movies < 1:
								return ()
				__lowerCamelCase					      =			(
				    '''https://www.imdb.com/search/title?title_type='''
				    f'''feature&sort=num_votes,desc&count={num_movies}'''
				)
				__lowerCamelCase					      =			bsa.BeautifulSoup(requests.get(__lowerCAmelCase							).content	,						'''html.parser'''							)
				return tuple(
				    get_movie_data_from_soup(__lowerCAmelCase							)
				    for movie in source.find_all('''div'''	,						class_='''lister-item mode-advanced'''							)							)


if __name__ == "__main__":
					import json

					SCREAMING_SNAKE_CASE__     :    str      							=					int(input("How many movies would you like to see? "))
					print(
					    ", ".join(
					        json.dumps(movie, indent=4) for movie in get_imdb_top_movies(num_movies)
					    )
					)



