
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.
_A     =  10






def      lowerCamelCase__       (       __lowerCAmelCase						:						int					,							__lowerCAmelCase						:						int					,							__lowerCAmelCase						:						list[int]					,							__lowerCAmelCase						:						int       ):




			"""simple docstring"""


			for i in range(__lowerCAmelCase					,							__lowerCAmelCase       ):
						if array[i] == target:
									return i
			return -1






def      lowerCamelCase__       (       __lowerCAmelCase						:						list[int]					,							__lowerCAmelCase						:						int       ):




			"""simple docstring"""


			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      lowerCamelCase__       (       __lowerCAmelCase						:						int					,							__lowerCAmelCase						:						int					,							__lowerCAmelCase						:						list[int]					,							__lowerCAmelCase						:						int       ):




			"""simple docstring"""


			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()

			_A     =  input("Enter numbers separated by comma:\n").strip()
			_A     =  [int(item.strip()) for item in user_input.split(",")]
			assert collection == sorted(collection), f"List must be ordered.\n{collection}."
			_A     =  int(input("Enter the number to be found in the list:\n").strip())
			_A     =  ite_ternary_search(collection, target)
			_A     =  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")





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


_A     =  logging.get_logger(__name__)

_A     =  {
    "transfo-xl-wt103": "https://huggingface.co/transfo-xl-wt103/resolve/main/config.json",
}





class 			_lowerCAmelCase      (			__a ):
				_lowercase    	='''transfo-xl'''
				_lowercase    	=['''mems''']
				_lowercase    	={
				    '''n_token''': '''vocab_size''',
				    '''hidden_size''': '''d_model''',
				    '''num_attention_heads''': '''n_head''',
				    '''num_hidden_layers''': '''n_layer''',
				}




				def __init__(      self       ,       _UpperCamelCase=267_735       ,       _UpperCamelCase=[20_000, 40_000, 200_000]       ,       _UpperCamelCase=1_024       ,       _UpperCamelCase=1_024       ,       _UpperCamelCase=16       ,       _UpperCamelCase=64       ,       _UpperCamelCase=4_096       ,       _UpperCamelCase=4       ,       _UpperCamelCase=False       ,       _UpperCamelCase=18       ,       _UpperCamelCase=1_600       ,       _UpperCamelCase=1_000       ,       _UpperCamelCase=True       ,       _UpperCamelCase=True       ,       _UpperCamelCase=0       ,       _UpperCamelCase=-1       ,       _UpperCamelCase=True       ,       _UpperCamelCase=0.1       ,       _UpperCamelCase=0.0       ,       _UpperCamelCase=True       ,       _UpperCamelCase="normal"       ,       _UpperCamelCase=0.01       ,       _UpperCamelCase=0.01       ,       _UpperCamelCase=0.02       ,       _UpperCamelCase=1e-5       ,       _UpperCamelCase=0       ,       **_UpperCamelCase       ,       )       ->   Dict:
							lowerCAmelCase_      			=			vocab_size
							lowerCAmelCase_      			=			[]
							self.cutoffs.extend(_UpperCamelCase  )
							if proj_share_all_but_first:
										lowerCAmelCase_      			=			[False] + [True] * len(self.cutoffs  )
							else:
										lowerCAmelCase_      			=			[False] + [False] * len(self.cutoffs  )
							lowerCAmelCase_      			=			d_model
							lowerCAmelCase_      			=			d_embed
							lowerCAmelCase_      			=			d_head
							lowerCAmelCase_      			=			d_inner
							lowerCAmelCase_      			=			div_val
							lowerCAmelCase_      			=			pre_lnorm
							lowerCAmelCase_      			=			n_layer
							lowerCAmelCase_      			=			n_head
							lowerCAmelCase_      			=			mem_len
							lowerCAmelCase_      			=			same_length
							lowerCAmelCase_      			=			attn_type
							lowerCAmelCase_      			=			clamp_len
							lowerCAmelCase_      			=			sample_softmax
							lowerCAmelCase_      			=			adaptive
							lowerCAmelCase_      			=			dropout
							lowerCAmelCase_      			=			dropatt
							lowerCAmelCase_      			=			untie_r
							lowerCAmelCase_      			=			init
							lowerCAmelCase_      			=			init_range
							lowerCAmelCase_      			=			proj_init_std
							lowerCAmelCase_      			=			init_std
							lowerCAmelCase_      			=			layer_norm_epsilon
							super().__init__(eos_token_id=_UpperCamelCase       ,       **_UpperCamelCase  )




				@property
				def   __a		(      self  )       ->   List[Any]:
							# Message copied from Transformer-XL documentation
							logger.info(f"""The model {self.model_type} is one of the few models that has no sequence length limit."""  )
							return -1




				@max_position_embeddings.setter
				def   __a		(      self       ,       _UpperCamelCase  )       ->   str:
							# Message copied from Transformer-XL documentation
							raise NotImplementedError(
							    f"""The model {self.model_type} is one of the few models that has no sequence length limit."""  )



