



'''simple docstring'''





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_funnel import FunnelTokenizer


_UpperCamelCase											=		logging.get_logger(__name__)

_UpperCamelCase											=		{'vocab_file': 'vocab.txt', 'tokenizer_file': 'tokenizer.json'}

_UpperCamelCase											=		[
    'small',
    'small-base',
    'medium',
    'medium-base',
    'intermediate',
    'intermediate-base',
    'large',
    'large-base',
    'xlarge',
    'xlarge-base',
]

_UpperCamelCase											=		{
    'vocab_file': {
        'funnel-transformer/small': 'https://huggingface.co/funnel-transformer/small/resolve/main/vocab.txt',
        'funnel-transformer/small-base': 'https://huggingface.co/funnel-transformer/small-base/resolve/main/vocab.txt',
        'funnel-transformer/medium': 'https://huggingface.co/funnel-transformer/medium/resolve/main/vocab.txt',
        'funnel-transformer/medium-base': (
            'https://huggingface.co/funnel-transformer/medium-base/resolve/main/vocab.txt'
        ),
        'funnel-transformer/intermediate': (
            'https://huggingface.co/funnel-transformer/intermediate/resolve/main/vocab.txt'
        ),
        'funnel-transformer/intermediate-base': (
            'https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/vocab.txt'
        ),
        'funnel-transformer/large': 'https://huggingface.co/funnel-transformer/large/resolve/main/vocab.txt',
        'funnel-transformer/large-base': 'https://huggingface.co/funnel-transformer/large-base/resolve/main/vocab.txt',
        'funnel-transformer/xlarge': 'https://huggingface.co/funnel-transformer/xlarge/resolve/main/vocab.txt',
        'funnel-transformer/xlarge-base': (
            'https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/vocab.txt'
        ),
    },
    'tokenizer_file': {
        'funnel-transformer/small': 'https://huggingface.co/funnel-transformer/small/resolve/main/tokenizer.json',
        'funnel-transformer/small-base': (
            'https://huggingface.co/funnel-transformer/small-base/resolve/main/tokenizer.json'
        ),
        'funnel-transformer/medium': 'https://huggingface.co/funnel-transformer/medium/resolve/main/tokenizer.json',
        'funnel-transformer/medium-base': (
            'https://huggingface.co/funnel-transformer/medium-base/resolve/main/tokenizer.json'
        ),
        'funnel-transformer/intermediate': (
            'https://huggingface.co/funnel-transformer/intermediate/resolve/main/tokenizer.json'
        ),
        'funnel-transformer/intermediate-base': (
            'https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/tokenizer.json'
        ),
        'funnel-transformer/large': 'https://huggingface.co/funnel-transformer/large/resolve/main/tokenizer.json',
        'funnel-transformer/large-base': (
            'https://huggingface.co/funnel-transformer/large-base/resolve/main/tokenizer.json'
        ),
        'funnel-transformer/xlarge': 'https://huggingface.co/funnel-transformer/xlarge/resolve/main/tokenizer.json',
        'funnel-transformer/xlarge-base': (
            'https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/tokenizer.json'
        ),
    },
}
_UpperCamelCase											=		{f'''funnel-transformer/{name}''': 512 for name in _model_names}
_UpperCamelCase											=		{f'''funnel-transformer/{name}''': {'do_lower_case': True} for name in _model_names}






