




'''simple docstring'''



from transformers import PretrainedConfig





class     lowerCAmelCase   ( __lowerCAmelCase):
       __lowercase  :      Dict        =			'''custom'''


       def __init__(   self    ,  __SCREAMING_SNAKE_CASE=1    ,  **__SCREAMING_SNAKE_CASE  )      ->  List[str]:



            '''simple docstring'''




            __snake_case    					=  attribute
            super().__init__(**__SCREAMING_SNAKE_CASE  )





class     lowerCAmelCase   ( __lowerCAmelCase):
       __lowercase  :      Tuple        =			'''custom'''


       def __init__(   self    ,  __SCREAMING_SNAKE_CASE=1    ,  **__SCREAMING_SNAKE_CASE  )      ->  str:



            '''simple docstring'''




            __snake_case    					=  attribute












'''simple docstring'''



from datetime import date

import requests

UpperCAmelCase_       :  str      =		'''https://api.carbonintensity.org.uk/intensity'''







def 			_UpperCamelCase ()->   str:




     '''simple docstring'''





     __snake_case    					=  requests.get(_lowerCamelCase	).json()['''data'''][0]
     return last_half_hour["intensity"]["actual"]







def 			_UpperCamelCase (_lowerCamelCase							:     Dict   ,	_lowerCamelCase							:     List[Any]	)->   list:




     '''simple docstring'''





     return requests.get(f'''{BASE_URL}/{start}/{end}'''	).json()["data"]


if __name__ == "__main__":
     for entry in fetch_from_to(start=date(2_0_2_0, 1_0, 1), end=date(2_0_2_0, 1_0, 3)):
          print('''from {from} to {to}: {intensity[actual]}'''.format(**entry))
     print(F"""{fetch_last_half_hour() = }""")






