


from datetime import date

import requests

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




def 			a_   (					):
       '''simple docstring'''





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




def 			a_   (					SCREAMING_SNAKE_CASE__      :   List[str]	,    SCREAMING_SNAKE_CASE__      :   Union[str, Any]  ):
       '''simple docstring'''





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


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






from __future__ import annotations

from collections.abc import Generator




def 			a_   (					SCREAMING_SNAKE_CASE__      :   int  ):
       '''simple docstring'''





       if not isinstance(SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__  ) or n < 1:
              raise Exception('Sequence only defined for positive integers'  )

       yield n
       while n != 1:
              if n % 2 == 0:
                     n //= 2
              else:
                     _lowerCamelCase :	Optional[int]						=3 * n + 1
              yield n




def 			a_   (					):
       '''simple docstring'''





       _lowerCamelCase :	Dict						=43
       _lowerCamelCase :	Dict						=tuple(collatz_sequence(SCREAMING_SNAKE_CASE__  )  )
       print(SCREAMING_SNAKE_CASE__  )
       print(F'''Collatz sequence from {n} took {len(SCREAMING_SNAKE_CASE__  )} steps.'''  )


if __name__ == "__main__":
 main()