class    lowerCamelCase_       (							SCREAMING_SNAKE_CASE_	):
  """simple docstring"""




  a_				   =VOCAB_FILES_NAMES
  a_				   =PRETRAINED_VOCAB_FILES_MAP
  a_				   =PRETRAINED_INIT_CONFIGURATION
  a_				   =FunnelTokenizer
  a_				   =PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  a_				   =2




  def __init__(					self :      Optional[Any]     ,      _a :      List[Any]=None     ,      _a :      Optional[int]=None     ,      _a :      Optional[Any]=True     ,      _a :      Tuple="<unk>"     ,      _a :      int="<sep>"     ,      _a :      List[Any]="<pad>"     ,      _a :      List[Any]="<cls>"     ,      _a :      Any="<mask>"     ,      _a :      Tuple="<s>"     ,      _a :      List[Any]="</s>"     ,      _a :      Optional[int]=True     ,      _a :      str=True     ,      _a :      Optional[int]=None     ,      _a :      List[str]="##"     ,      **_a :      Any     ,      )   ->   str:
    super().__init__(
        _a     ,      tokenizer_file=_a     ,      do_lower_case=_a     ,      unk_token=_a     ,      sep_token=_a     ,      pad_token=_a     ,      cls_token=_a     ,      mask_token=_a     ,      bos_token=_a     ,      eos_token=_a     ,      clean_text=_a     ,      tokenize_chinese_chars=_a     ,      strip_accents=_a     ,      wordpieces_prefix=_a     ,      **_a     ,      )

    __lowerCamelCase			:			Tuple       			=					json.loads(self.backend_tokenizer.normalizer.__getstate__()  )
    if (
        normalizer_state.get('lowercase'     ,      _a  ) != do_lower_case
        or normalizer_state.get('strip_accents'     ,      _a  ) != strip_accents
        or normalizer_state.get('handle_chinese_chars'     ,      _a  ) != tokenize_chinese_chars
    ):
      __lowerCamelCase			:			Optional[Any]       			=					getattr(_a     ,      normalizer_state.pop('type'  )  )
      __lowerCamelCase			:			Tuple       			=					do_lower_case
      __lowerCamelCase			:			str       			=					strip_accents
      __lowerCamelCase			:			List[str]       			=					tokenize_chinese_chars
      __lowerCamelCase			:			Any       			=					normalizer_class(**_a  )

    __lowerCamelCase			:			List[str]       			=					do_lower_case




  def 		_lowercase	(					self :      Optional[Any]     ,      _a :      List[Any]     ,      _a :      int=None  )   ->   Optional[int]:
    __lowerCamelCase			:			List[Any]       			=					[self.cls_token_id] + token_ids_a + [self.sep_token_id]

    if token_ids_a:
      output += token_ids_a + [self.sep_token_id]

    return output




  def 		_lowercase	(					self :      Optional[Any]     ,      _a :      List[int]     ,      _a :      Optional[List[int]] = None  )   ->   List[int]:
    __lowerCamelCase			:			int       			=					[self.sep_token_id]
    __lowerCamelCase			:			Optional[int]       			=					[self.cls_token_id]
    if token_ids_a is None:
      return len(cls  ) * [self.cls_token_type_id] + len(token_ids_a + sep  ) * [0]
    return len(cls  ) * [self.cls_token_type_id] + len(token_ids_a + sep  ) * [0] + len(token_ids_a + sep  ) * [1]




  def 		_lowercase	(					self :      int     ,      _a :      str     ,      _a :      Optional[str] = None  )   ->   Tuple[str]:
    __lowerCamelCase			:			Dict       			=					self._tokenizer.model.save(_a     ,      name=_a  )
    return tuple(_a  )











'''simple docstring'''





import functools

def 			a_	(				_lowerCAmelCase			,_lowerCAmelCase			) -> int:

  # Validation
  if not isinstance(_lowerCAmelCase			,_lowerCAmelCase			) or not all(isinstance(_lowerCAmelCase			,_lowerCAmelCase			) for day in days			):
    raise ValueError('The parameter days should be a list of integers'			)

  if len(_lowerCAmelCase			) != 3 or not all(isinstance(_lowerCAmelCase			,_lowerCAmelCase			) for cost in costs			):
    raise ValueError('The parameter costs should be a list of three integers'			)

  if len(_lowerCAmelCase			) == 0:
    return 0

  if min(_lowerCAmelCase			) <= 0:
    raise ValueError('All days elements should be greater than 0'			)

  if max(_lowerCAmelCase			) >= 366:
    raise ValueError('All days elements should be less than 366'			)

  __lowerCamelCase			:			int       			=					set(_lowerCAmelCase			)

  @functools.cache
  def dynamic_programming(_lowerCAmelCase			) -> int:
    if index > 365:
      return 0

    if index not in days_set:
      return dynamic_programming(index + 1			)

    return min(
        costs[0] + dynamic_programming(index + 1			)			,costs[1] + dynamic_programming(index + 7			)			,costs[2] + dynamic_programming(index + 30			)			,)

  return dynamic_programming(1			)


if __name__ == "__main__":
   import doctest

   doctest.testmod()






