





"""simple docstring"""





from __future__ import annotations
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->tuple[int, int]:





  """simple docstring"""


  if b == 0:
    return (1, 0)
  ((lowerCAmelCase__)				,							(lowerCAmelCase__))     :Optional[Any]											=				extended_euclid(_SCREAMING_SNAKE_CASE	,  a % b     )
  lowerCAmelCase__     :int											=				a // b
  return (y, x - k * y)
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->int:





  """simple docstring"""


  ((lowerCAmelCase__)				,							(lowerCAmelCase__))     :List[Any]											=				extended_euclid(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :List[str]											=				na * na
  lowerCAmelCase__     :int											=				ra * x * na + ra * y * na
  return (n % m + m) % m
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->int:





  """simple docstring"""


  ((lowerCAmelCase__)				,							(lowerCAmelCase__))     :int											=				extended_euclid(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  if b < 0:
    lowerCAmelCase__     :Tuple											=				(b % n + n) % n
  return b
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->int:





  """simple docstring"""


  lowerCAmelCase__				,							lowerCAmelCase__     :List[str]											=				invert_modulo(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     ), invert_modulo(_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )
  lowerCAmelCase__     :Union[str, Any]											=				na * na
  lowerCAmelCase__     :int											=				ra * x * na + ra * y * na
  return (n % m + m) % m


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

  testmod(name="""chinese_remainder_theorem""", verbose=True)
  testmod(name="""chinese_remainder_theorem2""", verbose=True)
  testmod(name="""invert_modulo""", verbose=True)
  testmod(name="""extended_euclid""", verbose=True)








"""simple docstring"""
from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
			lowerCAmelCase__    						=			input('Enter image url: ').strip()
			print(F'Downloading image from {url} ...')
			lowerCAmelCase__    						=			BeautifulSoup(requests.get(url).content, 'html.parser')
			# The image URL is in the content field of the first meta tag with property og:image
			lowerCAmelCase__    						=			soup.find('meta', {'property': 'og:image'})['content']
			lowerCAmelCase__    						=			requests.get(image_url).content
			lowerCAmelCase__    						=			F'{datetime.now():%Y-%m-%d_%H:%M:%S}.jpg'
			with open(file_name, 'wb') as fp:
						fp.write(image_data)
			print(F'Done. Image saved to disk as {file_name}.')

