





"""simple docstring"""
import os
import sys
import time

from . import transposition_cipher as trans_cipher

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

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

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

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

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


if __name__ == "__main__":
       main()












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_snake_case				= {"""configuration_dinat""": ["""DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DinatConfig"""]}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= [
      """DINAT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """DinatForImageClassification""",
      """DinatModel""",
      """DinatPreTrainedModel""",
      """DinatBackbone""",
  ]

if TYPE_CHECKING:
  from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_dinat import (
        DINAT_PRETRAINED_MODEL_ARCHIVE_LIST,
        DinatBackbone,
        DinatForImageClassification,
        DinatModel,
        DinatPreTrainedModel,
    )

else:
  import sys

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






