






"""simple docstring"""

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


class 	__lowerCamelCase       (				A__    ):





		'''simple docstring'''






		def __init__(     self							:			List[str]		,    *a_							:			List[str]		,    **a_							:			Dict			):
				super().__init__(*a_		,    **a_			)





		def      lowerCamelCase (     self							:			Tuple		,    a_							:			str		,    a_							:			List[str]			):
				lowerCAmelCase_     :							List[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      lowerCamelCase (     self							:			int		,    a_							:			Union[str, Any]		,    a_							:			Dict		,    a_							:			int			):
				return (increment * self.__hash_function_a(a_		,    a_			)) % self.size_table





		def      lowerCamelCase (     self							:			Optional[Any]		,    a_							:			Any		,    a_							:			List[str]=None			):
				lowerCAmelCase_     :							Union[str, Any]             =    1
				lowerCAmelCase_     :							Tuple             =    self.hash_function(a_			)

				while self.values[new_key] is not None and self.values[new_key] != key:
						lowerCAmelCase_     :							List[Any]             =    (
						    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








"""simple docstring"""

from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
    is_vision_available,
)


lowercase__      =				{
    """configuration_mobilevitv2""": [
        """MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """MobileViTV2Config""",
        """MobileViTV2OnnxConfig""",
    ],
}


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowercase__      =				[
					    """MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """MobileViTV2ForImageClassification""",
					    """MobileViTV2ForSemanticSegmentation""",
					    """MobileViTV2Model""",
					    """MobileViTV2PreTrainedModel""",
					]

if TYPE_CHECKING:
					from .configuration_mobilevitva import (
					    MOBILEVITV2_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    MobileViTVaConfig,
					    MobileViTVaOnnxConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_mobilevitva import (
										    MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
										    MobileViTVaForImageClassification,
										    MobileViTVaForSemanticSegmentation,
										    MobileViTVaModel,
										    MobileViTVaPreTrainedModel,
										)

else:
					import sys

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