





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


_UpperCamelCase							=      re.compile(r'^(?P<major>\d+)' r'\.(?P<minor>\d+)' r'\.(?P<patch>\d+)$')
@total_ordering
@dataclass
class 		SCREAMING_SNAKE_CASE_							:
				"""simple docstring"""
				__snake_case   :       Optional[int]	 =		42
				__snake_case   :       List[Any]	 =		None
				__snake_case   :       str	 =		None
				__snake_case   :       Optional[Any]	 =		None
				__snake_case   :       Optional[int]	 =		None




				def 					__lowercase  (     self  :Any			):
											__lowerCamelCase      :      Tuple         =_str_to_version_tuple(self.version_str			)




				def __repr__(     self  :List[str]			):
											return f'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'




				@property
				def 					__lowercase  (     self  :Tuple			):
											return self.major, self.minor, self.patch




				def 					__lowercase  (     self  :Any						,    __lowercase  :Union[str, Any]			):





											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  :Union[str, Any]						,    __lowercase  :Any			):





											try:
																		__lowerCamelCase      :      List[str]         =self._validate_operand(UpperCamelCase__			)
											except (TypeError, ValueError):
																		return False
											else:
																		return self.tuple == other.tuple




				def __lt__(     self  :int						,    __lowercase  :int			):
											__lowerCamelCase      :      List[Any]         =self._validate_operand(UpperCamelCase__			)
											return self.tuple < other.tuple




				def __hash__(     self  :str			):
											return hash(_version_tuple_to_str(self.tuple			)			)




				@classmethod
				def 					__lowercase  (     cls  :Any						,    __lowercase  :Optional[Any]			):
											__lowerCamelCase      :      List[Any]         ={f.name for f in dataclasses.fields(cls			)}
											return cls(**{k: v for k, v in dic.items() if k in field_names}			)




				def 					__lowercase  (     self  :Tuple			):
											return self.version_str



def 				lowerCAmelCase_			(      SCREAMING_SNAKE_CASE       :							Dict   ):


							'''simple docstring'''







							__lowerCamelCase      :      Union[str, Any]         =_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 				lowerCAmelCase_			(      SCREAMING_SNAKE_CASE       :							Tuple   ):


							'''simple docstring'''







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











"""simple docstring"""





def 				lowerCAmelCase_			(      SCREAMING_SNAKE_CASE       :							list    ,						SCREAMING_SNAKE_CASE       :							list    ,						SCREAMING_SNAKE_CASE       :							int   ):


							'''simple docstring'''







							__lowerCamelCase      :      Optional[Any]         =len(SCREAMING_SNAKE_CASE   )
							__lowerCamelCase      :      Union[str, Any]         =[[0] * n for i in range(SCREAMING_SNAKE_CASE   )]
							for i in range(SCREAMING_SNAKE_CASE   ):
														__lowerCamelCase      :      Union[str, Any]         =y_points[i]

							for i in range(2    ,						SCREAMING_SNAKE_CASE   ):
														for j in range(SCREAMING_SNAKE_CASE    ,						SCREAMING_SNAKE_CASE   ):
																					__lowerCamelCase      :      List[Any]         =(
																					    (xa - x_points[j - i + 1]) * q[j][i - 1]
																					    - (xa - x_points[j]) * q[j - 1][i - 1]
																					) / (x_points[j] - x_points[j - i + 1])

							return [q[n - 1][n - 1], q]


if __name__ == "__main__":
							import doctest

							doctest.testmod()




