code: 
  import random
  import sys
  
  from . import cryptomath_module as cryptomath
  
  __lowerCamelCase       :       Tuple				   =			(
      R" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`"
      R"abcdefghijklmnopqrstuvwxyz{|}~"
  )
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_,	snake_case_,	snake_case_	)			->							None:
  				if mode == "encrypt":
  								if key_a == 1:
  												sys.exit(
  												    '''The affine cipher becomes weak when key '''
  												    '''A is set to 1. Choose different key'''	)
  								if key_b == 0:
  												sys.exit(
  												    '''The affine cipher becomes weak when key '''
  												    '''B is set to 0. Choose different key'''	)
  				if key_a < 0 or key_b < 0 or key_b > len(snake_case_	) - 1:
  								sys.exit(
  								    '''Key A must be greater than 0 and key B must '''
  								    f'be between 0 and {len(snake_case_	) - 1}.'	)
  				if cryptomath.gcd(snake_case_,	len(snake_case_	)	) != 1:
  								sys.exit(
  								    f'Key A {key_a} and the symbol set size {len(snake_case_	)} '
  								    '''are not relatively prime. Choose a different key.'''	)
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_,	snake_case_	)			->							str:
  				A__     :							Dict   				=divmod(snake_case_,	len(snake_case_	)	)
  				check_keys(snake_case_,	snake_case_,	'''encrypt'''	)
  				A__     :							Any   				=''''''
  				for symbol in message:
  								if symbol in SYMBOLS:
  												A__     :							Tuple   				=SYMBOLS.find(snake_case_	)
  												cipher_text += SYMBOLS[(sym_index * key_a + key_b) % len(snake_case_	)]
  								else:
  												cipher_text += symbol
  				return cipher_text
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_,	snake_case_	)			->							str:
  				A__     :							Optional[int]   				=divmod(snake_case_,	len(snake_case_	)	)
  				check_keys(snake_case_,	snake_case_,	'''decrypt'''	)
  				A__     :							Tuple   				=''''''
  				A__     :							Tuple   				=cryptomath.find_mod_inverse(snake_case_,	len(snake_case_	)	)
  				for symbol in message:
  								if symbol in SYMBOLS:
  												A__     :							Dict   				=SYMBOLS.find(snake_case_	)
  												plain_text += SYMBOLS[
  												    (sym_index - key_b) * mod_inverse_of_key_a % len(snake_case_	)
  												]
  								else:
  												plain_text += symbol
  				return plain_text
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							)			->							int:
  				while True:
  								A__     :							Optional[int]   				=random.randint(2,	len(snake_case_	)	)
  								A__     :							Union[str, Any]   				=random.randint(2,	len(snake_case_	)	)
  								if cryptomath.gcd(snake_case_,	len(snake_case_	)	) == 1 and key_b % len(snake_case_	) != 0:
  												return key_b * len(snake_case_	) + key_b
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							)			->							None:
  				A__     :							int   				=input('''Enter message: '''	).strip()
  				A__     :							Tuple   				=int(input('''Enter key [2000 - 9000]: '''	).strip()	)
  				A__     :							Optional[int]   				=input('''Encrypt/Decrypt [E/D]: '''	).strip().lower()
  
  				if mode.startswith('''e'''	):
  								A__     :							Union[str, Any]   				='''encrypt'''
  								A__     :							List[Any]   				=encrypt_message(snake_case_,	snake_case_	)
  				elif mode.startswith('''d'''	):
  								A__     :							Dict   				='''decrypt'''
  								A__     :							Optional[int]   				=decrypt_message(snake_case_,	snake_case_	)
  				print(f'\n{mode.title()}ed text: \n{translated}'	)
  
  
  if __name__ == "__main__":
  						import doctest
  
  						doctest.testmod()
  						# main()
  
  
  
  
style_context: 
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				barcode //= 1_0  # exclude the last digit
  				A__     :							List[str]   				=False
  				A__     :							Dict   				=0
  
  				# extract and check each digit
  				while barcode != 0:
  								A__     :							Union[str, Any]   				=1 if checker else 3
  								s += mult * (barcode % 1_0)
  								barcode //= 1_0
  								A__     :							Union[str, Any]   				=not checker
  
  				return (1_0 - (s % 1_0)) % 1_0
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							bool:
  				return len(str(snake_case_	)	) == 1_3 and get_check_digit(snake_case_	) == barcode % 1_0
  
  
  
  def   SCREAMING_SNAKE_CASE__						(							snake_case_	)			->							int:
  				if str(snake_case_	).isalpha():
  								A__     :							Tuple   				=f'Barcode \'{barcode}\' has alphabetic characters.'
  								raise ValueError(snake_case_	)
  				elif int(snake_case_	) < 0:
  								raise ValueError('''The entered barcode has a negative value. Try again.'''	)
  				else:
  								return int(snake_case_	)
  
  
  if __name__ == "__main__":
  						import doctest
  
  						doctest.testmod()
  						__lowerCamelCase       :       List[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.")
  
  
  
  