


from datetime import date

import requests

SCREAMING_SNAKE_CASE				:						Dict			   = "https://api.carbonintensity.org.uk/intensity"




def 			UpperCamelCase			(					)    ->							Any:
     '''simple docstring'''





     lowercase_				:Union[str, Any]       			=				requests.get(UpperCamelCase__						).json()['''data'''][0]
     return last_half_hour["intensity"]["actual"]




def 			UpperCamelCase			(					_a				,						_a						)    ->							int:
     '''simple docstring'''





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








# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
_lowerCamelCase       =	abspath(join(dirname(dirname(dirname(__file__))), 'src'))
sys.path.insert(1, git_repo_path)


# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='ignore', category=FutureWarning)






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							Tuple			):
		from transformers.testing_utils import pytest_addoption_shared

		pytest_addoption_shared(UpperCamelCase__			)






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							Tuple			):
		from transformers.testing_utils import pytest_terminal_summary_main

		SCREAMING_SNAKE_CASE__								=					terminalreporter.config.getoption("""--make-reports"""			)
		if make_reports:
				pytest_terminal_summary_main(UpperCamelCase__    ,      id=UpperCamelCase__			)