
from math import factorial, pi





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase = 30							):

    if not isinstance(__lowerCAmelCase    ,		(int, float)							):
        raise ValueError("maclaurin_sin() requires either an int or float for theta"							)

    if not isinstance(__lowerCAmelCase    ,		__lowerCAmelCase							) or accuracy <= 0:
        raise ValueError("maclaurin_sin() requires a positive int for accuracy"							)

    snake_case__						=				float(__lowerCAmelCase							)
    snake_case__						=				theta // (2 * pi)
    theta -= 2 * div * pi
    return sum(
        (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1							) for r in range(__lowerCAmelCase							)							)





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase = 30							):

    if not isinstance(__lowerCAmelCase    ,		(int, float)							):
        raise ValueError("maclaurin_cos() requires either an int or float for theta"							)

    if not isinstance(__lowerCAmelCase    ,		__lowerCAmelCase							) or accuracy <= 0:
        raise ValueError("maclaurin_cos() requires a positive int for accuracy"							)

    snake_case__						=				float(__lowerCAmelCase							)
    snake_case__						=				theta // (2 * pi)
    theta -= 2 * div * pi
    return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r							) for r in range(__lowerCAmelCase							)							)


if __name__ == "__main__":
     import doctest

     doctest.testmod()

     print(maclaurin_sin(10))
     print(maclaurin_sin(-10))
     print(maclaurin_sin(10, 15))
     print(maclaurin_sin(-10, 15))

     print(maclaurin_cos(5))
     print(maclaurin_cos(-5))
     print(maclaurin_cos(10, 15))
     print(maclaurin_cos(-10, 15))


from __future__ import annotations





def 	SCREAMING_SNAKE_CASE__    (      __lowerCAmelCase    ,		__lowerCAmelCase							):
    snake_case__						,					snake_case__						=				set(__lowerCAmelCase							), [start]

    while stack:
        snake_case__						=				stack.pop()
        explored.add(__lowerCAmelCase							)
        # Differences from BFS:
        # 1) pop last element instead of first one
        # 2) add adjacent elements to stack without exploring them
        for adj in reversed(graph[v]							):
            if adj not in explored:
                stack.append(__lowerCAmelCase							)
    return explored


__magic_name__            =  {
    '''A''': ['''B''', '''C''', '''D'''],
    '''B''': ['''A''', '''D''', '''E'''],
    '''C''': ['''A''', '''F'''],
    '''D''': ['''B''', '''D'''],
    '''E''': ['''B''', '''F'''],
    '''F''': ['''C''', '''E''', '''G'''],
    '''G''': ['''F'''],
}

if __name__ == "__main__":
     import doctest

     doctest.testmod()
     print(depth_first_search(G, '''A'''))



