





import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_distilbert import DistilBertTokenizer


_snake_case  :   str						   =  logging.get_logger(__name__)

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

_snake_case  :   Optional[Any]						   =  {
    'vocab_file': {
        'distilbert-base-uncased': 'https://huggingface.co/distilbert-base-uncased/resolve/main/vocab.txt',
        'distilbert-base-uncased-distilled-squad': (
            'https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/vocab.txt'
        ),
        'distilbert-base-cased': 'https://huggingface.co/distilbert-base-cased/resolve/main/vocab.txt',
        'distilbert-base-cased-distilled-squad': (
            'https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/vocab.txt'
        ),
        'distilbert-base-german-cased': 'https://huggingface.co/distilbert-base-german-cased/resolve/main/vocab.txt',
        'distilbert-base-multilingual-cased': (
            'https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/vocab.txt'
        ),
    },
    'tokenizer_file': {
        'distilbert-base-uncased': 'https://huggingface.co/distilbert-base-uncased/resolve/main/tokenizer.json',
        'distilbert-base-uncased-distilled-squad': (
            'https://huggingface.co/distilbert-base-uncased-distilled-squad/resolve/main/tokenizer.json'
        ),
        'distilbert-base-cased': 'https://huggingface.co/distilbert-base-cased/resolve/main/tokenizer.json',
        'distilbert-base-cased-distilled-squad': (
            'https://huggingface.co/distilbert-base-cased-distilled-squad/resolve/main/tokenizer.json'
        ),
        'distilbert-base-german-cased': (
            'https://huggingface.co/distilbert-base-german-cased/resolve/main/tokenizer.json'
        ),
        'distilbert-base-multilingual-cased': (
            'https://huggingface.co/distilbert-base-multilingual-cased/resolve/main/tokenizer.json'
        ),
    },
}

_snake_case  :   Any						   =  {
    'distilbert-base-uncased': 512,
    'distilbert-base-uncased-distilled-squad': 512,
    'distilbert-base-cased': 512,
    'distilbert-base-cased-distilled-squad': 512,
    'distilbert-base-german-cased': 512,
    'distilbert-base-multilingual-cased': 512,
}


_snake_case  :   Any						   =  {
    'distilbert-base-uncased': {'do_lower_case': True},
    'distilbert-base-uncased-distilled-squad': {'do_lower_case': True},
    'distilbert-base-cased': {'do_lower_case': False},
    'distilbert-base-cased-distilled-squad': {'do_lower_case': False},
    'distilbert-base-german-cased': {'do_lower_case': False},
    'distilbert-base-multilingual-cased': {'do_lower_case': False},
}



class     _UpperCAmelCase   (   _UpperCamelCase   ):

  """simple docstring"""


  a_      =			VOCAB_FILES_NAMES
  a_      =			PRETRAINED_VOCAB_FILES_MAP
  a_      =			PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  a_      =			PRETRAINED_INIT_CONFIGURATION
  a_      =			["""input_ids""", """attention_mask"""]
  a_      =			DistilBertTokenizer






  def __init__(    self			:		Union[str, Any] ,  lowerCAmelCase_			:		int=None ,  lowerCAmelCase_			:		List[str]=None ,  lowerCAmelCase_			:		List[Any]=True ,  lowerCAmelCase_			:		Optional[Any]="[UNK]" ,  lowerCAmelCase_			:		int="[SEP]" ,  lowerCAmelCase_			:		Any="[PAD]" ,  lowerCAmelCase_			:		List[str]="[CLS]" ,  lowerCAmelCase_			:		List[Any]="[MASK]" ,  lowerCAmelCase_			:		Union[str, Any]=True ,  lowerCAmelCase_			:		List[Any]=None ,  **lowerCAmelCase_			:		Optional[Any] ,  )							->						Optional[Any]:
     super().__init__(
         lowerCAmelCase_ ,  tokenizer_file=lowerCAmelCase_ ,  do_lower_case=lowerCAmelCase_ ,  unk_token=lowerCAmelCase_ ,  sep_token=lowerCAmelCase_ ,  pad_token=lowerCAmelCase_ ,  cls_token=lowerCAmelCase_ ,  mask_token=lowerCAmelCase_ ,  tokenize_chinese_chars=lowerCAmelCase_ ,  strip_accents=lowerCAmelCase_ ,  **lowerCAmelCase_ ,  )

     __lowerCAmelCase							     =     json.loads(self.backend_tokenizer.normalizer.__getstate__()					)
     if (
         normalizer_state.get('lowercase' ,  lowerCAmelCase_					) != do_lower_case
         or normalizer_state.get('strip_accents' ,  lowerCAmelCase_					) != strip_accents
         or normalizer_state.get('handle_chinese_chars' ,  lowerCAmelCase_					) != tokenize_chinese_chars
     ):
        __lowerCAmelCase							     =     getattr(lowerCAmelCase_ ,  normalizer_state.pop('type'					)					)
        __lowerCAmelCase							     =     do_lower_case
        __lowerCAmelCase							     =     strip_accents
        __lowerCAmelCase							     =     tokenize_chinese_chars
        __lowerCAmelCase							     =     normalizer_class(**lowerCAmelCase_					)

     __lowerCAmelCase							     =     do_lower_case






  def     lowercase		(    self			:		str ,  lowerCAmelCase_			:		List[Any] ,  lowerCAmelCase_			:		List[str]=None					)							->						Any:
     __lowerCAmelCase							     =     [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			:		List[str] ,  lowerCAmelCase_			:		List[int] ,  lowerCAmelCase_			:		Optional[List[int]] = None					)							->						List[int]:
     __lowerCAmelCase							     =     [self.sep_token_id]
     __lowerCAmelCase							     =     [self.cls_token_id]
     if token_ids_a is None:
        return len(cls + token_ids_a + sep					) * [0]
     return len(cls + token_ids_a + sep					) * [0] + len(token_ids_a + sep					) * [1]






  def     lowercase		(    self			:		int ,  lowerCAmelCase_			:		str ,  lowerCAmelCase_			:		Optional[str] = None					)							->						Tuple[str]:
     __lowerCAmelCase							     =     self._tokenizer.model.save(lowerCAmelCase_ ,  name=lowerCAmelCase_					)
     return tuple(lowerCAmelCase_					)







from collections.abc import Sequence

def   a_   (			lowerCAmelCase_				:      Sequence[float],     lowerCAmelCase_				:      bool = False     ):
   if not arr:
      return 0

   __lowerCAmelCase							     =     0 if allow_empty_subarrays else float('-inf'     )
   __lowerCAmelCase							     =     0.0
   for num in arr:
      __lowerCAmelCase							     =     max(0 if allow_empty_subarrays else num,     curr_sum + num     )
      __lowerCAmelCase							     =     max(lowerCAmelCase_,     lowerCAmelCase_     )

   return max_sum


if __name__ == "__main__":
     from doctest import testmod

     testmod()

     _snake_case  :   Optional[Any]						   =  [-2, 1, -3, 4, -1, 2, 1, -5, 4]
     print(F"""{max_subarray_sum(nums) = }""")

