
'''simple docstring'''

import bsa
import requests







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

   lowerCAmelCase_			:			List[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    (SCREAMING_SNAKE_CASE					)->  int:




      """simple docstring"""

      if number != int(SCREAMING_SNAKE_CASE					):
            raise ValueError('''factorial() only accepts integral values'''					)
      if number < 0:
            raise ValueError('''factorial() not defined for negative values'''					)
      snake_case_       =      1
      for i in range(1					,					number + 1					):
            value *= i
      return value






def        __lowerCAmelCase    (SCREAMING_SNAKE_CASE					)->  int:




      """simple docstring"""

      if not isinstance(SCREAMING_SNAKE_CASE					,					SCREAMING_SNAKE_CASE					):
            raise ValueError('''factorial() only accepts integral values'''					)
      if n < 0:
            raise ValueError('''factorial() not defined for negative values'''					)
      return 1 if n == 0 or n == 1 else n * factorial(n - 1					)


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   UpperCAmelCase			=    int(input("""Enter a positive integer: """).strip() or 0)
   print(f'''factorial{n} is {factorial(n)}''')