


'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


lowercase__					  =		{
    "configuration_align": [
        "ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "AlignConfig",
        "AlignTextConfig",
        "AlignVisionConfig",
    ],
    "processing_align": ["AlignProcessor"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowercase__					  =		[
       "ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST",
       "AlignModel",
       "AlignPreTrainedModel",
       "AlignTextModel",
       "AlignVisionModel",
   ]

if TYPE_CHECKING:
   from .configuration_align import (
       ALIGN_PRETRAINED_CONFIG_ARCHIVE_MAP,
       AlignConfig,
       AlignTextConfig,
       AlignVisionConfig,
   )
   from .processing_align import AlignProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_align import (
          ALIGN_PRETRAINED_MODEL_ARCHIVE_LIST,
          AlignModel,
          AlignPreTrainedModel,
          AlignTextModel,
          AlignVisionModel,
      )

else:
   import sys

   lowercase__					  =		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





'''simple docstring'''

import os
import sys
import time

from . import transposition_cipher as trans_cipher






def __UpperCamelCase (      )   ->  None:







     '''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(__lowerCamelCase					):
          print(F"File {input_file} does not exist. Quitting..."					)
          sys.exit()
     if os.path.exists(__lowerCamelCase					):
          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(__lowerCamelCase					) as f:
               _a            =		f.read()
          _a            =		trans_cipher.encrypt_message(__lowerCamelCase   ,	__lowerCamelCase					)
     elif mode.lower().startswith("d"					):
          with open(__lowerCamelCase					) as f:
               _a            =		f.read()
          _a            =		trans_cipher.decrypt_message(__lowerCamelCase   ,	__lowerCamelCase					)

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

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


if __name__ == "__main__":
   main()

