


import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_electra import ElectraTokenizer


UpperCamelCase					:       Any			    =     {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

UpperCamelCase					:       Union[str, Any]			    =     {
    """vocab_file""": {
        """google/electra-small-generator""": (
            """https://huggingface.co/google/electra-small-generator/resolve/main/vocab.txt"""
        ),
        """google/electra-base-generator""": """https://huggingface.co/google/electra-base-generator/resolve/main/vocab.txt""",
        """google/electra-large-generator""": (
            """https://huggingface.co/google/electra-large-generator/resolve/main/vocab.txt"""
        ),
        """google/electra-small-discriminator""": (
            """https://huggingface.co/google/electra-small-discriminator/resolve/main/vocab.txt"""
        ),
        """google/electra-base-discriminator""": (
            """https://huggingface.co/google/electra-base-discriminator/resolve/main/vocab.txt"""
        ),
        """google/electra-large-discriminator""": (
            """https://huggingface.co/google/electra-large-discriminator/resolve/main/vocab.txt"""
        ),
    },
    """tokenizer_file""": {
        """google/electra-small-generator""": (
            """https://huggingface.co/google/electra-small-generator/resolve/main/tokenizer.json"""
        ),
        """google/electra-base-generator""": (
            """https://huggingface.co/google/electra-base-generator/resolve/main/tokenizer.json"""
        ),
        """google/electra-large-generator""": (
            """https://huggingface.co/google/electra-large-generator/resolve/main/tokenizer.json"""
        ),
        """google/electra-small-discriminator""": (
            """https://huggingface.co/google/electra-small-discriminator/resolve/main/tokenizer.json"""
        ),
        """google/electra-base-discriminator""": (
            """https://huggingface.co/google/electra-base-discriminator/resolve/main/tokenizer.json"""
        ),
        """google/electra-large-discriminator""": (
            """https://huggingface.co/google/electra-large-discriminator/resolve/main/tokenizer.json"""
        ),
    },
}

UpperCamelCase					:       Optional[int]			    =     {
    """google/electra-small-generator""": 512,
    """google/electra-base-generator""": 512,
    """google/electra-large-generator""": 512,
    """google/electra-small-discriminator""": 512,
    """google/electra-base-discriminator""": 512,
    """google/electra-large-discriminator""": 512,
}

UpperCamelCase					:       Any			    =     {
    """google/electra-small-generator""": {"""do_lower_case""": True},
    """google/electra-base-generator""": {"""do_lower_case""": True},
    """google/electra-large-generator""": {"""do_lower_case""": True},
    """google/electra-small-discriminator""": {"""do_lower_case""": True},
    """google/electra-base-discriminator""": {"""do_lower_case""": True},
    """google/electra-large-discriminator""": {"""do_lower_case""": True},
}



class A__     ( A__  ):



  """simple docstring"""



  _lowercase									=		VOCAB_FILES_NAMES
  _lowercase									=		PRETRAINED_VOCAB_FILES_MAP
  _lowercase									=		PRETRAINED_INIT_CONFIGURATION
  _lowercase									=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  _lowercase									=		ElectraTokenizer

  def __init__( self			:  int				,				lowerCamelCase__			:  Optional[Any]=None				,				lowerCamelCase__			:  Union[str, Any]=None				,				lowerCamelCase__			:  Tuple=True				,				lowerCamelCase__			:  Optional[Any]="[UNK]"				,				lowerCamelCase__			:  List[Any]="[SEP]"				,				lowerCamelCase__			:  List[Any]="[PAD]"				,				lowerCamelCase__			:  str="[CLS]"				,				lowerCamelCase__			:  List[Any]="[MASK]"				,				lowerCamelCase__			:  Dict=True				,				lowerCamelCase__			:  Optional[int]=None				,				**lowerCamelCase__			:  str				,				):
        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__				,				)

        a__	:  List[Any]     =   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
        ):
              a__	:  Any     =   getattr(lowerCamelCase__				,				normalizer_state.pop("type"       )       )
              a__	:  Union[str, Any]     =   do_lower_case
              a__	:  Optional[int]     =   strip_accents
              a__	:  int     =   tokenize_chinese_chars
              a__	:  Tuple     =   normalizer_class(**lowerCamelCase__       )

        a__	:  Union[str, Any]     =   do_lower_case

  def    _UpperCamelCase( self			:  Any				,				lowerCamelCase__			:  Dict				,				lowerCamelCase__			:  Dict=None       ):
        a__	:  Union[str, 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    _UpperCamelCase( self			:  List[Any]				,				lowerCamelCase__			:  List[int]				,				lowerCamelCase__			:  Optional[List[int]] = None       ):
        a__	:  Optional[int]     =   [self.sep_token_id]
        a__	:  List[Any]     =   [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    _UpperCamelCase( self			:  Optional[Any]				,				lowerCamelCase__			:  str				,				lowerCamelCase__			:  Optional[str] = None       ):
        a__	:  Union[str, Any]     =   self._tokenizer.model.save(lowerCamelCase__				,				name=lowerCamelCase__       )
        return tuple(lowerCamelCase__       )




from collections.abc import Callable

import numpy as np





def 	__a     (      A__			:  Callable			,  A__			:  float			,  A__			:  float			,  A__			:  float			,  A__			:  float       ):
    SCREAMING_SNAKE_CASE										=   int(np.ceil((x_end - xa) / step_size       )       )
    SCREAMING_SNAKE_CASE										=   np.zeros((n + 1,)       )
    SCREAMING_SNAKE_CASE										=   ya
    SCREAMING_SNAKE_CASE										=   xa

    for k in range(A__       ):
        SCREAMING_SNAKE_CASE										=   y[k] + step_size * ode_func(A__			,  y[k]       )
        SCREAMING_SNAKE_CASE										=   y[k] + (
            (step_size / 2) * (ode_func(A__			,  y[k]       ) + ode_func(x + step_size			,  A__       ))
        )
        x += step_size

    return y


if __name__ == "__main__":
    import doctest

    doctest.testmod()