






"""simple docstring"""



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


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






@total_ordering
@dataclass
class 							__SCREAMING_SNAKE_CASE						:
							snake_case_     =							42
							snake_case_     =							None
							snake_case_     =							None
							snake_case_     =							None
							snake_case_     =							None


							def 						_UpperCamelCase       (			self      :						Dict							):
													'''simple docstring'''





													A__						:  List[Any]		  =  _str_to_version_tuple(self.version_str							)


							def __repr__(			self      :						int							):
													'''simple docstring'''





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


							@property
							def 						_UpperCamelCase       (			self      :						List[str]							):
													'''simple docstring'''





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


							def 						_UpperCamelCase       (			self      :						List[Any]			,    snake_case      :						Tuple							):
													'''simple docstring'''





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


							def __eq__(			self      :						List[Any]			,    snake_case      :						Optional[int]							):
													'''simple docstring'''





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


							def __lt__(			self      :						Optional[int]			,    snake_case      :						List[Any]							):
													'''simple docstring'''





													A__						:  Optional[Any]		  =  self._validate_operand(snake_case							)
													return self.tuple < other.tuple


							def __hash__(			self      :						List[str]							):
													'''simple docstring'''





													return hash(_version_tuple_to_str(self.tuple							)							)


							@classmethod
							def 						_UpperCamelCase       (			cls      :						List[Any]			,    snake_case      :						Any							):
													'''simple docstring'''





													A__						:  Optional[int]		  =  {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      :						Any							):
													'''simple docstring'''





													return self.version_str




def      _lowerCAmelCase		(							UpperCAmelCase__       :					List[Any]      )		->List[str]:
						A__						:  Tuple		  =  _VERSION_REG.match(UpperCAmelCase__      )
						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(UpperCAmelCase__      ) for v in [res.group("""major"""      ), res.group("""minor"""      ), res.group("""patch"""      )]      )




def      _lowerCAmelCase		(							UpperCAmelCase__       :					Optional[int]      )		->Union[str, Any]:
						return ".".join(str(UpperCAmelCase__      ) for v in version_tuple      )














"""simple docstring"""



def      _lowerCAmelCase		(							UpperCAmelCase__       :					int,						UpperCAmelCase__       :					int      )		->str:
						if a < 0 or b < 0:
												raise ValueError("""the value of both inputs must be positive"""      )

						A__						:  str		  =  str(bin(UpperCAmelCase__      )      )[2:]  # remove the leading "0b"
						A__						:  List[Any]		  =  str(bin(UpperCAmelCase__      )      )[2:]  # remove the leading "0b"

						A__						:  List[str]		  =  max(len(UpperCAmelCase__      ),						len(UpperCAmelCase__      )      )

						return "0b" + "".join(
						    str(int(char_a == """1""" and char_b == """1"""      )      )
						    for char_a, char_b in zip(a_binary.zfill(UpperCAmelCase__      ),						b_binary.zfill(UpperCAmelCase__      )      )      )


if __name__ == "__main__":
						import doctest

						doctest.testmod()






