

'''simple docstring'''





def  UpperCamelCase_(							_snake_case     :						str			):




			"""simple docstring"""






			__a						   =str(_snake_case			).strip()
			if not oct_string:
						raise ValueError('Empty string was passed to the function'			)
			__a						   =oct_string[0] == '-'
			if is_negative:
						__a						   =oct_string[1:]
			if not oct_string.isdigit() or not all(0 <= int(_snake_case			) <= 7 for char in oct_string			):
						raise ValueError('Non-octal value was passed to the function'			)
			__a						   =0
			for char in oct_string:
						__a						   =8 * decimal_number + int(_snake_case			)
			if is_negative:
						__a						   =-decimal_number
			return decimal_number


if __name__ == "__main__":
						from doctest import testmod

						testmod()









import os
import sys
import time

from . import transposition_cipher as trans_cipher






def  UpperCamelCase_(							):




			"""simple docstring"""






			__a						   ='Prehistoric Men.txt'
			__a						   ='Output.txt'
			__a						   =int(input('Enter key: '			)			)
			__a						   =input('Encrypt/Decrypt [e/d]: '			)

			if not os.path.exists(_snake_case			):
						print(F'File {input_file} does not exist. Quitting...'			)
						sys.exit()
			if os.path.exists(_snake_case			):
						print(F'Overwrite {output_file}? [y/n]'			)
						__a						   =input('> '			)
						if not response.lower().startswith('y'			):
									sys.exit()

			__a						   =time.time()
			if mode.lower().startswith('e'			):
						with open(_snake_case			) as f:
									__a						   =f.read()
						__a						   =trans_cipher.encrypt_message(_snake_case ,  _snake_case			)
			elif mode.lower().startswith('d'			):
						with open(_snake_case			) as f:
									__a						   =f.read()
						__a						   =trans_cipher.decrypt_message(_snake_case ,  _snake_case			)

			with open(_snake_case ,  'w'			) as output_obj:
						output_obj.write(_snake_case			)

			__a						   =round(time.time() - start_time ,  2			)
			print(('Done (', total_time, 'seconds )')			)


if __name__ == "__main__":
						main()






