





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






				def 			snake_case_    (  self					):

										"""simple docstring"""




										__SCREAMING_SNAKE_CASE:				Tuple           =   torch.nn.Linear(10			, 10					)
										__SCREAMING_SNAKE_CASE:				Dict           =   torch.optim.SGD(model.parameters()			, 0.1					)
										__SCREAMING_SNAKE_CASE:				Optional[Any]           =   Accelerator()
										__SCREAMING_SNAKE_CASE:				int           =   accelerator.prepare(__lowercase					)
										try:
																pickle.loads(pickle.dumps(__lowercase					)					)
										except Exception as e:
																self.fail(f"""Accelerated optimizer pickling failed with {e}"""					)
										AcceleratorState._reset_state()







'''simple docstring'''
from math import ceil


def       _lowercase							(					UpperCamelCase__							:       int = 1001      ):
 __A	:		int	  =      1

 for i in range(1,					int(ceil(n / 2.0      )      )      ):
  __A	:		Any	  =      2 * i + 1
  __A	:		List[str]	  =      2 * i
  __A	:		str	  =      total + 4 * odd**2 - 6 * even

 return total


if __name__ == "__main__":
 import sys

 if len(sys.argv) == 1:
  print(solution())
 else:
  try:
   UpperCAmelCase_			:  int										=   int(sys.argv[1])
   print(solution(n))
  except ValueError:
   print('Invalid entry - please enter a number')






