






"""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_huggingface_suite,
    require_multi_gpu,
    require_single_gpu,
)
from accelerate.utils import patch_environment







@require_huggingface_suite
class      UpperCamelCase_			(unittest.TestCase	):





	def 	_SCREAMING_SNAKE_CASE ( self   :					int		)		->     int:
				UpperCAmelCase_	:					List[Any]     	=   inspect.getfile(accelerate.test_utils		)
				UpperCAmelCase_	:					int     	=   os.path.sep.join(
				    mod_file.split(os.path.sep		)[:-1] + ["scripts", "external_deps", "test_metrics.py"]		)

				from accelerate.test_utils.scripts.external_deps import test_metrics  # noqa: F401

				UpperCAmelCase_	:					List[Any]     	=   test_metrics





	@require_cpu
	def 	_SCREAMING_SNAKE_CASE ( self   :					Union[str, Any]		)		->     Union[str, Any]:
				debug_launcher(self.test_metrics.main      ,      num_processes=1		)





	@require_cpu
	def 	_SCREAMING_SNAKE_CASE ( self   :					Any		)		->     str:
				debug_launcher(self.test_metrics.main		)





	@require_single_gpu
	def 	_SCREAMING_SNAKE_CASE ( self   :					Union[str, Any]		)		->     List[Any]:
				self.test_metrics.main()





	@require_multi_gpu
	def 	_SCREAMING_SNAKE_CASE ( self   :					List[Any]		)		->     Optional[int]:
				print(f"""Found {torch.cuda.device_count()} devices."""		)
				UpperCAmelCase_	:					List[str]     	=   ["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()		)






import os





def 	__a     (      ):
    SCREAMING_SNAKE_CASE										=   os.path.join(os.path.dirname(A__       )			,  "num.txt"       )
    with open(A__       ) as file_hand:
        return str(sum(int(A__       ) for line in file_hand       )       )[:10]


if __name__ == "__main__":
    print(solution())