



'''simple docstring'''
from __future__ import annotations

import math

import numpy as np
from numpy.linalg import norm






def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):
						return math.sqrt(sum(pow(a - b  ,  2							) for a, b in zip(UpperCAmelCase_  ,  UpperCAmelCase_							)							)							)






def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):

						if dataset.ndim != value_array.ndim:
												_UpperCamelCase :		List[Any]			    =       (
												    'Wrong input data\'s dimensions... '
												    f'dataset : {dataset.ndim}, value_array : {value_array.ndim}'
												)
												raise ValueError(UpperCAmelCase_							)

						try:
												if dataset.shape[1] != value_array.shape[1]:
																		_UpperCamelCase :		Tuple			    =       (
																		    'Wrong input data\'s shape... '
																		    f'dataset : {dataset.shape[1]}, value_array : {value_array.shape[1]}'
																		)
																		raise ValueError(UpperCAmelCase_							)
						except IndexError:
												if dataset.ndim != value_array.ndim:
																		raise TypeError('Wrong shape'							)

						if dataset.dtype != value_array.dtype:
												_UpperCamelCase :		Tuple			    =       (
												    'Input data have different datatype... '
												    f'dataset : {dataset.dtype}, value_array : {value_array.dtype}'
												)
												raise TypeError(UpperCAmelCase_							)

						_UpperCamelCase :		int			    =       []

						for value in value_array:
												_UpperCamelCase :		Tuple			    =       euclidean(UpperCAmelCase_  ,  dataset[0]							)
												_UpperCamelCase :		List[Any]			    =       dataset[0].tolist()

												for dataset_value in dataset[1:]:
																		_UpperCamelCase :		Optional[Any]			    =       euclidean(UpperCAmelCase_  ,  UpperCAmelCase_							)

																		if dist > temp_dist:
																								_UpperCamelCase :		str			    =       temp_dist
																								_UpperCamelCase :		Tuple			    =       dataset_value.tolist()

												answer.append([vector, dist]							)

						return answer






def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):
						return np.dot(UpperCAmelCase_  ,  UpperCAmelCase_							) / (norm(UpperCAmelCase_							) * norm(UpperCAmelCase_							))


if __name__ == "__main__":
					import doctest

					doctest.testmod()







'''simple docstring'''
from datetime import datetime

import requests






def A__   (					UpperCAmelCase_							):
						_UpperCamelCase :		List[Any]			    =       'https://downloadgram.net/wp-json/wppress/video-downloader/video?url='
						_UpperCamelCase :		Optional[int]			    =       requests.get(base_url + url							).json()[0]['urls'][0]['src']
						return requests.get(UpperCAmelCase_							).content


if __name__ == "__main__":
					snake_case_			:     List[str]  	=  input('Enter Video/IGTV url: ').strip()
					snake_case_			:     str  	=  F"""{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4"""
					with open(file_name, 'wb') as fp:
										fp.write(download_video(url))
					print(F"""Done. Video saved to disk as {file_name}.""")


