


def   _UpperCamelCase				(						lowerCAmelCase_  ,						lowerCAmelCase_  ,						lowerCAmelCase_   )						->List[str]:
   if n == 0:
      return 1

   elif n % 2 == 1:
      return (binary_exponentiation(lowerCAmelCase_  ,						n - 1  ,						lowerCAmelCase_   ) * a) % mod

   else:
      UpperCAmelCase							=     binary_exponentiation(lowerCAmelCase_  ,						n / 2  ,						lowerCAmelCase_   )
      return (b * b) % mod


# a prime number
__a     =			701

__a     =			10_0000_0000
__a     =			10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)







print((a / b) % p == (a * b ** (p - 2)) % p)







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





      def        _lowercase				(		self						:					Any       )    ->   Union[str, Any]:






         """simple docstring"""







         UpperCAmelCase							=     torch.nn.Linear(1_0					,       1_0       )
         UpperCAmelCase							=     torch.optim.SGD(model.parameters()					,       0.1       )
         UpperCAmelCase							=     Accelerator()
         UpperCAmelCase							=     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()



