


'''simple docstring'''






import unittest

from accelerate import debug_launcher
from accelerate.test_utils import require_cpu, test_ops, test_script






@require_cpu
class    __magic_name__				(						unittest.TestCase							):






       def      lowerCAmelCase						(     self)		->    Tuple:




          '''simple docstring'''
          debug_launcher(test_script.main)






       def      lowerCAmelCase						(     self)		->    Any:




          '''simple docstring'''
          debug_launcher(test_ops.main)





'''simple docstring'''






import argparse


lowercase				='docs/source/_static/js/custom.js'





def lowerCamelCase__     (		__lowerCamelCase			:				List[Any]				):







   '''simple docstring'''




   with open(__lowerCamelCase			,       encoding='utf-8'			,       newline='\n'				) as f:
      _UpperCAmelCase  :  Optional[Any]				       =f.readlines()
   _UpperCAmelCase  :  Dict				       =0

   # First let's put the right version
   while not lines[index].startswith('const stableVersion ='				):
      index += 1
   _UpperCAmelCase  :  Tuple				       =f"const stableVersion = \"v{version}\"\n"

   # Then update the dictionary
   while not lines[index].startswith('const versionMapping = {'				):
      index += 1

   # We go until the end
   while not lines[index].startswith('}'				):
      index += 1
   # We add the new version at the end
   lines[index - 1] += f"    \"v{version}\": \"v{version}\",\n"

   with open(__lowerCamelCase			,       'w'			,       encoding='utf-8'			,       newline='\n'				) as f:
      f.writelines(__lowerCamelCase				)


if __name__ == "__main__":
 lowercase				=argparse.ArgumentParser()
 parser.add_argument('--version', help='Release version.')
 lowercase				=parser.parse_args()
 update_custom_js(args.version)

