





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


_SCREAMING_SNAKE_CASE							=						re.compile(R"""^(?P<major>\d+)""" R"""\.(?P<minor>\d+)""" R"""\.(?P<patch>\d+)$""")
@total_ordering
@dataclass
class SCREAMING_SNAKE_CASE_  :
						__magic_name__:	str
						__magic_name__:	Optional[str]       					=				None
						__magic_name__:	Optional[Union[str, int]]       					=				None
						__magic_name__:	Optional[Union[str, int]]       					=				None
						__magic_name__:	Optional[Union[str, int]]       					=				None






						def UpperCAmelCase_ (					self					:					Optional[Any]		)							->			Tuple:







							"""simple docstring"""


							snake_case_						:	Optional[Any]      =		_str_to_version_tuple(self.version_str		)






						def __repr__(					self					:					Optional[Any]		)							->			Optional[Any]:







							"""simple docstring"""


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






						@property
						def UpperCAmelCase_ (					self					:					str		)							->			str:







							"""simple docstring"""


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






						def UpperCAmelCase_ (					self					:					List[Any]						,      _A					:					List[Any]		)							->			List[Any]:







							"""simple docstring"""


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






						def __eq__(					self					:					Optional[Any]						,      _A					:					Optional[int]		)							->			Union[str, Any]:







							"""simple docstring"""


							try:
								snake_case_						:	int      =		self._validate_operand(lowerCAmelCase__		)
							except (TypeError, ValueError):
								return False
							else:
								return self.tuple == other.tuple






						def __lt__(					self					:					Tuple						,      _A					:					Union[str, Any]		)							->			int:







							"""simple docstring"""


							snake_case_						:	str      =		self._validate_operand(lowerCAmelCase__		)
							return self.tuple < other.tuple






						def __hash__(					self					:					Any		)							->			List[Any]:







							"""simple docstring"""


							return hash(_version_tuple_to_str(self.tuple		)		)






						@classmethod
						def UpperCAmelCase_ (					cls					:					Any						,      _A					:					Dict		)							->			str:







							"""simple docstring"""


							snake_case_						:	Union[str, 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 UpperCAmelCase_ (					self					:					List[Any]		)							->			str:







							"""simple docstring"""


							return self.version_str


def 							SCREAMING_SNAKE_CASE__  (			__a      ):
	snake_case_						:	List[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 							SCREAMING_SNAKE_CASE__  (			__a      ):
	return ".".join(str(lowercase__      ) for v in version_tuple      )





from ..utils import DummyObject, requires_backends
class        _lowercase      (			metaclass=A__       ):






				'''simple docstring'''



				SCREAMING_SNAKE_CASE__				:			Optional[int]						=		['''keras_nlp''']


				def __init__(       self			:Tuple			,			*lowerCAmelCase__			:Optional[Any]			,			**lowerCAmelCase__			:Dict	)		->			Dict:
										requires_backends(self			,			['''keras_nlp''']	)
