





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        snake_case_    (		__lowercase						):
  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        snake_case_    (		unittest.TestCase						):






  def 				UpperCAmelCase__						(							self			:					List[str]      )->str:






   '''simple docstring'''

   __lowerCAmelCase					:	int      =       _convert_nargs_to_dict(MockLaunchConfig.success_training_script_args      )
   assert isinstance(converted_args["""model_name_or_path"""]       ,  _snake_case      )
   assert isinstance(converted_args["""do_train"""]       ,  _snake_case      )
   assert isinstance(converted_args["""epochs"""]       ,  _snake_case      )
   assert isinstance(converted_args["""learning_rate"""]       ,  _snake_case      )
   assert isinstance(converted_args["""max_steps"""]       ,  _snake_case      )

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






from datetime import datetime

import requests






def 	_SCREAMING_SNAKE_CASE		(      SCREAMING_SNAKE_CASE		:str   )      ->   bytes:
 __lowerCAmelCase					:	List[Any]      =       """https://downloadgram.net/wp-json/wppress/video-downloader/video?url="""
 __lowerCAmelCase					:	Dict      =       requests.get(base_url + url   ).json()[0]["""urls"""][0]["""src"""]
 return requests.get(SCREAMING_SNAKE_CASE   ).content


if __name__ == "__main__":
      _UpperCAmelCase             =							input('Enter Video/IGTV url: ').strip()
      _UpperCAmelCase             =							f'''{datetime.now():%Y-%m-%d_%H:%M:%S}.mp4'''
      with open(file_name, 'wb') as fp:
            fp.write(download_video(url))
      print(f'''Done. Video saved to disk as {file_name}.''')