



"""simple docstring"""




import bsa
import requests



def 				_lowerCAmelCase      (_lowerCAmelCase):
					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 				_lowerCAmelCase      (_lowerCAmelCase = 5):
					UpperCamelCase_											=				int(float(_lowerCAmelCase))
					if num_movies < 1:
										return ()
					UpperCamelCase_											=				(
					    "https://www.imdb.com/search/title?title_type="
					    f"""feature&sort=num_votes,desc&count={num_movies}"""
					)
					UpperCamelCase_											=				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

	UpperCAmelCase				:							Union[str, Any]								=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)
	    )
	)





def 				_lowerCAmelCase      (_lowerCAmelCase				,		_lowerCAmelCase):
					UpperCamelCase_											=				0
					for ele in arr:
										total_sum += product_sum(_lowerCAmelCase				,		depth + 1) if isinstance(_lowerCAmelCase				,		_lowerCAmelCase) else ele
					return total_sum * depth



def 				_lowerCAmelCase      (_lowerCAmelCase):
					return product_sum(_lowerCAmelCase				,		1)


if __name__ == "__main__":
	import doctest

	doctest.testmod()
