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






       def 			_snake_case						(      self      ):
              __UpperCAmelCase  :				Optional[Any]       				=		torch.nn.Linear(10				,     10      )
              __UpperCAmelCase  :				Any       				=		torch.optim.SGD(model.parameters()				,     0.1      )
              __UpperCAmelCase  :				Optional[int]       				=		Accelerator()
              __UpperCAmelCase  :				List[str]       				=		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 _lowercase	(      lowerCamelCase__							,    lowerCamelCase__						)					->       List[str]:





       """simple docstring"""


       __UpperCAmelCase  :				Dict       				=		(boundary[1] - boundary[0]) / steps
       __UpperCAmelCase  :				Tuple       				=		boundary[0]
       __UpperCAmelCase  :				List[str]       				=		boundary[1]
       __UpperCAmelCase  :				List[Any]       				=		make_points(lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__						)
       __UpperCAmelCase  :				int       				=		0.0
       y += (h / 2.0) * f(lowerCamelCase__						)
       for i in x_i:
              # print(i)
              y += h * f(lowerCamelCase__						)
       y += (h / 2.0) * f(lowerCamelCase__						)
       return y

def _lowercase	(      lowerCamelCase__							,    lowerCamelCase__							,    lowerCamelCase__						)					->       List[Any]:





       """simple docstring"""


       __UpperCAmelCase  :				Optional[Any]       				=		a + h
       while x < (b - h):
              yield x
              __UpperCAmelCase  :				List[str]       				=		x + h

def _lowercase	(      lowerCamelCase__						)					->       Optional[Any]:  # enter your function here





       """simple docstring"""


       __UpperCAmelCase  :				str       				=		(x - 0) * (x - 0)
       return y

def _lowercase	(      )					->       int:





       """simple docstring"""


       __UpperCAmelCase  :				Tuple       				=		0.0  # Lower bound of integration
       __UpperCAmelCase  :				Union[str, Any]       				=		1.0  # Upper bound of integration
       __UpperCAmelCase  :				Union[str, Any]       				=		10.0  # define number of steps or resolution
       __UpperCAmelCase  :				Dict       				=		[a, b]  # define boundary of integration
       __UpperCAmelCase  :				Optional[int]       				=		method_a(lowerCamelCase__							,    lowerCamelCase__						)
       print(f"""y = {y}"""						)


if __name__ == "__main__":
   main()






