"""simple docstring"""







import os

import pytest

from transformers.dynamic_module_utils import get_imports


_a					:					List[Any]=			"\nimport os\n"

_a					:					List[str]=			"\ndef foo():\n    import os\n    return False\n"

_a					:					Dict=			"\ndef foo():\n    def bar():\n        if True:\n            import os\n        return False\n    return bar()\n"

_a					:					str=			"\nimport os\n\ntry:\n    import bar\nexcept ImportError:\n    raise ValueError()\n"

_a					:					Any=			"\nimport os\n\ndef foo():\n    try:\n        import bar\n    except ImportError:\n        raise ValueError()\n"

_a					:					int=			"\nimport os\n\ntry:\n    import bar\nexcept (ImportError, AttributeError):\n    raise ValueError()\n"

_a					:					Any=			"\nimport os\n\ntry:\n    import bar\nexcept ImportError as e:\n    raise ValueError()\n"

_a					:					Union[str, Any]=			"\nimport os\n\ntry:\n    import bar\nexcept:\n    raise ValueError()\n"

_a					:					Dict=			"\nimport os\n\ntry:\n    import bar\n    import baz\nexcept ImportError:\n    raise ValueError()\n"

_a					:					List[Any]=			"\nimport os\n\ntry:\n    import bar\n    import baz\nexcept ImportError:\n    x = 1\n    raise ValueError()\n"

_a					:					Optional[Any]=			[
    TOP_LEVEL_IMPORT,
    IMPORT_IN_FUNCTION,
    DEEPLY_NESTED_IMPORT,
    TOP_LEVEL_TRY_IMPORT,
    GENERIC_EXCEPT_IMPORT,
    MULTILINE_TRY_IMPORT,
    MULTILINE_BOTH_IMPORT,
    MULTIPLE_EXCEPTS_IMPORT,
    EXCEPT_AS_IMPORT,
    TRY_IMPORT_IN_FUNCTION,
]
@pytest.mark.parametrize('case'      ,							UpperCAmelCase_  )
def   __UpperCAmelCase    (   UpperCAmelCase_   :    Union[str, Any]      ,							UpperCAmelCase_   :    Optional[Any]  )							->      str:

	'''simple docstring'''





	__snake_case      :							Optional[int]						=			os.path.join(UpperCAmelCase_      ,							'test_file.py'  )
	with open(UpperCAmelCase_      ,							'w'  ) as _tmp_file:
		_tmp_file.write(UpperCAmelCase_  )

	__snake_case      :							int						=			get_imports(UpperCAmelCase_  )
	assert parsed_imports == ["os"]






"""simple docstring"""







from decimal import Decimal, getcontext
from math import ceil, factorial
def   __UpperCAmelCase    (   UpperCAmelCase_   :    int  )							->      str:

	'''simple docstring'''





	if not isinstance(UpperCAmelCase_      ,							UpperCAmelCase_  ):
		raise TypeError('Undefined for non-integers'  )
	elif precision < 1:
		raise ValueError('Undefined for non-natural numbers'  )

	__snake_case      :							Any						=			precision
	__snake_case      :							Optional[int]						=			ceil(precision / 14  )
	__snake_case      :							List[Any]						=			42_68_80 * Decimal(1_00_05  ).sqrt()
	__snake_case      :							Optional[Any]						=			1
	__snake_case      :							Union[str, Any]						=			13_59_14_09
	__snake_case      :							int						=			Decimal(UpperCAmelCase_  )
	for k in range(1      ,							UpperCAmelCase_  ):
		__snake_case      :							Union[str, Any]						=			factorial(6 * k  ) // (factorial(3 * k  ) * factorial(UpperCAmelCase_  ) ** 3)
		linear_term += 5_45_14_01_34
		exponential_term *= -26_25_37_41_26_40_76_80_00
		partial_sum += Decimal(multinomial_term * linear_term  ) / exponential_term
	return str(constant_term / partial_sum  )[:-1]


if __name__ == "__main__":
	_a					:					List[Any]=			50
	print(f'''The first {n} digits of pi is: {pi(n)}''')





