

"""simple docstring"""
from datetime import date

import requests

A									=						"""https://api.carbonintensity.org.uk/intensity"""







def       UpperCamelCase_					(     )						->     str:



       """simple docstring"""







       __magic_name__			:		Any        =     requests.get(lowerCamelCase   ).json()['''data'''][0]
       return last_half_hour["intensity"]["actual"]







def       UpperCamelCase_					(     lowerCamelCase							:					Optional[int]     , lowerCamelCase							:					List[str]   )						->     list:



       """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"""
import math







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     list:



       """simple docstring"""







       if n <= 0:
              raise ValueError('''Only positive integers have prime factors'''   )
       __magic_name__			:		Union[str, Any]        =     []
       while n % 2 == 0:
              pf.append(2   )
              __magic_name__			:		Union[str, Any]        =     int(n / 2   )
       for i in range(3     , int(math.sqrt(lowerCamelCase   )   ) + 1     , 2   ):
              while n % i == 0:
                     pf.append(lowerCamelCase   )
                     __magic_name__			:		Any        =     int(n / i   )
       if n > 2:
              pf.append(lowerCamelCase   )
       return pf







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     int:



       """simple docstring"""







       if n <= 0:
              raise ValueError('''Only positive numbers are accepted'''   )
       __magic_name__			:		List[Any]        =     1
       __magic_name__			:		Dict        =     1
       while n % 2 == 0:
              temp += 1
              __magic_name__			:		Dict        =     int(n / 2   )
       div *= temp
       for i in range(3     , int(math.sqrt(lowerCamelCase   )   ) + 1     , 2   ):
              __magic_name__			:		Dict        =     1
              while n % i == 0:
                     temp += 1
                     __magic_name__			:		Union[str, Any]        =     int(n / i   )
              div *= temp
       if n > 1:
              div *= 2
       return div







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     int:



       """simple docstring"""







       if n <= 0:
              raise ValueError('''Only positive numbers are accepted'''   )
       __magic_name__			:		int        =     1
       __magic_name__			:		Dict        =     1
       while n % 2 == 0:
              temp += 1
              __magic_name__			:		List[Any]        =     int(n / 2   )
       if temp > 1:
              s *= (2**temp - 1) / (2 - 1)
       for i in range(3     , int(math.sqrt(lowerCamelCase   )   ) + 1     , 2   ):
              __magic_name__			:		Any        =     1
              while n % i == 0:
                     temp += 1
                     __magic_name__			:		Any        =     int(n / i   )
              if temp > 1:
                     s *= (i**temp - 1) / (i - 1)
       return int(lowerCamelCase   )







def       UpperCamelCase_					(     lowerCamelCase							:					int   )						->     int:



       """simple docstring"""







       __magic_name__			:		str        =     n
       for x in set(prime_factors(lowerCamelCase   )   ):
              s *= (x - 1) / x
       return int(lowerCamelCase   )


if __name__ == "__main__":
 import doctest

 doctest.testmod()
