



'''simple docstring'''


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







class 						UpperCAmelCase						(		__a):


 '''simple docstring'''




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



      """simple docstring"""







      super().__init__(*lowerCAmelCase_				,	**lowerCAmelCase_)




 def    lowercase_	( self				,	lowerCAmelCase_				,	lowerCAmelCase_)			->   Any:



      """simple docstring"""







      a_									=(
          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				,	lowerCAmelCase_				,	lowerCAmelCase_				,	lowerCAmelCase_)			->   Any:



      """simple docstring"""







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




 def    lowercase_	( self				,	lowerCAmelCase_				,	lowerCAmelCase_=None)			->   Any:



      """simple docstring"""







      a_									=1
      a_									=self.hash_function(lowerCAmelCase_)

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

      return new_key







'''simple docstring'''


from dataclasses import dataclass
from typing import Callable, Optional

import datasets







@dataclass
class 						UpperCAmelCase						(		datasets.BuilderConfig):


 '''simple docstring'''




 __magic_name__       :			Optional[Callable]	=   None
 __magic_name__       :			Optional[dict]	=   None
 __magic_name__       :			Optional[datasets.Features]	=   None




 def    lowercase_	( self)			->   List[Any]:



      """simple docstring"""







      assert self.generator is not None, "generator must be specified"

      if self.gen_kwargs is None:
           a_									={}







class 						UpperCAmelCase						(		datasets.GeneratorBasedBuilder):


 '''simple docstring'''




 __magic_name__       :			Tuple	=   GeneratorConfig




 def    lowercase_	( self)			->   Tuple:



      """simple docstring"""







      return datasets.DatasetInfo(features=self.config.features)




 def    lowercase_	( self				,	lowerCAmelCase_)			->   int:



      """simple docstring"""







      return [datasets.SplitGenerator(name=datasets.Split.TRAIN				,	gen_kwargs=self.config.gen_kwargs)]




 def    lowercase_	( self				,	**lowerCAmelCase_)			->   List[Any]:



      """simple docstring"""







      for idx, ex in enumerate(self.config.generator(**lowerCAmelCase_)):
           yield idx, ex


