



from datetime import date

import requests

UpperCAmelCase__			:   int      			=    'https://api.carbonintensity.org.uk/intensity'


def 	_A	(   ):
				_UpperCAmelCase						:  List[str]     					=	requests.get(_UpperCamelCase			).json()['''data'''][0]
				return last_half_hour["intensity"]["actual"]


def 	_A	(   _UpperCamelCase      ,					_UpperCamelCase			):
				return requests.get(F'''{BASE_URL}/{start}/{end}'''			).json()["data"]


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





UpperCAmelCase__			:   Optional[int]      			=    [0.4_85, 0.4_56, 0.4_06]
UpperCAmelCase__			:   Union[str, Any]      			=    [0.2_29, 0.2_24, 0.2_25]
UpperCAmelCase__			:   Union[str, Any]      			=    [0.5, 0.5, 0.5]
UpperCAmelCase__			:   Optional[Any]      			=    [0.5, 0.5, 0.5]
UpperCAmelCase__			:   str      			=    [0.48_14_54_66, 0.4_57_82_75, 0.40_82_10_73]
UpperCAmelCase__			:   Dict      			=    [0.26_86_29_54, 0.26_13_02_58, 0.27_57_77_11]
