
"""simple docstring"""





import pickle
import unittest

import torch

from accelerate import Accelerator
from accelerate.state import AcceleratorState
from accelerate.test_utils import require_cpu
@require_cpu
class 		SCREAMING_SNAKE_CASE_					(		unittest.TestCase					):




		"""simple docstring"""





		def       snake_case_	(	self):
				__SCREAMING_SNAKE_CASE				=					torch.nn.Linear(1_0				,    1_0)
				__SCREAMING_SNAKE_CASE				=					torch.optim.SGD(model.parameters()				,    0.1)
				__SCREAMING_SNAKE_CASE				=					Accelerator()
				__SCREAMING_SNAKE_CASE				=					accelerator.prepare(lowerCAmelCase_)
				try:
						pickle.loads(pickle.dumps(lowerCAmelCase_))
				except Exception as e:
						self.fail(f"Accelerated optimizer pickling failed with {e}")
				AcceleratorState._reset_state()












"""simple docstring"""
from __future__ import annotations

from collections.abc import Generator





def 				lowercase__		(					):
				_SCREAMING_SNAKE_CASE   :		dict[int, int]       		=    {}
				_SCREAMING_SNAKE_CASE   :		List[Any]       		=    2
				while True:
								_SCREAMING_SNAKE_CASE   :		List[Any]       		=    factor_map.pop(lowerCamelCase,						lowerCamelCase       )
								if factor:
												_SCREAMING_SNAKE_CASE   :		str       		=    factor + prime
												while x in factor_map:
																x += factor
												_SCREAMING_SNAKE_CASE   :		Union[str, Any]       		=    factor
								else:
												_SCREAMING_SNAKE_CASE   :		Optional[int]       		=    prime
												yield prime
								prime += 1





def 				lowercase__		(					lowerCamelCase = 1E10       ):
				_SCREAMING_SNAKE_CASE   :		Dict       		=    sieve()

				_SCREAMING_SNAKE_CASE   :		Dict       		=    1
				while True:
								_SCREAMING_SNAKE_CASE   :		int       		=    next(lowerCamelCase       )
								if (2 * prime * n) > limit:
												return n
								# Ignore the next prime as the reminder will be 2.
								next(lowerCamelCase       )
								n += 2


if __name__ == "__main__":
			print(solution())

