


from ..utils import requires_backends


__lowerCAmelCase     :			Union[str, Any]      =None
class 	_lowercase				:






				'''simple docstring'''



				def __init__(	self      :List[Any]      ,      *lowerCAmelCase__      :Any      ,      **lowerCAmelCase__      :str     )		->      Optional[Any]:
										requires_backends(self      ,      ['''detectron2''']     )



				@classmethod
				def 		__magic_name__(	cls      :Optional[int]      ,      *lowerCAmelCase__      :Optional[int]      ,      **lowerCAmelCase__      :Tuple     )		->      Union[str, Any]:
										requires_backends(cls      ,      ['''detectron2''']     )




def 	_UpperCamelCase							(				lowercase__				):
						barcode //= 10  # exclude the last digit
						__SCREAMING_SNAKE_CASE						:					Optional[Any]		      =		False
						__SCREAMING_SNAKE_CASE						:					Dict		      =		0

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

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


def 	_UpperCamelCase							(				lowercase__				):
						return len(str(lowercase__				)				) == 13 and get_check_digit(lowercase__				) == barcode % 10


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


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						__lowerCAmelCase     :			Union[str, Any]      =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.""")
