


"""simple docstring"""







from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

a__    :							str            =					typing.Union[Iterable[float], Iterable[int], np.ndarray]  # noqa: UP007
a__    :							Union[str, Any]            =					typing.Union[np.floataa, int, float]  # noqa: UP007




def        UpperCAmelCase__	(lowerCAmelCase_  ,						lowerCAmelCase_       ):




					'''simple docstring'''


					return np.sqrt(np.sum((np.asarray(lowerCAmelCase_       ) - np.asarray(lowerCAmelCase_       )) ** 2       )       )




def        UpperCAmelCase__	(lowerCAmelCase_  ,						lowerCAmelCase_       ):




					'''simple docstring'''


					return sum((va - va) ** 2 for va, va in zip(lowerCAmelCase_  ,						lowerCAmelCase_       )       ) ** (1 / 2)


if __name__ == "__main__":




		def        UpperCAmelCase__	():




							'''simple docstring'''


							from timeit import timeit

							print("Without Numpy"       )
							print(
							    timeit(
							        "euclidean_distance_no_np([1, 2, 3], [4, 5, 6])"  ,						number=1_0000  ,						globals=globals()  ,						)       )
							print("With Numpy"       )
							print(
							    timeit(
							        "euclidean_distance([1, 2, 3], [4, 5, 6])"  ,						number=1_0000  ,						globals=globals()  ,						)       )



		benchmark()









"""simple docstring"""







from __future__ import annotations

import requests




def        UpperCAmelCase__	(lowerCAmelCase_       ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE						       =    f"""https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"""
					return requests.get(lowerCAmelCase_       ).json()




def        UpperCAmelCase__	(lowerCAmelCase_ = 10       ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE						       =    "https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
					__SCREAMING_SNAKE_CASE						       =    requests.get(lowerCAmelCase_       ).json()[:max_stories]
					return [get_hackernews_story(lowerCAmelCase_       ) for story_id in story_ids]




def        UpperCAmelCase__	(lowerCAmelCase_ = 10       ):




					'''simple docstring'''


					__SCREAMING_SNAKE_CASE						       =    hackernews_top_stories(lowerCAmelCase_       )
					return "\n".join("* [{title}]({url})".format(**lowerCAmelCase_       ) for story in stories       )


if __name__ == "__main__":
		print(hackernews_top_stories_as_markdown())
