


'''simple docstring'''





import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_multi_gpu,
    require_single_gpu,
    test_sync,
)
from accelerate.utils import patch_environment




class 							UpperCAmelCase ( unittest.TestCase	):


 def 					__SCREAMING_SNAKE_CASE				(			self       :  List[str]   ):
    UpperCAmelCase__  :Optional[int]            =			inspect.getfile(accelerate.test_utils   )
    UpperCAmelCase__  :Union[str, Any]            =			os.path.sep.join(mod_file.split(os.path.sep   )[:-1] + ['''scripts''', '''test_sync.py''']   )


 @require_cpu
 def 					__SCREAMING_SNAKE_CASE				(			self       :  Tuple   ):
    debug_launcher(test_sync.main ,					num_processes=1   )


 @require_cpu
 def 					__SCREAMING_SNAKE_CASE				(			self       :  Optional[int]   ):
    debug_launcher(test_sync.main   )


 @require_single_gpu
 def 					__SCREAMING_SNAKE_CASE				(			self       :  int   ):
    test_sync.main()





 @require_multi_gpu
 def 					__SCREAMING_SNAKE_CASE				(			self       :  Optional[Any]   ):
    print(f'''Found {torch.cuda.device_count()} devices.'''   )
    UpperCAmelCase__  :Tuple            =			['''torchrun''', f'''--nproc_per_node={torch.cuda.device_count()}''', self.test_file_path]
    with patch_environment(omp_num_threads=1   ):
       execute_subprocess_async(__lowerCamelCase ,					env=os.environ.copy()   )





'''simple docstring'''





from scipy.constants import g


def 					a__    (				UpperCamelCase_	:			float,      UpperCamelCase_	:			float	):
   if mass < 0:
      # handling of negative values of mass
      raise ValueError('''The mass of a body cannot be negative'''	)
   if height < 0:
      # handling of negative values of height
      raise ValueError('''The height above the ground cannot be negative'''	)
   return mass * g * height


if __name__ == "__main__":
    from doctest import testmod

    testmod(name='''potential_energy''')



