



'''simple docstring'''






def 				snake_case_  (      _lowerCAmelCase						:		Union[str, Any]     ,   _lowerCAmelCase						:		Tuple						)   ->     Union[str, Any]:
							UpperCAmelCase				: Tuple											=	0
							UpperCAmelCase				: int											=	len(_lowerCAmelCase						) - 1

							while left <= right:
														# avoid divided by 0 during interpolation
														if sorted_collection[left] == sorted_collection[right]:
																					if sorted_collection[left] == item:
																												return left
																					else:
																												return None

														UpperCAmelCase				: Tuple											=	left + ((item - sorted_collection[left]) * (right - left)) // (
														    sorted_collection[right] - sorted_collection[left]
														)

														# out of range check
														if point < 0 or point >= len(_lowerCAmelCase						):
																					return None

														UpperCAmelCase				: str											=	sorted_collection[point]
														if current_item == item:
																					return point
														else:
																					if point < left:
																												UpperCAmelCase				: List[str]											=	left
																												UpperCAmelCase				: List[Any]											=	point
																					elif point > right:
																												UpperCAmelCase				: str											=	right
																												UpperCAmelCase				: Union[str, Any]											=	point
																					else:
																												if item < current_item:
																																			UpperCAmelCase				: Optional[int]											=	point - 1
																												else:
																																			UpperCAmelCase				: Union[str, Any]											=	point + 1
							return None


def 				snake_case_  (      _lowerCAmelCase						:		List[Any]     ,   _lowerCAmelCase						:		Optional[int]     ,   _lowerCAmelCase						:		Dict     ,   _lowerCAmelCase						:		Optional[Any]						)   ->     Any:

							# avoid divided by 0 during interpolation
							if sorted_collection[left] == sorted_collection[right]:
														if sorted_collection[left] == item:
																					return left
														else:
																					return None

							UpperCAmelCase				: Optional[Any]											=	left + ((item - sorted_collection[left]) * (right - left)) // (
							    sorted_collection[right] - sorted_collection[left]
							)

							# out of range check
							if point < 0 or point >= len(_lowerCAmelCase						):
														return None

							if sorted_collection[point] == item:
														return point
							elif point < left:
														return interpolation_search_by_recursion(_lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase						)
							elif point > right:
														return interpolation_search_by_recursion(_lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase						)
							else:
														if sorted_collection[point] > item:
																					return interpolation_search_by_recursion(
																					    _lowerCAmelCase     ,   _lowerCAmelCase     ,   _lowerCAmelCase     ,   point - 1						)
														else:
																					return interpolation_search_by_recursion(
																					    _lowerCAmelCase     ,   _lowerCAmelCase     ,   point + 1     ,   _lowerCAmelCase						)


def 				snake_case_  (      _lowerCAmelCase						:		Dict						)   ->     int:
							if collection != sorted(_lowerCAmelCase						):
														raise ValueError('''Collection must be ascending sorted'''						)
							return True


if __name__ == "__main__":
						import sys
						UpperCamelCase__:     str										=    0
						if debug == 1:
												UpperCamelCase__:     str										=    [10, 30, 40, 45, 50, 66, 77, 93]
												try:
																		__assert_sorted(collection)
												except ValueError:
																		sys.exit('Sequence must be ascending sorted to apply interpolation search')
												UpperCamelCase__:     Dict										=    67

						UpperCamelCase__:     Optional[int]										=    interpolation_search(collection, target)
						if result is not None:
												print(F"{target} found at positions: {result}")
						else:
												print('Not found')










'''simple docstring'''






from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__:     Dict										=    logging.get_logger(__name__)

UpperCamelCase__:     int										=    {
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}

class        SCREAMING_SNAKE_CASE(							A__    ):







	"""simple docstring"""






	lowerCamelCase__    				= """megatron-bert"""







	def __init__(		self    :  int	,    __snake_case    :  List[Any]=29056	,    __snake_case    :  Dict=1024	,    __snake_case    :  Tuple=24	,    __snake_case    :  Any=16	,    __snake_case    :  Tuple=4096	,    __snake_case    :  int="gelu"	,    __snake_case    :  Dict=0.1	,    __snake_case    :  str=0.1	,    __snake_case    :  Optional[Any]=512	,    __snake_case    :  Tuple=2	,    __snake_case    :  Tuple=0.02	,    __snake_case    :  int=1E-12	,    __snake_case    :  Union[str, Any]=0	,    __snake_case    :  int="absolute"	,    __snake_case    :  str=True	,    **__snake_case    :  Tuple	,    )    ->	Union[str, Any]:
								super().__init__(pad_token_id=__snake_case	,    **__snake_case	)

								UpperCAmelCase				: Any											=	vocab_size
								UpperCAmelCase				: Tuple											=	hidden_size
								UpperCAmelCase				: List[Any]											=	num_hidden_layers
								UpperCAmelCase				: str											=	num_attention_heads
								UpperCAmelCase				: Optional[int]											=	hidden_act
								UpperCAmelCase				: Optional[int]											=	intermediate_size
								UpperCAmelCase				: Dict											=	hidden_dropout_prob
								UpperCAmelCase				: List[Any]											=	attention_probs_dropout_prob
								UpperCAmelCase				: Dict											=	max_position_embeddings
								UpperCAmelCase				: Any											=	type_vocab_size
								UpperCAmelCase				: str											=	initializer_range
								UpperCAmelCase				: str											=	layer_norm_eps
								UpperCAmelCase				: Optional[Any]											=	position_embedding_type
								UpperCAmelCase				: str											=	use_cache





