



'''simple docstring'''

import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


__lowerCAmelCase									=   re.compile(r'''^(?P<major>\d+)''' r'''\.(?P<minor>\d+)''' r'''\.(?P<patch>\d+)$''')

@total_ordering
@dataclass
class 	__magic_name__						:
							lowerCAmelCase       :    str
							lowerCAmelCase       :    Optional[str]   				=					None
							lowerCAmelCase       :    Optional[Union[str, int]]   				=					None
							lowerCAmelCase       :    Optional[Union[str, int]]   				=					None
							lowerCAmelCase       :    Optional[Union[str, int]]   				=					None







							def 							__lowercase			(							self					:       Any		):
									_a       ,					_a       ,					_a     :      Optional[int]        =							_str_to_version_tuple(self.version_str		)







							def __repr__(							self					:       Optional[Any]		):
									return F"""{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}"""







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







							def 							__lowercase			(							self					:       int	,_UpperCAmelCase					:       int		):



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



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







							def __lt__(							self					:       Optional[int]	,_UpperCAmelCase					:       List[str]		):
									_a     :      Optional[Any]        =							self._validate_operand(__lowerCAmelCase		)
									return self.tuple < other.tuple







							def __hash__(							self					:       Optional[int]		):
									return hash(_version_tuple_to_str(self.tuple		)		)







							@classmethod
							def 							__lowercase			(							cls					:       Any	,_UpperCAmelCase					:       int		):
									_a     :      Tuple        =							{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					:       Optional[Any]		):
									return self.version_str



def      __lowerCamelCase     (      lowerCAmelCase_  )			->      List[Any]:
		_a     :      Union[str, Any]        =							_VERSION_REG.match(lowerCAmelCase__  )
		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(lowerCAmelCase__  ) for v in [res.group('major'  ), res.group('minor'  ), res.group('patch'  )]  )



def      __lowerCamelCase     (      lowerCAmelCase_  )			->      Optional[Any]:
		return ".".join(str(lowerCAmelCase__  ) for v in version_tuple  )





"""simple docstring"""






from ..utils import DummyObject, requires_backends





class  _A						(       metaclass=lowerCAmelCase	):
      snake_case__			:   Optional[int]							  =	['torch', 'torchsde']

      def __init__(						self		,       *__lowerCAmelCase		,       **__lowerCAmelCase						):







            """simple docstring"""



            requires_backends(self		,       ["""torch""", """torchsde"""]						)

      @classmethod
      def 				A__       (						cls		,       *__lowerCAmelCase		,       **__lowerCAmelCase						):







            """simple docstring"""



            requires_backends(cls		,       ["""torch""", """torchsde"""]						)







      @classmethod
      def 				A__       (						cls		,       *__lowerCAmelCase		,       **__lowerCAmelCase						):







            """simple docstring"""



            requires_backends(cls		,       ["""torch""", """torchsde"""]						)



