

'''simple docstring'''
from __future__ import annotations

from collections.abc import Iterator
from typing import Any






class 		UpperCamelCase_		:





						"""simple docstring"""




						def __init__( self				:					Any	,				_lowerCamelCase				:					Dict  )							->					None:
										__magic_name__	  = data
										__magic_name__	  = None

						def __str__( self				:					Union[str, Any]  )							->					str:
										return f'{self.data}'






class 		UpperCamelCase_		:





						"""simple docstring"""




						def __init__( self				:					List[Any]  )							->					None:
										__magic_name__	  = None
										__magic_name__	  = None
						def __iter__( self				:					Dict  )							->					Iterator[Any]:
										__magic_name__	  = self.front
										while node:
														yield node.data
														__magic_name__	  = node.next
						def __len__( self				:					Dict  )							->					int:
										return len(tuple(iter(self  )  )  )
						def __str__( self				:					int  )							->					str:
										return " <- ".join(str(lowercase_  ) for item in self  )
						def 					__A					( self				:					Union[str, Any]  )							->					bool:
										return len(self  ) == 0
						def 					__A					( self				:					Tuple	,				_lowerCamelCase				:					Optional[Any]  )							->					None:
										__magic_name__	  = Node(lowercase_  )
										if self.is_empty():
														__magic_name__	  = node
										else:
														assert isinstance(self.rear	,				lowercase_  )
														__magic_name__	  = node
														__magic_name__	  = node
						def 					__A					( self				:					Any  )							->					Any:

										if self.is_empty():
														raise IndexError("dequeue from empty queue"  )
										assert isinstance(self.front	,				lowercase_  )
										__magic_name__	  = self.front
										__magic_name__	  = self.front.next
										if self.front is None:
														__magic_name__	  = None
										return node.data

						def 					__A					( self				:					Any  )							->					None:
										__magic_name__	  = None


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

						testmod()







'''simple docstring'''
import os
import sys
import time

from . import transposition_cipher as trans_cipher




def      __snake_case       (       ):
				'''simple docstring'''




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

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

				__magic_name__	  = time.time()
				if mode.lower().startswith("e"						):
								with open(lowerCamelCase_						) as f:
												__magic_name__	  = f.read()
								__magic_name__	  = trans_cipher.encrypt_message(lowerCamelCase_	,  lowerCamelCase_						)
				elif mode.lower().startswith("d"						):
								with open(lowerCamelCase_						) as f:
												__magic_name__	  = f.read()
								__magic_name__	  = trans_cipher.decrypt_message(lowerCamelCase_	,  lowerCamelCase_						)

				with open(lowerCamelCase_	,  "w"						) as output_obj:
								output_obj.write(lowerCamelCase_						)

				__magic_name__	  = round(time.time() - start_time	,  2						)
				print(("Done (", total_time, "seconds )")						)


if __name__ == "__main__":
						main()



