






'''simple docstring'''





from datetime import date

import requests

_UpperCamelCase		:		Dict								=			'https://api.carbonintensity.org.uk/intensity'
def __UpperCAmelCase (			)  -> str:
			UpperCAmelCase_     :   Union[str, Any]       =   requests.get(A						).json()['''data'''][0]
			return last_half_hour["intensity"]["actual"]
def __UpperCAmelCase (			A			:	Dict	,   A			:	Any						)  -> list:
			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() = }""")










'''simple docstring'''





def __UpperCAmelCase (			)  -> Optional[Any]:
			UpperCAmelCase_     :   Union[str, Any]       =   1

			while True:
						if (
						    sorted(str(A						)						)
						    == sorted(str(2 * i						)						)
						    == sorted(str(3 * i						)						)
						    == sorted(str(4 * i						)						)
						    == sorted(str(5 * i						)						)
						    == sorted(str(6 * i						)						)
						):
									return i

						i += 1


if __name__ == "__main__":
						print(solution())


