






"""simple docstring"""




import os
import sys
import time

from . import transposition_cipher as trans_cipher

def     lowerCAmelCase__  (  ):



  '''simple docstring'''
  _a						: str    =			"""Prehistoric Men.txt"""
  _a						: Optional[Any]    =			"""Output.txt"""
  _a						: Union[str, Any]    =			int(input("""Enter key: """       )       )
  _a						: Optional[Any]    =			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]"""       )
    _a						: Dict    =			input("""> """       )
    if not response.lower().startswith("""y"""       ):
      sys.exit()

  _a						: Optional[Any]    =			time.time()
  if mode.lower().startswith("""e"""       ):
    with open(UpperCamelCase__       ) as f:
      _a						: Tuple    =			f.read()
    _a						: Tuple    =			trans_cipher.encrypt_message(UpperCamelCase__  ,     UpperCamelCase__       )
  elif mode.lower().startswith("""d"""       ):
    with open(UpperCamelCase__       ) as f:
      _a						: int    =			f.read()
    _a						: Tuple    =			trans_cipher.decrypt_message(UpperCamelCase__  ,     UpperCamelCase__       )

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

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


if __name__ == "__main__":
 main()









"""simple docstring"""




# this script builds a small sample spm file tests/fixtures/test_sentencepiece_no_bos.model, with features needed by pegasus

# 1. pip install sentencepiece
#
# 2. wget https://raw.githubusercontent.com/google/sentencepiece/master/data/botchan.txt

# 3. build
import sentencepiece as spm

# pegasus:
# 1. no bos
# 2. eos_id is 1
# 3. unk_id is 2
# build a sample spm file accordingly
spm.SentencePieceTrainer.train(
    '--input=botchan.txt --model_prefix=test_sentencepiece_no_bos --bos_id=-1 --unk_id=2  --eos_id=1  --vocab_size=1000'
)

# 4. now update the fixture
# mv test_sentencepiece_no_bos.model ../../tests/fixtures/

