






"""simple docstring"""





from .hash_table import HashTable
from .number_theory.prime_numbers import is_prime, next_prime







class 						_a  (		lowercase_       ):





   '''simple docstring'''






   def __init__(       self					, *UpperCAmelCase_					, **UpperCAmelCase_)			->   Tuple:




          '''simple docstring'''




          super().__init__(*UpperCAmelCase_					, **UpperCAmelCase_)





   def __lowercase							(       self					, UpperCAmelCase_					, UpperCAmelCase_)			->   Dict:




          '''simple docstring'''




          lowercase__:							Union[str, Any]         =     (
              next_prime(value % self.size_table)
              if not is_prime(value % self.size_table)
              else value % self.size_table
          )  # gt = bigger than
          return next_prime_gt - (data % next_prime_gt)





   def __lowercase							(       self					, UpperCAmelCase_					, UpperCAmelCase_					, UpperCAmelCase_)			->   Union[str, Any]:




          '''simple docstring'''




          return (increment * self.__hash_function_a(UpperCAmelCase_					, UpperCAmelCase_)) % self.size_table





   def __lowercase							(       self					, UpperCAmelCase_					, UpperCAmelCase_=None)			->   Union[str, Any]:




          '''simple docstring'''




          lowercase__:							str         =     1
          lowercase__:							List[str]         =     self.hash_function(UpperCAmelCase_)

          while self.values[new_key] is not None and self.values[new_key] != key:
                 lowercase__:							int         =     (
                     self.__hash_double_function(UpperCAmelCase_					, UpperCAmelCase_					, UpperCAmelCase_)
                     if self.balanced_factor() >= self.lim_charge
                     else None
                 )
                 if new_key is None:
                        break
                 else:
                        i += 1

          return new_key








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


_A       =					{
    "configuration_splinter": ["SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP", "SplinterConfig"],
    "tokenization_splinter": ["SplinterTokenizer"],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A       =					["SplinterTokenizerFast"]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A       =					[
       "SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST",
       "SplinterForQuestionAnswering",
       "SplinterForPreTraining",
       "SplinterLayer",
       "SplinterModel",
       "SplinterPreTrainedModel",
   ]


if TYPE_CHECKING:
   from .configuration_splinter import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig
   from .tokenization_splinter import SplinterTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_splinter_fast import SplinterTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_splinter import (
          SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST,
          SplinterForPreTraining,
          SplinterForQuestionAnswering,
          SplinterLayer,
          SplinterModel,
          SplinterPreTrainedModel,
      )


else:
   import sys

   _A       =					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

