






"""simple docstring"""





from .stack import Stack







def 	lowerCAmelCase_(			SCREAMING_SNAKE_CASE       )       ->						bool:
    """simple docstring"""

    UpperCamelCase__								=     Stack()
    UpperCamelCase__								=     {'(': ')', '[': ']', '{': '}'}
    for bracket in parentheses:
        if bracket in bracket_pairs:
            stack.push(SCREAMING_SNAKE_CASE       )
        elif bracket in (")", "]", "}"):
            if stack.is_empty() or bracket_pairs[stack.pop()] != bracket:
                return False
    return stack.is_empty()


if __name__ == "__main__":
  from doctest import testmod

  testmod()

  A__       :			Any=						["""((()))""", """((())""", """(()))"""]
  print("""Balanced parentheses demonstration:\n""")
  for example in examples:
    A__       :			Union[str, Any]=						"""""" if balanced_parentheses(example) else """not """
    print(F"""{example} is {not_str}balanced""")












"""simple docstring"""





def 	lowerCAmelCase_(			SCREAMING_SNAKE_CASE       )       ->						int:
    """simple docstring"""

    if not isinstance(SCREAMING_SNAKE_CASE			,						SCREAMING_SNAKE_CASE       ):
        raise ValueError('double_factorial() only accepts integral values'       )
    if num < 0:
        raise ValueError('double_factorial() not defined for negative values'       )
    UpperCamelCase__								=     1
    for i in range(SCREAMING_SNAKE_CASE			,						0			,						-2       ):
        value *= i
    return value


if __name__ == "__main__":
  import doctest

  doctest.testmod()




