






"""simple docstring"""





import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


_SCREAMING_SNAKE_CASE :    Union[str, Any]    =						logging.get_logger(__name__)






class 					a						( __snake_case		):
    SCREAMING_SNAKE_CASE						:					List[str]						=			"""speech-encoder-decoder"""
    SCREAMING_SNAKE_CASE						:					List[str]						=			True






    def __init__(	self					:							Dict	,						**__SCREAMING_SNAKE_CASE					:							str )					->		List[Any]:
      super().__init__(**__SCREAMING_SNAKE_CASE )
      if "encoder" not in kwargs or "decoder" not in kwargs:
        raise ValueError(
            F'''A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and'''
            F''' `decoder` sub-configurations are passed, but only {kwargs}''' )

      lowerCamelCase_   					=						kwargs.pop('encoder' )
      lowerCamelCase_   					=						encoder_config.pop('model_type' )
      lowerCamelCase_   					=						kwargs.pop('decoder' )
      lowerCamelCase_   					=						decoder_config.pop('model_type' )

      lowerCamelCase_   					=						AutoConfig.for_model(__SCREAMING_SNAKE_CASE	,						**__SCREAMING_SNAKE_CASE )
      lowerCamelCase_   					=						AutoConfig.for_model(__SCREAMING_SNAKE_CASE	,						**__SCREAMING_SNAKE_CASE )
      lowerCamelCase_   					=						True






    @classmethod
    def        UpperCamelCase	(	cls					:							Tuple	,						__SCREAMING_SNAKE_CASE					:							PretrainedConfig	,						__SCREAMING_SNAKE_CASE					:							PretrainedConfig	,						**__SCREAMING_SNAKE_CASE					:							Tuple )					->		PretrainedConfig:
      logger.info('Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config' )
      lowerCamelCase_   					=						True
      lowerCamelCase_   					=						True

      return cls(encoder=encoder_config.to_dict()	,						decoder=decoder_config.to_dict()	,						**__SCREAMING_SNAKE_CASE )






    def        UpperCamelCase	(	self					:							List[str] )					->		Optional[Any]:
      lowerCamelCase_   					=						copy.deepcopy(self.__dict__ )
      lowerCamelCase_   					=						self.encoder.to_dict()
      lowerCamelCase_   					=						self.decoder.to_dict()
      lowerCamelCase_   					=						self.__class__.model_type
      return output












"""simple docstring"""





from __future__ import annotations







def 					lowerCamelCase__	(							_lowerCamelCase	:		list[int]		,    _lowerCamelCase	:		int			)				->    int:
  lowerCamelCase_					,     lowerCamelCase_   					=						0, len(_lowerCamelCase			) - 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))




