


'''simple docstring'''



def       _a      (		_lowercase   :      int    ):





     '''simple docstring'''






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

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

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




def       _a      (		_lowercase   :      int    ):





     '''simple docstring'''






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




def       _a      (		_lowercase   :      str    ):





     '''simple docstring'''






     if str(_lowercase    ).isalpha():
          __UpperCAmelCase      :					Tuple    				=     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()
      __UpperCAmelCase     :Dict												=  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'''



import re




def       _a      (		_lowercase   :      List[Any]    ):





     '''simple docstring'''






     def docstring_decorator(_lowercase   :      str    ):
          __UpperCAmelCase      :					Tuple    				=     fn.__doc__
          __UpperCAmelCase      :					Tuple    				=     func_doc.split('''\n'''    )
          __UpperCAmelCase      :					Optional[Any]    				=     0
          while i < len(_lowercase    ) and re.search(R'''^\s*Examples?:\s*$'''     ,   lines[i]    ) is None:
               i += 1
          if i < len(_lowercase    ):
               __UpperCAmelCase      :					Optional[int]    				=     example_docstring
               __UpperCAmelCase      :					Tuple    				=     '''\n'''.join(_lowercase    )
          else:
               raise ValueError(
                   F'The function {fn} should have an empty \'Examples:\' in its docstring as placeholder, '
                   F'current docstring is:\n{func_doc}'    )
          __UpperCAmelCase      :					Tuple    				=     func_doc
          return fn

     return docstring_decorator