






from datetime import date

import requests

lowerCamelCase					    =	'''https://api.carbonintensity.org.uk/intensity'''
def 							UpperCAmelCase   ( ):


    '''simple docstring'''



    _lowercase     			=						requests.get(_lowercase   ).json()['data'][0]
    return last_half_hour["intensity"]["actual"]
def 							UpperCAmelCase   ( _lowercase,   _lowercase   ):


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








import math
def 							UpperCAmelCase   ( _lowercase   ):


    '''simple docstring'''



    _lowercase     			=						math.log(2,   10   ) * number
    _lowercase     			=						round((log_number - int(_lowercase   )),   15   )

    return difference
def 							UpperCAmelCase   ( _lowercase = 678910   ):


    '''simple docstring'''



    _lowercase     			=						90
    _lowercase     			=						0

    _lowercase     			=						math.log(1.23,   10   )
    _lowercase     			=						math.log(1.24,   10   )
    _lowercase     			=						0

    while position < number:
        _lowercase     			=						log_difference(_lowercase   )

        if difference >= upper_limit:
            power_iterator += 93

        elif difference < lower_limit:
            power_iterator += 196

        else:
            _lowercase     			=						power_iterator
            power_iterator += 196
            position += 1

    return previous_power


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(f"{solution() = }")
