





"""simple docstring"""
from __future__ import annotations






def    A__							(     UpperCamelCase   ,    UpperCamelCase			):
							A,      A						=    0, len(UpperCamelCase			) - 1
							while start_ind <= end_ind:
														if array[start_ind] == search_item:
																					return start_ind
														elif array[end_ind] == search_item:
																					return end_ind
														else:
																					start_ind += 1
																					end_ind -= 1
    # returns -1 if search_item is not found in array
							return -1


if __name__ == "__main__":
		print(double_linear_search(list(range(100)), 40))









"""simple docstring"""
import copy

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


_snake_case	:						int					=					logging.get_logger(__name__)

_snake_case	:						Optional[int]					=					{}






class    _UpperCAmelCase  (      lowercase_					):
					UpperCamelCase						=				'''fsmt_decoder'''


					def __init__(   self     :Optional[int]	,			__UpperCamelCase     :Tuple=0	,			__UpperCamelCase     :List[str]=0						):
												super().__init__()
												A						=    vocab_size
												A						=    bos_token_id







class    _UpperCAmelCase  (      lowercase_					):
					UpperCamelCase						=				'''fsmt'''
					UpperCamelCase						=				{'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}


					def __init__(   self     :Dict	,			__UpperCamelCase     :List[str]=["en", "de"]	,			__UpperCamelCase     :List[str]=4_20_24	,			__UpperCamelCase     :Dict=4_20_24	,			__UpperCamelCase     :Tuple="relu"	,			__UpperCamelCase     :Optional[Any]=10_24	,			__UpperCamelCase     :Dict=2_00	,			__UpperCamelCase     :Optional[Any]=10_24	,			__UpperCamelCase     :Optional[Any]=40_96	,			__UpperCamelCase     :Union[str, Any]=12	,			__UpperCamelCase     :Dict=16	,			__UpperCamelCase     :Optional[Any]=0.0	,			__UpperCamelCase     :Dict=40_96	,			__UpperCamelCase     :Dict=12	,			__UpperCamelCase     :str=16	,			__UpperCamelCase     :Any=0.0	,			__UpperCamelCase     :str=0.0	,			__UpperCamelCase     :List[Any]=0.1	,			__UpperCamelCase     :List[Any]=0.0	,			__UpperCamelCase     :str=0.02	,			__UpperCamelCase     :List[str]=2	,			__UpperCamelCase     :Union[str, Any]=True	,			__UpperCamelCase     :Optional[Any]=True	,			__UpperCamelCase     :int=False	,			__UpperCamelCase     :List[str]=5	,			__UpperCamelCase     :Optional[int]=1.0	,			__UpperCamelCase     :List[str]=False	,			__UpperCamelCase     :Any=True	,			__UpperCamelCase     :List[str]=1	,			__UpperCamelCase     :int=0	,			__UpperCamelCase     :str=2	,			__UpperCamelCase     :Dict=2	,			**__UpperCamelCase     :Optional[int]	,			):
												A						=    langs
												A						=    src_vocab_size
												A						=    tgt_vocab_size
												A						=    d_model  # encoder_embed_dim and decoder_embed_dim

												A						=    encoder_ffn_dim
												A						=    A						=    encoder_layers
												A						=    encoder_attention_heads
												A						=    encoder_layerdrop
												A						=    decoder_layerdrop
												A						=    decoder_ffn_dim
												A						=    decoder_layers
												A						=    decoder_attention_heads
												A						=    max_position_embeddings
												A						=    init_std  # Normal(0, this parameter)
												A						=    activation_function

												A						=    DecoderConfig(vocab_size=__UpperCamelCase	,			bos_token_id=__UpperCamelCase						)
												if "decoder" in common_kwargs:
																			del common_kwargs["decoder"]

												A						=    scale_embedding  # scale factor will be sqrt(d_model) if True

												# 3 Types of Dropout
												A						=    attention_dropout
												A						=    activation_dropout
												A						=    dropout

												A						=    use_cache
												super().__init__(
												    pad_token_id=__UpperCamelCase	,			bos_token_id=__UpperCamelCase	,			eos_token_id=__UpperCamelCase	,			decoder_start_token_id=__UpperCamelCase	,			is_encoder_decoder=__UpperCamelCase	,			tie_word_embeddings=__UpperCamelCase	,			forced_eos_token_id=__UpperCamelCase	,			max_length=__UpperCamelCase	,			num_beams=__UpperCamelCase	,			length_penalty=__UpperCamelCase	,			early_stopping=__UpperCamelCase	,			**__UpperCamelCase	,			)


					def       lowerCamelCase			(   self     :List[str]						):
												A						=    copy.deepcopy(self.__dict__						)
												A						=    self.decoder.to_dict()
												A						=    self.__class__.model_type
												return output


