code: 
  
  
  
  
  
  
  import copy
  
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  from ..auto.configuration_auto import AutoConfig
  from ..clip.configuration_clip import CLIPVisionConfig
  
  
  lowerCamelCase			:							Any       =logging.get_logger(__name__)
  
  
  
  
  
  class     __a						(					A__ ):
   _lowerCAmelCase : Dict 				=				'''vision-text-dual-encoder'''
   _lowerCAmelCase : Dict 				=				True
  
  
  
  
  
  
  
   def __init__(	self      :     Optional[int]							,     SCREAMING_SNAKE_CASE      :     Tuple=5_12							,     SCREAMING_SNAKE_CASE      :     List[str]=2.6_5_9_2							,     **SCREAMING_SNAKE_CASE      :     Union[str, Any]		):
  
  
        '''simple docstring'''
  
  
  
  
  
  
        super().__init__(**SCREAMING_SNAKE_CASE		)
  
        if "vision_config" not in kwargs:
             raise ValueError("`vision_config` can not be `None`."		)
  
        if "text_config" not in kwargs:
             raise ValueError("`text_config` can not be `None`."		)
  
        UpperCamelCase__    :     Dict        = kwargs.pop("vision_config"		)
        UpperCamelCase__    :     str        = kwargs.pop("text_config"		)
  
        UpperCamelCase__    :     Optional[Any]        = vision_config.pop("model_type"		)
        UpperCamelCase__    :     Union[str, Any]        = text_config.pop("model_type"		)
  
        if vision_model_type == "clip":
             UpperCamelCase__    :     Optional[Any]        = AutoConfig.for_model(SCREAMING_SNAKE_CASE							,     **SCREAMING_SNAKE_CASE		).vision_config
        elif vision_model_type == "clip_vision_model":
             UpperCamelCase__    :     Optional[int]        = CLIPVisionConfig(**SCREAMING_SNAKE_CASE		)
        else:
             UpperCamelCase__    :     str        = AutoConfig.for_model(SCREAMING_SNAKE_CASE							,     **SCREAMING_SNAKE_CASE		)
  
        UpperCamelCase__    :     int        = AutoConfig.for_model(SCREAMING_SNAKE_CASE							,     **SCREAMING_SNAKE_CASE		)
  
        UpperCamelCase__    :     Any        = projection_dim
        UpperCamelCase__    :     List[str]        = logit_scale_init_value
  
  
  
  
  
  
  
   @classmethod
   def       __lowercase      (	cls      :     List[str]							,     SCREAMING_SNAKE_CASE      :     int							,     SCREAMING_SNAKE_CASE      :     List[str]							,     **SCREAMING_SNAKE_CASE      :     int		):
  
  
        '''simple docstring'''
  
  
  
  
  
  
        return cls(vision_config=vision_config.to_dict()							,     text_config=text_config.to_dict()							,     **SCREAMING_SNAKE_CASE		)
  
  
  
  
  
  
  
   def       __lowercase      (	self      :     int		):
  
  
        '''simple docstring'''
  
  
  
  
  
  
        UpperCamelCase__    :     Optional[int]        = copy.deepcopy(self.__dict__		)
        UpperCamelCase__    :     Tuple        = self.vision_config.to_dict()
        UpperCamelCase__    :     Dict        = self.text_config.to_dict()
        UpperCamelCase__    :     Optional[Any]        = self.__class__.model_type
        return output
style_context: 
  
  
  
  
  
  
  from __future__ import annotations
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase    )				->			list[int]:
       if not list_of_ints:
            return []
  
       if min(__lowerCAmelCase    ) < 0:
            raise ValueError("All numbers must be positive"    )
  
       UpperCamelCase__    :     Dict        =						max(len(bin(__lowerCAmelCase    )[2:]    ) for x in list_of_ints    )
       return _msd_radix_sort(__lowerCAmelCase      ,					__lowerCAmelCase    )
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase      ,					__lowerCAmelCase    )				->			list[int]:
       if bit_position == 0 or len(__lowerCAmelCase    ) in [0, 1]:
            return list_of_ints
  
       UpperCamelCase__    :     Union[str, Any]        =						[]
       UpperCamelCase__    :     Dict        =						[]
       # Split numbers based on bit at bit_position from the right
       for number in list_of_ints:
            if (number >> (bit_position - 1)) & 1:
                 # number has a one at bit bit_position
                 ones.append(__lowerCAmelCase    )
            else:
                 # number has a zero at bit bit_position
                 zeros.append(__lowerCAmelCase    )
  
      # recursively split both lists further
       UpperCamelCase__    :     str        =						_msd_radix_sort(__lowerCAmelCase      ,					bit_position - 1    )
       UpperCamelCase__    :     Optional[Any]        =						_msd_radix_sort(__lowerCAmelCase      ,					bit_position - 1    )
  
       # recombine lists
       UpperCamelCase__    :     Optional[int]        =						zeros
       res.extend(__lowerCAmelCase    )
  
       return res
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase    )				->			Dict:
       UpperCamelCase__    :     Optional[int]        =						len(__lowerCAmelCase    )
       if not list_of_ints or length == 1:
            return
  
       if min(__lowerCAmelCase    ) < 0:
            raise ValueError("All numbers must be positive"    )
  
       UpperCamelCase__    :     int        =						max(len(bin(__lowerCAmelCase    )[2:]    ) for x in list_of_ints    )
       _msd_radix_sort_inplace(__lowerCAmelCase      ,					__lowerCAmelCase      ,					0      ,					__lowerCAmelCase    )
  
  
  
  
  
  
  
  def 	SCREAMING_SNAKE_CASE							(      __lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase    )				->			List[str]:
       if bit_position == 0 or end_index - begin_index <= 1:
            return
  
       bit_position -= 1
  
       UpperCamelCase__    :     Any        =						begin_index
       UpperCamelCase__    :     List[str]        =						end_index - 1
       while i <= j:
            UpperCamelCase__    :     Tuple        =						False
            if not (list_of_ints[i] >> bit_position) & 1:
                 # found zero at the beginning
                 i += 1
                 UpperCamelCase__    :     Any        =						True
            if (list_of_ints[j] >> bit_position) & 1:
                 # found one at the end
                 j -= 1
                 UpperCamelCase__    :     Dict        =						True
  
            if changed:
                 continue
  
            UpperCamelCase__       ,  UpperCamelCase__    :     Any        =						list_of_ints[j], list_of_ints[i]
            j -= 1
            if j != i:
                 i += 1
  
       _msd_radix_sort_inplace(__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase    )
       _msd_radix_sort_inplace(__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase      ,					__lowerCAmelCase    )
  
  
  if __name__ == "__main__":
   import doctest
  
   doctest.testmod()