




# Lint as: python3
import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


_lowerCamelCase	:		Tuple							       =   re.compile(r"""^(?P<major>\d+)""" r"""\.(?P<minor>\d+)""" r"""\.(?P<patch>\d+)$""")


@total_ordering
@dataclass
class 				UpperCamelCase_    :

    '''simple docstring'''






    UpperCAmelCase__							  =      42
    UpperCAmelCase__							  =      None
    UpperCAmelCase__							  =      None
    UpperCAmelCase__							  =      None
    UpperCAmelCase__							  =      None


    def        SCREAMING_SNAKE_CASE							(			self      :	Any)						->Any:





           '''simple docstring'''

           A__ ,							A__ ,							A__       =    _str_to_version_tuple(self.version_str)


    def __repr__(			self      :	Dict)						->List[str]:





           '''simple docstring'''

           return f"""{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}"""


    @property
    def        SCREAMING_SNAKE_CASE							(			self      :	Optional[int])						->List[str]:





           '''simple docstring'''

           return self.major, self.minor, self.patch


    def        SCREAMING_SNAKE_CASE							(			self      :	Optional[int]					, UpperCAmelCase__      :	Union[str, Any])						->List[Any]:





           '''simple docstring'''

           if isinstance(UpperCAmelCase__					, UpperCAmelCase__):
                  return Version(UpperCAmelCase__)
           elif isinstance(UpperCAmelCase__					, UpperCAmelCase__):
                  return other
           raise TypeError(f"""{other} (type {type(UpperCAmelCase__)}) cannot be compared to version.""")


    def __eq__(			self      :	Tuple					, UpperCAmelCase__      :	int)						->Union[str, Any]:





           '''simple docstring'''

           try:
                  A__       =    self._validate_operand(UpperCAmelCase__)
           except (TypeError, ValueError):
                  return False
           else:
                  return self.tuple == other.tuple


    def __lt__(			self      :	List[Any]					, UpperCAmelCase__      :	Union[str, Any])						->List[str]:





           '''simple docstring'''

           A__       =    self._validate_operand(UpperCAmelCase__)
           return self.tuple < other.tuple


    def __hash__(			self      :	int)						->Any:





           '''simple docstring'''

           return hash(_version_tuple_to_str(self.tuple))


    @classmethod
    def        SCREAMING_SNAKE_CASE							(			cls      :	Optional[int]					, UpperCAmelCase__      :	int)						->List[str]:





           '''simple docstring'''

           A__       =    {f.name for f in dataclasses.fields(cls)}
           return cls(**{k: v for k, v in dic.items() if k in field_names})





    def        SCREAMING_SNAKE_CASE							(			self      :	Dict)						->str:





           '''simple docstring'''

           return self.version_str







def SCREAMING_SNAKE_CASE				(       lowercase_						)   ->       Union[str, Any]:



       """simple docstring"""

       A__       =    _VERSION_REG.match(lowercase_						)
       if not res:
              raise ValueError(f"""Invalid version '{version_str}'. Format should be x.y.z with {{x,y,z}} being digits."""						)
       return tuple(int(lowercase_						) for v in [res.group('''major'''						), res.group('''minor'''						), res.group('''patch'''						)]						)







def SCREAMING_SNAKE_CASE				(       lowercase_						)   ->       Union[str, Any]:



       """simple docstring"""

       return ".".join(str(lowercase_						) for v in version_tuple						)








from __future__ import annotations

import typing
from collections.abc import Iterable

import numpy as np

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







def SCREAMING_SNAKE_CASE				(       lowercase_ ,				lowercase_						)   ->       VectorOut:



       """simple docstring"""

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







def SCREAMING_SNAKE_CASE				(       lowercase_ ,				lowercase_						)   ->       VectorOut:



       """simple docstring"""

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


if __name__ == "__main__":







  def SCREAMING_SNAKE_CASE				(       )   ->       None:



         """simple docstring"""

         from timeit import timeit

         print('''Without Numpy'''						)
         print(
             timeit(
                 '''euclidean_distance_no_np([1, 2, 3], [4, 5, 6])''' ,				number=10_000 ,				globals=globals() ,				)						)
         print('''With Numpy'''						)
         print(
             timeit(
                 '''euclidean_distance([1, 2, 3], [4, 5, 6])''' ,				number=10_000 ,				globals=globals() ,				)						)
  benchmark()


