
'''simple docstring'''



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


_lowercase    =		logging.get_logger(__name__)

_lowercase    =		{
    """bigcode/gpt_bigcode-santacoder""": """https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json""",
}




class   UpperCAmelCase_					(		_SCREAMING_SNAKE_CASE			):






						'''simple docstring'''






						_lowercase		:				int									=       '''gpt_bigcode'''
						_lowercase		:				Optional[int]									=       ['''past_key_values''']
						_lowercase		:				Dict									=       {
						    '''hidden_size''': '''n_embd''',
						    '''max_position_embeddings''': '''n_positions''',
						    '''num_attention_heads''': '''n_head''',
						    '''num_hidden_layers''': '''n_layer''',
						}




						def __init__( self   ,       _lowercase=50_257   ,       _lowercase=1_024   ,       _lowercase=768   ,       _lowercase=12   ,       _lowercase=12   ,       _lowercase=None   ,       _lowercase="gelu_pytorch_tanh"   ,       _lowercase=0.1   ,       _lowercase=0.1   ,       _lowercase=0.1   ,       _lowercase=1e-5   ,       _lowercase=0.02   ,       _lowercase=True   ,       _lowercase=True   ,       _lowercase=50_256   ,       _lowercase=50_256   ,       _lowercase=True   ,       _lowercase=True   ,       _lowercase=True   ,       **_lowercase   ,       ):

												"""simple docstring"""



												_lowerCAmelCase  						=			vocab_size
												_lowerCAmelCase  						=			n_positions
												_lowerCAmelCase  						=			n_embd
												_lowerCAmelCase  						=			n_layer
												_lowerCAmelCase  						=			n_head
												_lowerCAmelCase  						=			n_inner
												_lowerCAmelCase  						=			activation_function
												_lowerCAmelCase  						=			resid_pdrop
												_lowerCAmelCase  						=			embd_pdrop
												_lowerCAmelCase  						=			attn_pdrop
												_lowerCAmelCase  						=			layer_norm_epsilon
												_lowerCAmelCase  						=			initializer_range
												_lowerCAmelCase  						=			scale_attn_weights
												_lowerCAmelCase  						=			use_cache
												_lowerCAmelCase  						=			attention_softmax_in_fpaa
												_lowerCAmelCase  						=			scale_attention_softmax_in_fpaa
												_lowerCAmelCase  						=			multi_query

												_lowerCAmelCase  						=			bos_token_id
												_lowerCAmelCase  						=			eos_token_id

												super().__init__(bos_token_id=_lowercase   ,       eos_token_id=_lowercase   ,       **_lowercase				)


'''simple docstring'''



from __future__ import annotations

# This is the precision for this function which can be altered.
# It is recommended for users to keep this number greater than or equal to 10.
_lowercase    =		10


def A				(__lowerCamelCase				:int			,     __lowerCamelCase				:int			,     __lowerCamelCase				:list[int]			,     __lowerCamelCase				:int		):
						for i in range(__lowerCamelCase			,     __lowerCamelCase		):
												if array[i] == target:
																		return i
						return -1


def A				(__lowerCamelCase				:list[int]			,     __lowerCamelCase				:int		):
						_lowerCAmelCase  						=			0
						_lowerCAmelCase  						=			len(__lowerCamelCase		)
						while left <= right:
												if right - left < precision:
																		return lin_search(__lowerCamelCase			,     __lowerCamelCase			,     __lowerCamelCase			,     __lowerCamelCase		)

												_lowerCAmelCase  						=			(left + right) // 3 + 1
												_lowerCAmelCase  						=			2 * (left + right) // 3 + 1

												if array[one_third] == target:
																		return one_third
												elif array[two_third] == target:
																		return two_third

												elif target < array[one_third]:
																		_lowerCAmelCase  						=			one_third - 1
												elif array[two_third] < target:
																		_lowerCAmelCase  						=			two_third + 1

												else:
																		_lowerCAmelCase  						=			one_third + 1
																		_lowerCAmelCase  						=			two_third - 1
						else:
												return -1


def A				(__lowerCamelCase				:int			,     __lowerCamelCase				:int			,     __lowerCamelCase				:list[int]			,     __lowerCamelCase				:int		):
						if left < right:
												if right - left < precision:
																		return lin_search(__lowerCamelCase			,     __lowerCamelCase			,     __lowerCamelCase			,     __lowerCamelCase		)
												_lowerCAmelCase  						=			(left + right) // 3 + 1
												_lowerCAmelCase  						=			2 * (left + right) // 3 + 1

												if array[one_third] == target:
																		return one_third
												elif array[two_third] == target:
																		return two_third

												elif target < array[one_third]:
																		return rec_ternary_search(__lowerCamelCase			,     one_third - 1			,     __lowerCamelCase			,     __lowerCamelCase		)
												elif array[two_third] < target:
																		return rec_ternary_search(two_third + 1			,     __lowerCamelCase			,     __lowerCamelCase			,     __lowerCamelCase		)
												else:
																		return rec_ternary_search(one_third + 1			,     two_third - 1			,     __lowerCamelCase			,     __lowerCamelCase		)
						else:
												return -1


if __name__ == "__main__":
						import doctest

						doctest.testmod()

						_lowercase    =		input("""Enter numbers separated by comma:\n""").strip()
						_lowercase    =		[int(item.strip()) for item in user_input.split(""",""")]
						assert collection == sorted(collection), F"List must be ordered.\n{collection}."
						_lowercase    =		int(input("""Enter the number to be found in the list:\n""").strip())
						_lowercase    =		ite_ternary_search(collection, target)
						_lowercase    =		rec_ternary_search(0, len(collection) - 1, collection, target)
						if resulta != -1:
												print(F"""Iterative search: {target} found at positions: {resulta}""")
												print(F"""Recursive search: {target} found at positions: {resulta}""")
						else:
												print("""Not found""")
