





'''simple docstring'''

from collections.abc import Callable

lowercase_         =			Callable[[float], float]  # type alias for a real -> real function





def lowerCamelCase						(					__lowerCamelCase			:   RealFunc ,	__lowerCamelCase			:   RealFunc ,	__lowerCamelCase			:   int ,	)						->float:
    _SCREAMING_SNAKE_CASE     =      float(__lowerCamelCase   )
    while True:
        try:
            _SCREAMING_SNAKE_CASE     =      prev_guess - function(__lowerCamelCase   ) / derivative(__lowerCamelCase   )
        except ZeroDivisionError:
            raise ZeroDivisionError("""Could not find root"""   ) from None
        if abs(prev_guess - next_guess   ) < 10**-5:
            return next_guess
        _SCREAMING_SNAKE_CASE     =      next_guess





def lowerCamelCase						(					__lowerCamelCase			:   float   )						->float:
    return (x**3) - (2 * x) - 5





def lowerCamelCase						(					__lowerCamelCase			:   float   )						->float:
    return 3 * (x**2) - 2


if __name__ == "__main__":
      print(newton(f, fa, 3))










'''simple docstring'''

import os
import sys
import time

from . import transposition_cipher as trans_cipher





def lowerCamelCase						(					)						->None:
    _SCREAMING_SNAKE_CASE     =      """Prehistoric Men.txt"""
    _SCREAMING_SNAKE_CASE     =      """Output.txt"""
    _SCREAMING_SNAKE_CASE     =      int(input("""Enter key: """   )   )
    _SCREAMING_SNAKE_CASE     =      input("""Encrypt/Decrypt [e/d]: """   )

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

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

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

    _SCREAMING_SNAKE_CASE     =      round(time.time() - start_time ,	2   )
    print(("""Done (""", total_time, """seconds )""")   )


if __name__ == "__main__":
      main()



