




def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						int:

    """simple docstring"""


    barcode //= 10  # exclude the last digit
    __UpperCamelCase			=    False
    __UpperCamelCase			=    0

    # extract and check each digit
    while barcode != 0:
        __UpperCamelCase			=    1 if checker else 3
        s += mult * (barcode % 10)
        barcode //= 10
        __UpperCamelCase			=    not checker

    return (10 - (s % 10)) % 10




def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						bool:

    """simple docstring"""


    return len(str(_UpperCAmelCase   )   ) == 13 and get_check_digit(_UpperCAmelCase   ) == barcode % 10




def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						int:

    """simple docstring"""


    if str(_UpperCAmelCase   ).isalpha():
        __UpperCamelCase			=    F"Barcode '{barcode}' has alphabetic characters."
        raise ValueError(_UpperCAmelCase   )
    elif int(_UpperCAmelCase   ) < 0:
        raise ValueError('''The entered barcode has a negative value. Try again.'''   )
    else:
        return int(_UpperCAmelCase   )


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 a_ 		=  get_barcode(input("Barcode: ").strip())

 if is_valid(barcode):
  print(f"""'{barcode}' is a valid barcode.""")
 else:
  print(f"""'{barcode}' is NOT a valid barcode.""")













from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCAmelCase__    :      Optional[Any]       					={
    '''configuration_rwkv''': ['''RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RwkvConfig''', '''RwkvOnnxConfig'''],
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__    :      Optional[Any]       					=[
							    '''RWKV_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''RwkvForCausalLM''',
							    '''RwkvModel''',
							    '''RwkvPreTrainedModel''',
							]


if TYPE_CHECKING:
							from .configuration_rwkv import RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP, RwkvConfig, RwkvOnnxConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_rwkv import (
														    RWKV_PRETRAINED_MODEL_ARCHIVE_LIST,
														    RwkvForCausalLM,
														    RwkvModel,
														    RwkvPreTrainedModel,
														)
else:
							import sys

							UpperCAmelCase__    :      int       					=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





