



import unittest

from transformers.testing_utils import CaptureStdout
from transformers.tools.python_interpreter import evaluate

def        __a			(   __lowerCAmelCase   )     ->     Union[str, Any]:
					return x + 2



class 						lowercase    (							unittest.TestCase):
						'''simple docstring'''


						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				'x = 3'
											SCREAMING_SNAKE_CASE							:     Tuple						=				{}
											SCREAMING_SNAKE_CASE							:     Union[str, Any]						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											assert result == 3
											self.assertDictEqual(snake_case       ,	{'x': 3}	)

											SCREAMING_SNAKE_CASE							:     Any						=				'x = y'
											SCREAMING_SNAKE_CASE							:     List[Any]						=				{'y': 5}
											SCREAMING_SNAKE_CASE							:     Tuple						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											# evaluate returns the value of the last assignment.
											assert result == 5
											self.assertDictEqual(snake_case       ,	{'x': 5, 'y': 5}	)







						def       lowerCamelCase_				(  self    :				List[str]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[str]						=				'y = add_two(x)'
											SCREAMING_SNAKE_CASE							:     Dict						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     Tuple						=				evaluate(snake_case       ,	{'add_two': add_two}       ,	state=snake_case	)
											assert result == 5
											self.assertDictEqual(snake_case       ,	{'x': 3, 'y': 5}	)

											# Won't work without the tool
											with CaptureStdout() as out:
																SCREAMING_SNAKE_CASE							:     Dict						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											assert result is None
											assert "tried to execute add_two" in out.out







						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[Any]						=				'x = 3'
											SCREAMING_SNAKE_CASE							:     Any						=				{}
											SCREAMING_SNAKE_CASE							:     Tuple						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											assert result == 3
											self.assertDictEqual(snake_case       ,	{'x': 3}	)







						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[str]						=				'test_dict = {\'x\': x, \'y\': add_two(x)}'
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     int						=				evaluate(snake_case       ,	{'add_two': add_two}       ,	state=snake_case	)
											self.assertDictEqual(snake_case       ,	{'x': 3, 'y': 5}	)
											self.assertDictEqual(snake_case       ,	{'x': 3, 'test_dict': {'x': 3, 'y': 5}}	)







						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				'x = 3\ny = 5'
											SCREAMING_SNAKE_CASE							:     int						=				{}
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											# evaluate returns the value of the last assignment.
											assert result == 5
											self.assertDictEqual(snake_case       ,	{'x': 3, 'y': 5}	)







						def       lowerCamelCase_				(  self    :				Union[str, Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Any						=				'text = f\'This is x: {x}.\''
											SCREAMING_SNAKE_CASE							:     Any						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     Any						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											# evaluate returns the value of the last assignment.
											assert result == "This is x: 3."
											self.assertDictEqual(snake_case       ,	{'x': 3, 'text': 'This is x: 3.'}	)







						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Dict						=				'if x <= 3:\n    y = 2\nelse:\n    y = 5'
											SCREAMING_SNAKE_CASE							:     Dict						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     Dict						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											# evaluate returns the value of the last assignment.
											assert result == 2
											self.assertDictEqual(snake_case       ,	{'x': 3, 'y': 2}	)

											SCREAMING_SNAKE_CASE							:     Dict						=				{'x': 8}
											SCREAMING_SNAKE_CASE							:     Tuple						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											# evaluate returns the value of the last assignment.
											assert result == 5
											self.assertDictEqual(snake_case       ,	{'x': 8, 'y': 5}	)







						def       lowerCamelCase_				(  self    :				Any	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Dict						=				'test_list = [x, add_two(x)]'
											SCREAMING_SNAKE_CASE							:     str						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     Tuple						=				evaluate(snake_case       ,	{'add_two': add_two}       ,	state=snake_case	)
											self.assertListEqual(snake_case       ,	[3, 5]	)
											self.assertDictEqual(snake_case       ,	{'x': 3, 'test_list': [3, 5]}	)







						def       lowerCamelCase_				(  self    :				List[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     List[str]						=				'y = x'
											SCREAMING_SNAKE_CASE							:     Dict						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     Tuple						=				evaluate(snake_case       ,	{}       ,	state=snake_case	)
											assert result == 3
											self.assertDictEqual(snake_case       ,	{'x': 3, 'y': 3}	)







						def       lowerCamelCase_				(  self    :				str	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				'test_list = [x, add_two(x)]\ntest_list[1]'
											SCREAMING_SNAKE_CASE							:     Dict						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     int						=				evaluate(snake_case       ,	{'add_two': add_two}       ,	state=snake_case	)
											assert result == 5
											self.assertDictEqual(snake_case       ,	{'x': 3, 'test_list': [3, 5]}	)

											SCREAMING_SNAKE_CASE							:     str						=				'test_dict = {\'x\': x, \'y\': add_two(x)}\ntest_dict[\'y\']'
											SCREAMING_SNAKE_CASE							:     Optional[int]						=				{'x': 3}
											SCREAMING_SNAKE_CASE							:     str						=				evaluate(snake_case       ,	{'add_two': add_two}       ,	state=snake_case	)
											assert result == 5
											self.assertDictEqual(snake_case       ,	{'x': 3, 'test_dict': {'x': 3, 'y': 5}}	)







						def       lowerCamelCase_				(  self    :				Optional[Any]	):



											'''simple docstring'''


											SCREAMING_SNAKE_CASE							:     int						=				'x = 0\nfor i in range(3):\n    x = i'
											SCREAMING_SNAKE_CASE							:     Optional[Any]						=				{}
											SCREAMING_SNAKE_CASE							:     Any						=				evaluate(snake_case       ,	{'range': range}       ,	state=snake_case	)
											assert result == 2
											self.assertDictEqual(snake_case       ,	{'x': 2, 'i': 2}	)




from datetime import datetime

import requests

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


if __name__ == "__main__":
			_lowerCamelCase    :		List[Any]		      =    input("""Enter Video/IGTV url: """).strip()
			_lowerCamelCase    :		int		      =    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}.""")