




'''simple docstring'''







from __future__ import annotations







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   A__         =    42
   A__         =    list(UpperCAmelCase	)
   A__     , A__         =    _vector[:-1], int(_vector[-1]	)
   A__         =    [int(UpperCAmelCase	) for digit in __vector]

   vector.reverse()
   for i, digit in enumerate(UpperCAmelCase	):
      if i & 1 == 0:
         A__         =    digit * 2
         if doubled > 9:
            doubled -= 9
         check_digit += doubled
      else:
         check_digit += digit

   return check_digit % 10 == 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    assert is_luhn('''79927398713''')
    assert not is_luhn('''79927398714''')








'''simple docstring'''







from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
lowerCAmelCase_    	=							TypeVar('''T''', bound='''Enum''')

@unique
class   _snake_case( UpperCAmelCase			):
 __snake_case:       List[Any]									=				80
 __snake_case:       Optional[int]									=				70
 __snake_case:       Optional[int]									=				60
 __snake_case:       int									=				50
 __snake_case:       Dict									=				40
 __snake_case:       Dict									=				30
 __snake_case:       str									=				20
 __snake_case:       Optional[int]									=				10




@unique
class   _snake_case( UpperCAmelCase			):
 __snake_case:       List[Any]									=				24
 __snake_case:       Union[str, Any]									=				21
 __snake_case:       Dict									=				18
 __snake_case:       List[str]									=				15
 __snake_case:       Union[str, Any]									=				12
 __snake_case:       Tuple									=				9
 __snake_case:       int									=				6
 __snake_case:       Tuple									=				3
 __snake_case:       List[Any]									=				2
 __snake_case:       int									=				1
 __snake_case:       List[str]									=				-1
 __snake_case:       Union[str, Any]									=				-2
 __snake_case:       List[str]									=				-3
 __snake_case:       Any									=				-6
 __snake_case:       Tuple									=				-9
 __snake_case:       List[str]									=				-12
 __snake_case:       Dict									=				-15
 __snake_case:       Optional[int]									=				-18
 __snake_case:       str									=				-21
 __snake_case:       Any									=				-24






 @classmethod
 def 	_UpperCamelCase   (cls					:     type[T]						)					->      dict:






    """simple docstring"""


    return {unit.name: unit.value for unit in cls if unit.value > 0}






 @classmethod
 def 	_UpperCamelCase   (cls					:     type[T]						)					->      dict:






    """simple docstring"""


    return {unit.name: unit.value for unit in cls if unit.value < 0}







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   A__         =    SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
   for name_prefix, value_prefix in prefixes.items():
      A__         =    value / (10**value_prefix)
      if numerical_part > 1:
         return F"""{numerical_part!s} {name_prefix}"""
   return str(UpperCAmelCase	)







def 	_A			(   UpperCAmelCase	):






   '''simple docstring'''







   for prefix in BinaryUnit:
      A__         =    value / (2**prefix.value)
      if numerical_part > 1:
         return F"""{numerical_part!s} {prefix.name}"""
   return str(UpperCAmelCase	)


if __name__ == "__main__":
    import doctest

    doctest.testmod()


