



"""simple docstring"""







def  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase      ):
		_lowercase				: Union[str, Any]     =   str(__UpperCAmelCase      ).strip()
		if not oct_string:
				raise ValueError("""Empty string was passed to the function"""      )
		_lowercase				: str     =   oct_string[0] == """-"""
		if is_negative:
				_lowercase				: Optional[int]     =   oct_string[1:]
		if not oct_string.isdigit() or not all(0 <= int(__UpperCAmelCase      ) <= 7 for char in oct_string      ):
				raise ValueError("""Non-octal value was passed to the function"""      )
		_lowercase				: Dict     =   0
		for char in oct_string:
				_lowercase				: Union[str, Any]     =   8 * decimal_number + int(__UpperCAmelCase      )
		if is_negative:
				_lowercase				: List[str]     =   -decimal_number
		return decimal_number


if __name__ == "__main__":
		from doctest import testmod

		testmod()











from datetime import date

import requests

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


