





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

class      A_	(a_      ):
 def __init__(   self							, *_A							, **_A		):






    '''simple docstring'''







    super().__init__(*_A							, **_A		)
 def 					_lowercase    (   self							, _A							, _A		):






    '''simple docstring'''







    UpperCAmelCase       		=    (
        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							, _A							, _A							, _A		):






    '''simple docstring'''







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







 def 					_lowercase    (   self							, _A							, _A=None		):






    '''simple docstring'''







    UpperCAmelCase       		=    1
    UpperCAmelCase       		=    self.hash_function(_A		)

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

    return new_key










import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


__A    :   Optional[int]          =       logging.get_logger(__name__)

class      A_	(a_      ):
	UpperCAmelCase__ =      '''speech-encoder-decoder'''
	UpperCAmelCase__ =      True
	def __init__(   self							, **_A		):






				'''simple docstring'''







				super().__init__(**_A		)
				if "encoder" not in kwargs or "decoder" not in kwargs:
							raise ValueError(
							    F"""A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and"""
							    F""" `decoder` sub-configurations are passed, but only {kwargs}"""		)

				UpperCAmelCase       		=    kwargs.pop('''encoder'''		)
				UpperCAmelCase       		=    encoder_config.pop('''model_type'''		)
				UpperCAmelCase       		=    kwargs.pop('''decoder'''		)
				UpperCAmelCase       		=    decoder_config.pop('''model_type'''		)

				UpperCAmelCase       		=    AutoConfig.for_model(_A							, **_A		)
				UpperCAmelCase       		=    AutoConfig.for_model(_A							, **_A		)
				UpperCAmelCase       		=    True
	@classmethod
	def 					_lowercase    (   cls							, _A							, _A							, **_A		):






				'''simple docstring'''







				logger.info('''Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'''		)
				UpperCAmelCase       		=    True
				UpperCAmelCase       		=    True

				return cls(encoder=encoder_config.to_dict()							, decoder=decoder_config.to_dict()							, **_A		)







	def 					_lowercase    (   self		):






				'''simple docstring'''







				UpperCAmelCase       		=    copy.deepcopy(self.__dict__		)
				UpperCAmelCase       		=    self.encoder.to_dict()
				UpperCAmelCase       		=    self.decoder.to_dict()
				UpperCAmelCase       		=    self.__class__.model_type
				return output



