





import os
import sys
import time

from . import transposition_cipher as trans_cipher


def 				SCREAMING_SNAKE_CASE__    (     ):
	snake_case_		:      Optional[int]           =						'Prehistoric Men.txt'
	snake_case_		:      List[Any]           =						'Output.txt'
	snake_case_		:      Optional[Any]           =						int(input('Enter key: ' ) )
	snake_case_		:      Union[str, Any]           =						input('Encrypt/Decrypt [e/d]: ' )

	if not os.path.exists(__a ):
		print(f"""File {input_file} does not exist. Quitting...""" )
		sys.exit()
	if os.path.exists(__a ):
		print(f"""Overwrite {output_file}? [y/n]""" )
		snake_case_		:      Union[str, Any]           =						input('> ' )
		if not response.lower().startswith('y' ):
			sys.exit()

	snake_case_		:      int           =						time.time()
	if mode.lower().startswith('e' ):
		with open(__a ) as f:
			snake_case_		:      List[str]           =						f.read()
		snake_case_		:      List[str]           =						trans_cipher.encrypt_message(__a ,			__a )
	elif mode.lower().startswith('d' ):
		with open(__a ) as f:
			snake_case_		:      List[Any]           =						f.read()
		snake_case_		:      Optional[int]           =						trans_cipher.decrypt_message(__a ,			__a )

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

	snake_case_		:      Any           =						round(time.time() - start_time ,			2 )
	print(('Done (', total_time, 'seconds )') )


if __name__ == "__main__":
						main()








import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock, patch

import diffusers.utils.hub_utils
class SCREAMING_SNAKE_CASE_    (       unittest.TestCase       ):






						@patch('diffusers.utils.hub_utils.get_full_repo_name'						)
						def UpperCAmelCase_					(   self   :   Optional[int]		, _A   :   Mock						)				->     None:







							"""simple docstring"""


							snake_case_		:      Optional[Any]           =						'full_repo_name'
							with TemporaryDirectory() as tmpdir:
								# Dummy args values
								snake_case_		:      Optional[int]           =						Mock()
								snake_case_		:      Union[str, Any]           =						tmpdir
								snake_case_		:      Optional[Any]           =						0
								snake_case_		:      Union[str, Any]           =						'hub_token'
								snake_case_		:      Any           =						'dataset_name'
								snake_case_		:      Tuple           =						0.0_1
								snake_case_		:      Dict           =						100000
								snake_case_		:      Any           =						10000
								snake_case_		:      str           =						0.0_1
								snake_case_		:      Any           =						0.0_2
								snake_case_		:      Optional[Any]           =						0.0_3
								snake_case_		:      Tuple           =						0.0_0_0_5
								snake_case_		:      Tuple           =						0.0_0_0_0_0_1
								snake_case_		:      str           =						1
								snake_case_		:      Optional[int]           =						10
								snake_case_		:      List[str]           =						0.0_0_1
								snake_case_		:      Any           =						0.1
								snake_case_		:      List[str]           =						0.2
								snake_case_		:      Dict           =						True

								# Model card mush be rendered and saved
								diffusers.utils.hub_utils.create_model_card(_A		, model_name='model_name'						)
								self.assertTrue((Path(_A						) / 'README.md').is_file()						)

