from __future__ import annotations

import sys





def      __lowercase  (		lowerCamelCase      :  str						,						lowerCamelCase      :  Optional[Any]			):
 # base cases
 if abs(lowercase__			) == 1:
  return a, 0
 elif abs(lowercase__			) == 1:
  return 0, b

 UpperCamelCase_,				UpperCamelCase_      :		Optional[int]				=      a, b
 UpperCamelCase_,				UpperCamelCase_      :		Any				=      1, 0
 UpperCamelCase_,				UpperCamelCase_      :		Union[str, Any]				=      0, 1

 while remainder != 0:
  UpperCamelCase_      :		Optional[int]				=      old_remainder // remainder
  UpperCamelCase_,				UpperCamelCase_      :		int				=      remainder, old_remainder - quotient * remainder
  UpperCamelCase_,				UpperCamelCase_      :		List[str]				=      coeff_a, old_coeff_a - quotient * coeff_a
  UpperCamelCase_,				UpperCamelCase_      :		int				=      coeff_b, old_coeff_b - quotient * coeff_b

 # sign correction for negative numbers
 if a < 0:
  UpperCamelCase_      :		List[Any]				=      -old_coeff_a
 if b < 0:
  UpperCamelCase_      :		Dict				=      -old_coeff_b

 return old_coeff_a, old_coeff_b





def      __lowercase  (		):
 if len(sys.argv			) < 3:
  print('2 integer arguments required'			)
  return 1
 UpperCamelCase_      :		str				=      int(sys.argv[1]			)
 UpperCamelCase_      :		Tuple				=      int(sys.argv[2]			)
 print(extended_euclidean_algorithm(lowercase__						,						lowercase__			)			)
 return 0


if __name__ == "__main__":
   raise SystemExit(main())




from datetime import date

import requests

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





def      __lowercase  (		):
 UpperCamelCase_      :		Dict				=      requests.get(lowerCamelCase			).json()['data'][0]
 return last_half_hour["intensity"]["actual"]





def      __lowercase  (		lowerCamelCase      :  Union[str, Any]						,						lowerCamelCase      :  Union[str, Any]			):
 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() = }""")



