






import os
import sys
import time

from . import transposition_cipher as trans_cipher

def        _lowerCamelCase		(  ) ->   None:
    _UpperCAmelCase			: Tuple     					=			'''Prehistoric Men.txt'''
    _UpperCAmelCase			: List[str]     					=			'''Output.txt'''
    _UpperCAmelCase			: Optional[Any]     					=			int(input('''Enter key: '''	)	)
    _UpperCAmelCase			: 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]'''	)
        _UpperCAmelCase			: Dict     					=			input('''> '''	)
        if not response.lower().startswith('''y'''	):
            sys.exit()

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

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

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


if __name__ == "__main__":
  main()












def        _lowerCamelCase		(  __A      :							dict						,						__A      :							int	) ->   str:
    if not root or root not in binary_tree_mirror_dictionary:
        return
    _UpperCAmelCase					,	_UpperCAmelCase			: int     					=			binary_tree_mirror_dictionary[root][:2]
    _UpperCAmelCase			: int     					=			[right_child, left_child]
    binary_tree_mirror_dict(__A						,						__A	)
    binary_tree_mirror_dict(__A						,						__A	)

def        _lowerCamelCase		(  __A      :							dict						,						__A      :							int = 1	) ->   dict:
    if not binary_tree:
        raise ValueError('''binary tree cannot be empty'''	)
    if root not in binary_tree:
        _UpperCAmelCase			: Dict     					=			f'''root {root} is not present in the binary_tree'''
        raise ValueError(__A	)
    _UpperCAmelCase			: int     					=			dict(__A	)
    binary_tree_mirror_dict(__A						,						__A	)
    return binary_tree_mirror_dictionary


if __name__ == "__main__":
  SCREAMING_SNAKE_CASE								=  {1: [2, 3], 2: [4, 5], 3: [6, 7], 7: [8, 9]}
  print(F'Binary tree: {binary_tree}')
  SCREAMING_SNAKE_CASE								=  binary_tree_mirror(binary_tree, 5)
  print(F'Binary tree mirror: {binary_tree_mirror_dictionary}')




