






"""simple docstring"""






from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_openai import OpenAIGPTTokenizer


A_			  =    logging.get_logger(__name__)

A_			  =    {"vocab_file": "vocab.json", "merges_file": "merges.txt", "tokenizer_file": "tokenizer.json"}

A_			  =    {
    "vocab_file": {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/vocab.json"},
    "merges_file": {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/merges.txt"},
    "tokenizer_file": {"openai-gpt": "https://huggingface.co/openai-gpt/resolve/main/tokenizer.json"},
}

A_			  =    {
    "openai-gpt": 512,
}
class 						__lowerCAmelCase   (			UpperCAmelCase       ):







  '''simple docstring'''


  __lowerCamelCase       :    Any     	=			VOCAB_FILES_NAMES
  __lowerCamelCase       :    Optional[int]     	=			PRETRAINED_VOCAB_FILES_MAP
  __lowerCamelCase       :    int     	=			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  __lowerCamelCase       :    Optional[Any]     	=			["input_ids", "attention_mask"]
  __lowerCamelCase       :    Tuple     	=			OpenAIGPTTokenizer
  def __init__(      self:		List[str]				,			UpperCamelCase_:		List[Any]=None				,			UpperCamelCase_:		List[Any]=None				,			UpperCamelCase_:		Optional[int]=None				,			UpperCamelCase_:		Any="<unk>"				,			**UpperCamelCase_:		List[Any]					):
     super().__init__(UpperCamelCase_				,			UpperCamelCase_				,			tokenizer_file=UpperCamelCase_				,			unk_token=UpperCamelCase_				,			**UpperCamelCase_					)
  @property
  def 					UpperCamelCase__   (      self:		Optional[Any]					):
     return True





  def 					UpperCamelCase__   (      self:		Any				,			UpperCamelCase_:		str				,			UpperCamelCase_:		Optional[str] = None					):
     UpperCamelCase_     =self._tokenizer.model.save(UpperCamelCase_				,			name=UpperCamelCase_					)
     return tuple(UpperCamelCase_					)








"""simple docstring"""






from datetime import date

import requests

A_			  =    "https://api.carbonintensity.org.uk/intensity"




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




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