


"""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      lowerCamelCase__   (     unittest.TestCase				):







					"""simple docstring"""


					def lowerCamelCase__							(       self    : List[str]  ):
												'''simple docstring'''






												__UpperCAmelCase   :						List[str]      							=					torch.nn.Linear(10 ,       10  )
												__UpperCAmelCase   :						Tuple      							=					torch.optim.SGD(model.parameters() ,       0.1  )
												__UpperCAmelCase   :						Dict      							=					Accelerator()
												__UpperCAmelCase   :						Dict      							=					accelerator.prepare(UpperCamelCase  )
												try:
																			pickle.loads(pickle.dumps(UpperCamelCase  )  )
												except Exception as e:
																			self.fail(f'''Accelerated optimizer pickling failed with {e}'''  )
												AcceleratorState._reset_state()




"""simple docstring"""






def      lowerCamelCase       (     _UpperCamelCase		:      int = 4_0_0_0_0_0_0							)		->       int:

							'''simple docstring'''



							__UpperCAmelCase   :						int      							=					[0, 1]
							__UpperCAmelCase   :						Optional[Any]      							=					0
							while fib[i] <= n:
														fib.append(fib[i] + fib[i + 1]							)
														if fib[i + 2] > n:
																					break
														i += 1
							__UpperCAmelCase   :						str      							=					0
							for j in range(len(_UpperCamelCase							) - 1							):
														if fib[j] % 2 == 0:
																					total += fib[j]

							return total


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