"""simple docstring"""







from datetime import date

import requests

SCREAMING_SNAKE_CASE						=    'https://api.carbonintensity.org.uk/intensity'


def   __lowerCAmelCase(		):






	"""simple docstring"""





	_lowercase			:     Union[str, Any]      					=				requests.get(__UpperCAmelCase      ).json()['data'][0]
	return last_half_hour["intensity"]["actual"]


def   __lowerCAmelCase(		__UpperCAmelCase  ,__UpperCAmelCase      ):






	"""simple docstring"""





	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() = }""")




"""simple docstring"""







def   __lowerCAmelCase(		__UpperCAmelCase  ,__UpperCAmelCase      ):






	"""simple docstring"""





	if n == 0:
		return 1

	elif n % 2 == 1:
		return binary_exponentiation(__UpperCAmelCase  ,n - 1      ) * a

	else:
		_lowercase			:     Dict      					=				binary_exponentiation(__UpperCAmelCase  ,n / 2      )
		return b * b


if __name__ == "__main__":
						try:
												SCREAMING_SNAKE_CASE						=    int(input('Enter Base : ').strip())
												SCREAMING_SNAKE_CASE						=    int(input('Enter Power : ').strip())
						except ValueError:
												print('Invalid literal for integer')

						SCREAMING_SNAKE_CASE						=    binary_exponentiation(BASE, POWER)
						print(f"""{BASE}^({POWER}) : {RESULT}""")



