

'''simple docstring'''
import unittest
from dataclasses import dataclass

import pytest

from accelerate.commands.config.config_args import SageMakerConfig
from accelerate.utils import ComputeEnvironment
from accelerate.utils.launch import _convert_nargs_to_dict







@dataclass
class 							A__   (	A__  ):
  A__					=    ComputeEnvironment.AMAZON_SAGEMAKER
  A__					=    True
  A__					=    'ml.p3.2xlarge'
  A__					=    'accelerate_sagemaker_execution_role'
  A__					=    'hf-sm'
  A__					=    'us-east-1'
  A__					=    1
  A__					=    'accelerate-sagemaker-1'
  A__					=    '1.6'
  A__					=    '4.4'
  A__					=    'train.py'
  A__					=    [
      '--model_name_or_path',
      'bert',
      '--do_train',
      'False',
      '--epochs',
      '3',
      '--learning_rate',
      '5e-5',
      '--max_steps',
      '50.5',
  ]
  A__					=    [
      '--model_name_or_path',
      'bert',
      '--do_train',
      '--do_test',
      'False',
      '--do_predict',
      '--epochs',
      '3',
      '--learning_rate',
      '5e-5',
      '--max_steps',
      '50.5',
  ]







class 							A__   (	unittest.TestCase  ):





  def 						A  (		self				:     int			)     ->   Optional[int]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							   =_convert_nargs_to_dict(MockLaunchConfig.success_training_script_args			)
       assert isinstance(converted_args['model_name_or_path']							, _a			)
       assert isinstance(converted_args['do_train']							, _a			)
       assert isinstance(converted_args['epochs']							, _a			)
       assert isinstance(converted_args['learning_rate']							, _a			)
       assert isinstance(converted_args['max_steps']							, _a			)

       with pytest.raises(_a			):
            _convert_nargs_to_dict(MockLaunchConfig.fail_training_script_args			)



'''simple docstring'''
def 	_lowerCAmelCase (						_UpperCamelCase						:					str    )				->      bool:
     """simple docstring"""




     _SCREAMING_SNAKE_CASE							   =0
     for ch in input_str:
          _SCREAMING_SNAKE_CASE							   =ord(_UpperCamelCase    )
          _SCREAMING_SNAKE_CASE							   =pow(2							,			_UpperCamelCase    )

          # If we already turned on bit for current character's unicode
          if bitmap >> ch_unicode & 1 == 1:
               return False
          bitmap |= ch_bit_index_on
     return True


if __name__ == "__main__":
     import doctest

     doctest.testmod()
