

from datetime import datetime

import requests
def     UpperCAmelCase_       (						_A    ):





     '''simple docstring'''




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


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





from __future__ import annotations

import time
from collections.abc import Sequence
from random import randint

from matplotlib import pyplot as plt
def     UpperCAmelCase_       (						_A				,		_A				,		_A    ):





     '''simple docstring'''




     if not arr:
          return None, None, 0
     if low == high:
          return low, high, arr[low]

     SCREAMING_SNAKE_CASE__   =   (low + high) // 2
     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   max_subarray(_A				,		_A				,		_A    )
     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   max_subarray(_A				,		mid + 1				,		_A    )
     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   max_cross_sum(_A				,		_A				,		_A				,		_A    )
     if left_sum >= right_sum and left_sum >= cross_sum:
          return left_low, left_high, left_sum
     elif right_sum >= left_sum and right_sum >= cross_sum:
          return right_low, right_high, right_sum
     return cross_left, cross_right, cross_sum
def     UpperCAmelCase_       (						_A				,		_A				,		_A				,		_A    ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   float('''-inf'''    ), -1
     SCREAMING_SNAKE_CASE__,SCREAMING_SNAKE_CASE__   =   float('''-inf'''    ), -1

     SCREAMING_SNAKE_CASE__   =   0
     for i in range(_A				,		low - 1				,		-1    ):
          summ += arr[i]
          if summ > left_sum:
               SCREAMING_SNAKE_CASE__   =   summ
               SCREAMING_SNAKE_CASE__   =   i

     SCREAMING_SNAKE_CASE__   =   0
     for i in range(mid + 1				,		high + 1    ):
          summ += arr[i]
          if summ > right_sum:
               SCREAMING_SNAKE_CASE__   =   summ
               SCREAMING_SNAKE_CASE__   =   i

     return max_left, max_right, (left_sum + right_sum)
def     UpperCAmelCase_       (						_A    ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__   =   [randint(1				,		_A    ) for _ in range(_A    )]
     SCREAMING_SNAKE_CASE__   =   time.time()
     max_subarray(_A				,		0				,		input_size - 1    )
     SCREAMING_SNAKE_CASE__   =   time.time()
     return end - start
def     UpperCAmelCase_       (						):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__   =   [10, 1_00, 10_00, 1_00_00, 5_00_00, 10_00_00, 20_00_00, 30_00_00, 40_00_00, 50_00_00]
     SCREAMING_SNAKE_CASE__   =   [time_max_subarray(_A    ) for input_size in input_sizes]
     print('''No of Inputs\t\tTime Taken'''    )
     for input_size, runtime in zip(_A				,		_A    ):
          print(_A				,		'''\t\t'''				,		_A    )
     plt.plot(_A				,		_A    )
     plt.xlabel('''Number of Inputs'''    )
     plt.ylabel('''Time taken in seconds'''    )
     plt.show()


if __name__ == "__main__":
       from doctest import testmod

       testmod()


