





from collections.abc import Callable


def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase						,	_UpperCAmelCase						,	_UpperCAmelCase )			->     float:
    lowerCamelCase__    :      float					 =		a
    lowerCamelCase__    :      float					 =		b
    if function(_UpperCAmelCase ) == 0:  # one of the a or b is a root for the function
        return a
    elif function(_UpperCAmelCase ) == 0:
        return b
    elif (
        function(_UpperCAmelCase ) * function(_UpperCAmelCase ) > 0
    ):  # if none of these are root and they are both positive or negative,
        # then this algorithm can't find the root
        raise ValueError('could not find root in given interval.' )
    else:
        lowerCamelCase__    :      float					 =		start + (end - start) / 2.0
        while abs(start - mid ) > 10**-7:  # until precisely equals to 10^-7
            if function(_UpperCAmelCase ) == 0:
                return mid
            elif function(_UpperCAmelCase ) * function(_UpperCAmelCase ) < 0:
                lowerCamelCase__    :      Optional[int]					 =		mid
            else:
                lowerCamelCase__    :      Optional[Any]					 =		mid
            lowerCamelCase__    :      Any					 =		start + (end - start) / 2.0
        return mid


def        SCREAMING_SNAKE_CASE      (       _UpperCAmelCase )			->     float:
    return x**3 - 2 * x - 5


if __name__ == "__main__":
    print(bisection(f, 1, 10_00))

    import doctest

    doctest.testmod()









UpperCAmelCase__   	=							{
    '''A''': '''.-''', '''B''': '''-...''', '''C''': '''-.-.''', '''D''': '''-..''', '''E''': '''.''', '''F''': '''..-.''', '''G''': '''--.''',
    '''H''': '''....''', '''I''': '''..''', '''J''': '''.---''', '''K''': '''-.-''', '''L''': '''.-..''', '''M''': '''--''', '''N''': '''-.''',
    '''O''': '''---''', '''P''': '''.--.''', '''Q''': '''--.-''', '''R''': '''.-.''', '''S''': '''...''', '''T''': '''-''', '''U''': '''..-''',
    '''V''': '''...-''', '''W''': '''.--''', '''X''': '''-..-''', '''Y''': '''-.--''', '''Z''': '''--..''', '''1''': '''.----''',
    '''2''': '''..---''', '''3''': '''...--''', '''4''': '''....-''', '''5''': '''.....''', '''6''': '''-....''', '''7''': '''--...''',
    '''8''': '''---..''', '''9''': '''----.''', '''0''': '''-----''', '''&''': '''.-...''', '''@''': '''.--.-.''',
    ''':''': '''---...''', ''',''': '''--..--''', '''.''': '''.-.-.-''', '''\'''': '''.----.''', '''"''': '''.-..-.''',
    '''?''': '''..--..''', '''/''': '''-..-.''', '''=''': '''-...-''', '''+''': '''.-.-.''', '''-''': '''-....-''',
    '''(''': '''-.--.''', ''')''': '''-.--.-''', '''!''': '''-.-.--''', ''' ''': '''/'''
}  # Exclamation mark is not in ITU-R recommendation
# fmt: on
UpperCAmelCase__   	=							{value: key for key, value in MORSE_CODE_DICT.items()}
def 				UpperCAmelCase_					(							__snake_case						)     ->			str:







 """simple docstring"""


 return " ".join(MORSE_CODE_DICT[char] for char in message.upper()						)
def 				UpperCAmelCase_					(							__snake_case						)     ->			str:







 """simple docstring"""


 return "".join(REVERSE_DICT[char] for char in message.split()						)
def 				UpperCAmelCase_					(							)     ->			None:







 """simple docstring"""


 _lowercase							      ='''Morse code here!'''
 print(__snake_case						)
 _lowercase							      =encrypt(__snake_case						)
 print(__snake_case						)
 _lowercase							      =decrypt(__snake_case						)
 print(__snake_case						)


if __name__ == "__main__":
  main()

