





from datetime import date

import requests

UpperCamelCase__ :			Optional[Any]       	=			"""https://api.carbonintensity.org.uk/intensity"""




def  A_(      ):
	UpperCAmelCase_		    =  requests.get(A ).json()["""data"""][0]
	return last_half_hour["intensity"]["actual"]




def  A_(      A					,   A ):
	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() = }")




"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
    is_vision_available,
)


UpperCamelCase_						   =   {
    'configuration_mobilevitv2': [
        'MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileViTV2Config',
        'MobileViTV2OnnxConfig',
    ],
}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase_						   =   [
          'MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST',
          'MobileViTV2ForImageClassification',
          'MobileViTV2ForSemanticSegmentation',
          'MobileViTV2Model',
          'MobileViTV2PreTrainedModel',
      ]

if TYPE_CHECKING:
      from .configuration_mobilevitva import (
          MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
          MobileViTVaConfig,
          MobileViTVaOnnxConfig,
      )

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mobilevitva import (
                MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
                MobileViTVaForImageClassification,
                MobileViTVaForSemanticSegmentation,
                MobileViTVaModel,
                MobileViTVaPreTrainedModel,
            )

else:
      import sys

      UpperCamelCase_						   =   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)