'''simple docstring'''




import bsa
import requests






def __lowerCAmelCase				(							UpperCamelCase__       )			->					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 __lowerCAmelCase				(							UpperCamelCase__ = 5       )			->					tuple:
    __lowerCamelCase						=						int(float(UpperCamelCase__       )       )
    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(UpperCamelCase__       ).content       ,						'''html.parser'''       )
    return tuple(
        get_movie_data_from_soup(UpperCamelCase__       )
        for movie in source.find_all('''div'''       ,						class_='''lister-item mode-advanced'''       )       )


if __name__ == "__main__":
  import json

  __UpperCAmelCase  							=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)
      )
  )

'''simple docstring'''




from __future__ import annotations






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






def __lowerCAmelCase				(							UpperCamelCase__       ,						UpperCamelCase__       ,						UpperCamelCase__       ,						UpperCamelCase__ = 2       )			->					None:
    ((__lowerCamelCase)			,						(__lowerCamelCase))						=						diophantine(UpperCamelCase__       ,						UpperCamelCase__       ,						UpperCamelCase__       )  # Initial value
    __lowerCamelCase						=						greatest_common_divisor(UpperCamelCase__       ,						UpperCamelCase__       )
    __lowerCamelCase						=						a // d
    __lowerCamelCase						=						b // d

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






def __lowerCAmelCase				(							UpperCamelCase__       ,						UpperCamelCase__       )			->					int:
    if a < b:
        __lowerCamelCase			,						__lowerCamelCase						=						b, a

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

    return b






def __lowerCAmelCase				(							UpperCamelCase__       ,						UpperCamelCase__       )			->					tuple[int, int, int]:
    assert a >= 0 and b >= 0

    if b == 0:
        __lowerCamelCase			,						__lowerCamelCase			,						__lowerCamelCase						=						a, 1, 0
    else:
        ((__lowerCamelCase)			,						(__lowerCamelCase)			,						(__lowerCamelCase))						=						extended_gcd(UpperCamelCase__       ,						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)
