





"""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     __a   (   self      )	-> int:
								a      :		Tuple	=				inspect.getfile(accelerate.test_utils      )
								a      :		List[Any]	=				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

								a      :		Any	=				test_metrics






							@require_cpu
							def     __a   (   self      )	-> Tuple:
								debug_launcher(self.test_metrics.main      ,					num_processes=1      )






							@require_cpu
							def     __a   (   self      )	-> List[Any]:
								debug_launcher(self.test_metrics.main      )






							@require_single_gpu
							def     __a   (   self      )	-> Optional[int]:
								self.test_metrics.main()






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









"""simple docstring"""




from datetime import datetime

import requests






def       _SCREAMING_SNAKE_CASE		(	_lowercase						:    str					) ->bytes:






	'''simple docstring'''






	a      :		Dict	=				"https://downloadgram.net/wp-json/wppress/video-downloader/video?url="
	a      :		Dict	=				requests.get(base_url + url					).json()[0]["urls"][0]["src"]
	return requests.get(_lowercase					).content


if __name__ == "__main__":
		a						: str     	=			input('''Enter Video/IGTV url: ''').strip()
		a						: Any     	=			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}.''')


