






def    a__    (	A       ):
   lowercase__    :						Tuple       =			str(A       ).strip()
   if not oct_string:
      raise ValueError("""Empty string was passed to the function"""       )
   lowercase__    :						Tuple       =			oct_string[0] == """-"""
   if is_negative:
      lowercase__    :						str       =			oct_string[1:]
   if not oct_string.isdigit() or not all(0 <= int(A       ) <= 7 for char in oct_string       ):
      raise ValueError("""Non-octal value was passed to the function"""       )
   lowercase__    :						Optional[Any]       =			0
   for char in oct_string:
      lowercase__    :						int       =			8 * decimal_number + int(A       )
   if is_negative:
      lowercase__    :						Dict       =			-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() = }')


