


from datetime import date

import requests

UpperCamelCase :				Dict						    =       '''https://api.carbonintensity.org.uk/intensity'''
def 							UpperCamelCase_  (				)->      str:




      '''simple docstring'''
      __magic_name__ 		=			requests.get(lowerCamelCase__     ).json()['data'][0]
      return last_half_hour["intensity"]["actual"]
def 							UpperCamelCase_  (				__snake_case			:						List[Any]	,			__snake_case			:						Union[str, Any]     )->      list:




      '''simple docstring'''
      return requests.get(F'''{BASE_URL}/{start}/{end}'''     ).json()["data"]


if __name__ == "__main__":
     for entry in fetch_from_to(start=date(2_020, 10, 1), end=date(2_020, 10, 3)):
          print('''from {from} to {to}: {intensity[actual]}'''.format(**entry))
     print(f'''{fetch_last_half_hour() = }''')





def 							UpperCamelCase_  (				__snake_case			:						list[int]     )->      tuple[int, int]:




						'''simple docstring'''
						# base case
						if len(__snake_case     ) == 1:
												return a[0], a[0]
						else:
												# split A into half.
												__magic_name__ 		=			a[: len(__snake_case     ) // 2]
												__magic_name__ 		=			a[len(__snake_case     ) // 2 :]

												# 2 sub problems, 1/2 of original size.
												__magic_name__		,			__magic_name__ 		=			max_difference(__snake_case     )
												__magic_name__		,			__magic_name__ 		=			max_difference(__snake_case     )

												# get min of first and max of second
												# linear time
												__magic_name__ 		=			min(__snake_case     )
												__magic_name__ 		=			max(__snake_case     )

												# 3 cases, either (small1, big1),
												# (min_first, max_second), (small2, big2)
												# constant comparisons
												if biga - smalla > max_second - min_first and biga - smalla > biga - smalla:
																		return smalla, biga
												elif biga - smalla > max_second - min_first:
																		return smalla, biga
												else:
																		return min_first, max_second


if __name__ == "__main__":
					import doctest

					doctest.testmod()

