






"""simple docstring"""


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


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


@total_ordering
@dataclass
class 					snake_case		:


   '''simple docstring'''

   A_						:	str
   A_						:	Optional[str]						 = None
   A_						:	Optional[Union[str, int]]						 = None
   A_						:	Optional[Union[str, int]]						 = None
   A_						:	Optional[Union[str, int]]						 = None


   def 				_SCREAMING_SNAKE_CASE				(	self :     List[Any]  ):

     '''simple docstring'''
     __A			,    __A			,    __A									= _str_to_version_tuple(self.version_str  )


   def __repr__(	self :     Any  ):

     '''simple docstring'''
     return f'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'


   @property
   def 				_SCREAMING_SNAKE_CASE				(	self :     Optional[int]  ):

     '''simple docstring'''
     return self.major, self.minor, self.patch


   def 				_SCREAMING_SNAKE_CASE				(	self :     Dict,       _lowerCamelCase :     Optional[int]  ):

     '''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[int],       _lowerCamelCase :     str  ):

     '''simple docstring'''
     try:
       __A									= self._validate_operand(_lowerCamelCase  )
     except (TypeError, ValueError):
       return False
     else:
       return self.tuple == other.tuple


   def __lt__(	self :     int,       _lowerCamelCase :     List[str]  ):

     '''simple docstring'''
     __A									= self._validate_operand(_lowerCamelCase  )
     return self.tuple < other.tuple


   def __hash__(	self :     Any  ):

     '''simple docstring'''
     return hash(_version_tuple_to_str(self.tuple  )  )


   @classmethod
   def 				_SCREAMING_SNAKE_CASE				(	cls :     Union[str, Any],       _lowerCamelCase :     Dict  ):

     '''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 :     Optional[Any]  ):

     '''simple docstring'''
     return self.version_str





def 					lowerCAmelCase				(    __UpperCamelCase ):




  """simple docstring"""







  __A									= _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 ):




  """simple docstring"""







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












"""simple docstring"""


import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
       import ctypes
       import msvcrt  # noqa


       class 					snake_case		(							ctypes.Structure						):


          '''simple docstring'''

          A_						:	List[str]						 = [("size", ctypes.c_int), ("visible", ctypes.c_byte)]



def 					lowerCAmelCase				(    ):




  """simple docstring"""







  if os.name == "nt":
    __A									= CursorInfo()
    __A									= ctypes.windll.kernelaa.GetStdHandle(-1_1 )
    ctypes.windll.kernelaa.GetConsoleCursorInfo(__UpperCamelCase		,       ctypes.byref(__UpperCamelCase ) )
    __A									= False
    ctypes.windll.kernelaa.SetConsoleCursorInfo(__UpperCamelCase		,       ctypes.byref(__UpperCamelCase ) )
  elif os.name == "posix":
    sys.stdout.write('''\033[?25l''' )
    sys.stdout.flush()



def 					lowerCAmelCase				(    ):




  """simple docstring"""







  if os.name == "nt":
    __A									= CursorInfo()
    __A									= ctypes.windll.kernelaa.GetStdHandle(-1_1 )
    ctypes.windll.kernelaa.GetConsoleCursorInfo(__UpperCamelCase		,       ctypes.byref(__UpperCamelCase ) )
    __A									= True
    ctypes.windll.kernelaa.SetConsoleCursorInfo(__UpperCamelCase		,       ctypes.byref(__UpperCamelCase ) )
  elif os.name == "posix":
    sys.stdout.write('''\033[?25h''' )
    sys.stdout.flush()





@contextmanager
def 					lowerCAmelCase				(    ):




  """simple docstring"""







  try:
    hide_cursor()
    yield
  finally:
    show_cursor()




