


"""simple docstring"""






def 			A__		(					_UpperCAmelCase    :      int	)							->	int:

	'''simple docstring'''


	barcode //= 10  # exclude the last digit
	snake_case__  :						str		=      False
	snake_case__  :						Optional[Any]		=      0

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

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



def 			A__		(					_UpperCAmelCase    :      int	)							->	bool:

	'''simple docstring'''


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



def 			A__		(					_UpperCAmelCase    :      str	)							->	int:

	'''simple docstring'''


	if str(_UpperCAmelCase	).isalpha():
		snake_case__  :						List[str]		=      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()
					lowercase  		=			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.")







"""simple docstring"""


from ..utils import DummyObject, requires_backends


__A					=			None



def        _lowerCamelCase(*__UpperCamelCase       ,					**__UpperCamelCase			)							->					Tuple:
	requires_backends(__UpperCamelCase       ,					["""sentencepiece""", """tokenizers"""]			)



