


def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


		'''simple docstring'''

		barcode //= 10  # exclude the last digit
		lowerCamelCase			: List[str]   =    False
		lowerCamelCase			: List[str]   =    0

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

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






def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


		'''simple docstring'''

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






def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


		'''simple docstring'''

		if str(SCREAMING_SNAKE_CASE_     ).isalpha():
				lowerCamelCase			: List[Any]   =    f"""Barcode \'{barcode}\' has alphabetic characters."""
				raise ValueError(SCREAMING_SNAKE_CASE_     )
		elif int(SCREAMING_SNAKE_CASE_     ) < 0:
				raise ValueError("The entered barcode has a negative value. Try again."     )
		else:
				return int(SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			_snake_case					=					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,
)


_snake_case					=					{
    '''configuration_rwkv''': ['''RWKV_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''RwkvConfig''', '''RwkvOnnxConfig'''],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _snake_case					=					[
       '''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

   _snake_case					=					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



