
"""simple docstring"""




import unittest

from transformers.testing_utils import CaptureStdout
from transformers.tools.python_interpreter import evaluate

def lowercase_						(     _snake_case		):
							return x + 2



class 			lowerCAmelCase_		(unittest.TestCase						):


				"""simple docstring"""



				def 			__magic_name__					(self					)      ->	Dict:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: List[str]     =     """x = 3"""
											SCREAMING_SNAKE_CASE__		: Optional[Any]     =     {}
											SCREAMING_SNAKE_CASE__		: Optional[int]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 3
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3}					)

											SCREAMING_SNAKE_CASE__		: List[Any]     =     """x = y"""
											SCREAMING_SNAKE_CASE__		: int     =     {"""y""": 5}
											SCREAMING_SNAKE_CASE__		: List[str]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											# evaluate returns the value of the last assignment.
											assert result == 5
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 5, """y""": 5}					)



				def 			__magic_name__					(self					)      ->	int:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: Optional[Any]     =     """y = add_two(x)"""
											SCREAMING_SNAKE_CASE__		: List[str]     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: List[Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {"""add_two""": add_two}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 5
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """y""": 5}					)

											# Won't work without the tool
											with CaptureStdout() as out:
																		SCREAMING_SNAKE_CASE__		: List[str]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											assert result is None
											assert "tried to execute add_two" in out.out



				def 			__magic_name__					(self					)      ->	Optional[int]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: int     =     """x = 3"""
											SCREAMING_SNAKE_CASE__		: List[str]     =     {}
											SCREAMING_SNAKE_CASE__		: List[Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 3
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3}					)



				def 			__magic_name__					(self					)      ->	List[Any]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: List[str]     =     """test_dict = {\'x\': x, \'y\': add_two(x)}"""
											SCREAMING_SNAKE_CASE__		: List[Any]     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {"""add_two""": add_two}     , state=SCREAMING_SNAKE_CASE__					)
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """y""": 5}					)
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """test_dict""": {"""x""": 3, """y""": 5}}					)



				def 			__magic_name__					(self					)      ->	Optional[Any]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: Dict     =     """x = 3\ny = 5"""
											SCREAMING_SNAKE_CASE__		: List[Any]     =     {}
											SCREAMING_SNAKE_CASE__		: List[Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											# evaluate returns the value of the last assignment.
											assert result == 5
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """y""": 5}					)



				def 			__magic_name__					(self					)      ->	Optional[Any]:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: Optional[int]     =     """text = f\'This is x: {x}.\'"""
											SCREAMING_SNAKE_CASE__		: Dict     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: str     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											# evaluate returns the value of the last assignment.
											assert result == "This is x: 3."
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """text""": """This is x: 3."""}					)



				def 			__magic_name__					(self					)      ->	Dict:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     """if x <= 3:\n    y = 2\nelse:\n    y = 5"""
											SCREAMING_SNAKE_CASE__		: Any     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											# evaluate returns the value of the last assignment.
											assert result == 2
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """y""": 2}					)

											SCREAMING_SNAKE_CASE__		: Union[str, Any]     =     {"""x""": 8}
											SCREAMING_SNAKE_CASE__		: str     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											# evaluate returns the value of the last assignment.
											assert result == 5
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 8, """y""": 5}					)



				def 			__magic_name__					(self					)      ->	int:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: List[str]     =     """test_list = [x, add_two(x)]"""
											SCREAMING_SNAKE_CASE__		: int     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: List[Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {"""add_two""": add_two}     , state=SCREAMING_SNAKE_CASE__					)
											self.assertListEqual(SCREAMING_SNAKE_CASE__     , [3, 5]					)
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """test_list""": [3, 5]}					)



				def 			__magic_name__					(self					)      ->	Dict:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: List[Any]     =     """y = x"""
											SCREAMING_SNAKE_CASE__		: Optional[int]     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: Optional[Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 3
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """y""": 3}					)



				def 			__magic_name__					(self					)      ->	Tuple:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: List[str]     =     """test_list = [x, add_two(x)]\ntest_list[1]"""
											SCREAMING_SNAKE_CASE__		: List[Any]     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: Any     =     evaluate(SCREAMING_SNAKE_CASE__     , {"""add_two""": add_two}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 5
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """test_list""": [3, 5]}					)

											SCREAMING_SNAKE_CASE__		: Optional[int]     =     """test_dict = {\'x\': x, \'y\': add_two(x)}\ntest_dict[\'y\']"""
											SCREAMING_SNAKE_CASE__		: Dict     =     {"""x""": 3}
											SCREAMING_SNAKE_CASE__		: List[Any]     =     evaluate(SCREAMING_SNAKE_CASE__     , {"""add_two""": add_two}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 5
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 3, """test_dict""": {"""x""": 3, """y""": 5}}					)



				def 			__magic_name__					(self					)      ->	int:



											"""simple docstring"""




											SCREAMING_SNAKE_CASE__		: int     =     """x = 0\nfor i in range(3):\n    x = i"""
											SCREAMING_SNAKE_CASE__		: List[str]     =     {}
											SCREAMING_SNAKE_CASE__		: Optional[int]     =     evaluate(SCREAMING_SNAKE_CASE__     , {"""range""": range}     , state=SCREAMING_SNAKE_CASE__					)
											assert result == 2
											self.assertDictEqual(SCREAMING_SNAKE_CASE__     , {"""x""": 2, """i""": 2}					)






"""simple docstring"""




def lowercase_						(     _snake_case		):
							if divisor % 5 == 0 or divisor % 2 == 0:
														return 0
							SCREAMING_SNAKE_CASE__		: List[str]     =     1
							SCREAMING_SNAKE_CASE__		: List[Any]     =     1
							while repunit:
														SCREAMING_SNAKE_CASE__		: Dict     =     (10 * repunit + 1) % divisor
														repunit_index += 1
							return repunit_index

def lowercase_						(     _snake_case = 1_000_000		):
							SCREAMING_SNAKE_CASE__		: int     =     limit - 1
							if divisor % 2 == 0:
														divisor += 1
							while least_divisible_repunit(_snake_case		) <= limit:
														divisor += 2
							return divisor


if __name__ == "__main__":
					print(f"""{solution() = }""")




