"""simple docstring"""

import os
import sys
import time

from . import transposition_cipher as trans_cipher


def    lowerCAmelCase			():
							"""simple docstring"""


							__UpperCamelCase							='''Prehistoric Men.txt'''
							__UpperCamelCase							='''Output.txt'''
							__UpperCamelCase							=int(input('''Enter key: '''			)			)
							__UpperCamelCase							=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]"""			)
														__UpperCamelCase							=input('''> '''			)
														if not response.lower().startswith('''y'''			):
																					sys.exit()

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

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

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


if __name__ == "__main__":
				main()




"""simple docstring"""

import json

import requests

from .fetch_github_info import AUTHENTICATED_USER_ENDPOINT, fetch_github_info


def    lowerCAmelCase			(__UpperCamelCase							:    Optional[Any]			):
							"""simple docstring"""


							class 		_lowercase :



													"""simple docstring"""




													def __init__(				self							:    int     , UpperCamelCase__							:    Union[str, Any]				)				->				None:
																				'''simple docstring'''



																				assert isinstance(UpperCamelCase__     , (bytes, str)				)
																				__UpperCamelCase							=content





													def   UpperCAmelCase_ (				self							:    Dict				)				->				Any:
																				'''simple docstring'''



																				return json.loads(self.content				)

							def mock_response(*__UpperCamelCase							:    Any							,					**__UpperCamelCase							:    Union[str, Any]			):
														assert args[0] == AUTHENTICATED_USER_ENDPOINT
														assert "Authorization" in kwargs["headers"]
														assert kwargs["headers"]["Authorization"].startswith('''token '''			)
														assert "Accept" in kwargs["headers"]
														return FakeResponse(b'''{"login":"test","id":1}'''			)

							monkeypatch.setattr(__UpperCamelCase							,					'''get'''							,					__UpperCamelCase			)
							__UpperCamelCase							=fetch_github_info('''token'''			)
							assert result["login"] == "test"
							assert result["id"] == 1



