

from datetime import datetime

import requests
from bsa import BeautifulSoup

if __name__ == "__main__":
	A_ :				Dict						 =    input('Enter image url: ').strip()
	print(f'''Downloading image from {url} ...''')
	A_ :				Any						 =    BeautifulSoup(requests.get(url).content, 'html.parser')
	# The image URL is in the content field of the first meta tag with property og:image
	A_ :				Dict						 =    soup.find('meta', {'property': 'og:image'})['content']
	A_ :				int						 =    requests.get(image_url).content
	A_ :				Dict						 =    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}.''')






class 					_a		:


					'''simple docstring'''






					def __init__(				self    ):
						A__							:					str       =	""""""
						A__							:					Any       =	""""""
						A__							:					List[Any]       =	[]






					def 						__A    (				self					, A__					, A__    ):
						if m == -1:
							return n + 1
						elif n == -1:
							return m + 1
						elif self.dp[m][n] > -1:
							return self.dp[m][n]
						else:
							if self.worda[m] == self.worda[n]:
								A__							:					Optional[Any]       =	self.__min_dist_top_down_dp(m - 1					, n - 1    )
							else:
								A__							:					Union[str, Any]       =	self.__min_dist_top_down_dp(A__					, n - 1    )
								A__							:					Union[str, Any]       =	self.__min_dist_top_down_dp(m - 1					, A__    )
								A__							:					Union[str, Any]       =	self.__min_dist_top_down_dp(m - 1					, n - 1    )
								A__							:					List[Any]       =	1 + min(A__					, A__					, A__    )

							return self.dp[m][n]






					def 						__A    (				self					, A__					, A__    ):
						A__							:					Tuple       =	worda
						A__							:					Dict       =	worda
						A__							:					Optional[Any]       =	[[-1 for _ in range(len(A__    )    )] for _ in range(len(A__    )    )]

						return self.__min_dist_top_down_dp(len(A__    ) - 1					, len(A__    ) - 1    )






					def 						__A    (				self					, A__					, A__    ):
						A__							:					Optional[Any]       =	worda
						A__							:					Dict       =	worda
						A__							:					Union[str, Any]       =	len(A__    )
						A__							:					List[str]       =	len(A__    )
						A__							:					int       =	[[0 for _ in range(n + 1    )] for _ in range(m + 1    )]

						for i in range(m + 1    ):
							for j in range(n + 1    ):
								if i == 0:  # first string is empty
									A__							:					Tuple       =	j
								elif j == 0:  # second string is empty
									A__							:					Dict       =	i
								elif worda[i - 1] == worda[j - 1]:  # last characters are equal
									A__							:					str       =	self.dp[i - 1][j - 1]
								else:
									A__							:					Union[str, Any]       =	self.dp[i][j - 1]
									A__							:					str       =	self.dp[i - 1][j]
									A__							:					Union[str, Any]       =	self.dp[i - 1][j - 1]
									A__							:					Tuple       =	1 + min(A__					, A__					, A__    )
						return self.dp[m][n]


if __name__ == "__main__":
	A_ :				Union[str, Any]						 =    EditDistance()

	print('****************** Testing Edit Distance DP Algorithm ******************')
	print()

	A_ :				int						 =    input('Enter the first string: ').strip()
	A_ :				List[str]						 =    input('Enter the second string: ').strip()

	print()
	print(f'''The minimum edit distance is: {solver.min_dist_top_down(Sa, Sa)}''')
	print(f'''The minimum edit distance is: {solver.min_dist_bottom_up(Sa, Sa)}''')
	print()
	print('*************** End of Testing Edit Distance DP Algorithm ***************')



