




import inspect
import os
import sys
import unittest

import accelerate
from accelerate.test_utils import execute_subprocess_async, require_tpu




class   a__			(       unittest.TestCase  ):





						def       __UpperCamelCase     (							self      :	Any)						->       Any:




											"""simple docstring"""







											_lowerCAmelCase:Any									=  inspect.getfile(accelerate.test_utils)
											_lowerCAmelCase:List[str]									=  os.path.sep.join(mod_file.split(os.path.sep)[:-1] + ['''scripts''', '''test_script.py'''])
											_lowerCAmelCase:Optional[int]									=  os.path.sep.join(inspect.getfile(self.__class__).split(os.path.sep)[:-1])







						@require_tpu
						def       __UpperCamelCase     (							self      :	Union[str, Any])						->       int:




											"""simple docstring"""







											_lowerCAmelCase:int									=  F'\n            {self.test_dir}/xla_spawn.py\n            --num_cores 8\n            {self.test_file_path}\n        '.split()
											_lowerCAmelCase:Union[str, Any]									=  [sys.executable] + distributed_args
											execute_subprocess_async(lowerCamelCase__     ,env=os.environ.copy())












"""simple docstring"""






import baseaa





def 							UpperCAmelCase		(		snake_case			:					str    ):
					return baseaa.aaaencode(string.encode('''utf-8'''    )    )





def 							UpperCAmelCase		(		snake_case			:					bytes    ):
					return baseaa.aaadecode(snake_case    ).decode('''utf-8'''    )


if __name__ == "__main__":
				import doctest

				doctest.testmod()






