



'''simple docstring'''



from datetime import date

import requests

lowerCAmelCase						:		str						      = '''https://api.carbonintensity.org.uk/intensity'''



def 	__lowerCAmelCase       (				):






	'''simple docstring'''




	__lowerCAmelCase       				=	requests.get(lowerCamelCase       ).json()["data"][0]
	return last_half_hour["intensity"]["actual"]



def 	__lowerCAmelCase       (				lowerCamelCase :    Optional[int]					,		lowerCamelCase :    Optional[int]       ):






	'''simple docstring'''




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


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




'''simple docstring'''



from __future__ import annotations

from random import randrange



def 	__lowerCAmelCase       (				lowerCamelCase :    list       ):






	'''simple docstring'''




	if len(lowerCamelCase       ) < 2:
		return collection
	__lowerCAmelCase       				=	randrange(len(lowerCamelCase       )       )  # Use random element as pivot
	__lowerCAmelCase       				=	collection[pivot_index]
	__lowerCAmelCase       				=	[]  # All elements greater than pivot
	__lowerCAmelCase       				=	[]  # All elements less than or equal to pivot

	for element in collection[:pivot_index]:
		(greater if element > pivot else lesser).append(lowerCamelCase       )

	for element in collection[pivot_index + 1 :]:
		(greater if element > pivot else lesser).append(lowerCamelCase       )

	return [*quick_sort(lowerCamelCase       ), pivot, *quick_sort(lowerCamelCase       )]


if __name__ == "__main__":
	lowerCAmelCase						:		List[Any]						      = input('''Enter numbers separated by a comma:\n''').strip()
	lowerCAmelCase						:		Any						      = [int(item) for item in user_input.split(''',''')]
	print(quick_sort(unsorted))