


'''simple docstring'''



import copy
import os
from typing import Union

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


__UpperCAmelCase				       =     logging.get_logger(__name__)

__UpperCAmelCase				       =     {
    "BridgeTower/bridgetower-base": "https://huggingface.co/BridgeTower/bridgetower-base/blob/main/config.json",
    "BridgeTower/bridgetower-base-itm-mlm": (
        "https://huggingface.co/BridgeTower/bridgetower-base-itm-mlm/blob/main/config.json"
    ),
}



class 			a       (	_a ):


     """simple docstring"""






     SCREAMING_SNAKE_CASE :				Union[str, Any]							     =     "bridgetower_vision_model"

     def __init__(       self  :	Union[str, Any]							,				snake_case  :	Optional[int]=768							,				snake_case  :	int=12							,				snake_case  :	Union[str, Any]=3							,				snake_case  :	List[Any]=16							,				snake_case  :	Optional[Any]=288							,				snake_case  :	List[Any]=1							,				snake_case  :	Optional[int]=1E-05							,				snake_case  :	Tuple=False							,				snake_case  :	Tuple=True							,				snake_case  :	Union[str, Any]=False							,				**snake_case  :	List[str]							,				)		->							Optional[Any]:
          super().__init__(**__a    )
          __UpperCAmelCase			:				List[Any]													=    hidden_size
          __UpperCAmelCase			:				Optional[Any]													=    num_hidden_layers
          __UpperCAmelCase			:				int													=    num_channels
          __UpperCAmelCase			:				Union[str, Any]													=    patch_size
          __UpperCAmelCase			:				Dict													=    image_size
          __UpperCAmelCase			:				Union[str, Any]													=    initializer_factor
          __UpperCAmelCase			:				Optional[int]													=    layer_norm_eps
          __UpperCAmelCase			:				str													=    stop_gradient
          __UpperCAmelCase			:				Optional[int]													=    share_layernorm
          __UpperCAmelCase			:				Union[str, Any]													=    remove_last_layer






     @classmethod
     def 				lowerCamelCase__				(       cls  :	Dict							,				snake_case  :	Dict							,				**snake_case  :	Union[str, Any]    )		->							"PretrainedConfig":
          __UpperCAmelCase							,     __UpperCAmelCase			:				Optional[Any]													=    cls.get_config_dict(__a							,				**__a    )

          if config_dict.get('''model_type'''    ) == "bridgetower":
               __UpperCAmelCase			:				Any													=    config_dict['''text_config''']

          if "model_type" in config_dict and hasattr(cls							,				'''model_type'''    ) and config_dict["model_type"] != cls.model_type:
               logger.warning(
                   f'You are using a model of type {config_dict["model_type"]} to instantiate a model of type '
                   f'{cls.model_type}. This is not supported for all configurations of models and can yield errors.'    )

          return cls.from_dict(__a							,				**__a    )



class 			a       (	_a ):


     """simple docstring"""






     SCREAMING_SNAKE_CASE :				Any							     =     "bridgetower_text_model"

     def __init__(       self  :	Tuple							,				snake_case  :	Any=5_0265							,				snake_case  :	Dict=768							,				snake_case  :	Dict=12							,				snake_case  :	str=12							,				snake_case  :	List[Any]=1							,				snake_case  :	List[str]=3072							,				snake_case  :	Optional[int]="gelu"							,				snake_case  :	Any=0.1							,				snake_case  :	List[str]=0.1							,				snake_case  :	Optional[int]=514							,				snake_case  :	List[Any]=1							,				snake_case  :	Any=1E-05							,				snake_case  :	Union[str, Any]=1							,				snake_case  :	List[Any]=0							,				snake_case  :	Optional[Any]=2							,				snake_case  :	int="absolute"							,				snake_case  :	List[str]=True							,				**snake_case  :	Union[str, Any]							,				)		->							Optional[int]:
          super().__init__(**__a    )

          __UpperCAmelCase			:				Optional[Any]													=    vocab_size
          __UpperCAmelCase			:				Optional[int]													=    hidden_size
          __UpperCAmelCase			:				Optional[int]													=    num_hidden_layers
          __UpperCAmelCase			:				Union[str, Any]													=    num_attention_heads
          __UpperCAmelCase			:				Tuple													=    hidden_act
          __UpperCAmelCase			:				str													=    initializer_factor
          __UpperCAmelCase			:				Dict													=    intermediate_size
          __UpperCAmelCase			:				int													=    hidden_dropout_prob
          __UpperCAmelCase			:				Any													=    attention_probs_dropout_prob
          __UpperCAmelCase			:				Tuple													=    max_position_embeddings
          __UpperCAmelCase			:				Union[str, Any]													=    type_vocab_size
          __UpperCAmelCase			:				str													=    layer_norm_eps
          __UpperCAmelCase			:				List[str]													=    position_embedding_type
          __UpperCAmelCase			:				Any													=    use_cache
          __UpperCAmelCase			:				Union[str, Any]													=    pad_token_id
          __UpperCAmelCase			:				List[str]													=    bos_token_id
          __UpperCAmelCase			:				List[str]													=    eos_token_id






     @classmethod
     def 				lowerCamelCase__				(       cls  :	int							,				snake_case  :	Union[str, Any]							,				**snake_case  :	Optional[Any]    )		->							"PretrainedConfig":
          __UpperCAmelCase							,     __UpperCAmelCase			:				Any													=    cls.get_config_dict(__a							,				**__a    )

          if config_dict.get('''model_type'''    ) == "bridgetower":
               __UpperCAmelCase			:				Optional[Any]													=    config_dict['''text_config''']

          if "model_type" in config_dict and hasattr(cls							,				'''model_type'''    ) and config_dict["model_type"] != cls.model_type:
               logger.warning(
                   f'You are using a model of type {config_dict["model_type"]} to instantiate a model of type '
                   f'{cls.model_type}. This is not supported for all configurations of models and can yield errors.'    )

          return cls.from_dict(__a							,				**__a    )



class 			a       (	_a ):


     """simple docstring"""






     SCREAMING_SNAKE_CASE :				Dict							     =     "bridgetower"

     def __init__(       self  :	Optional[int]							,				snake_case  :	Any=True							,				snake_case  :	int="gelu"							,				snake_case  :	Dict=768							,				snake_case  :	Dict=1							,				snake_case  :	int=1E-05							,				snake_case  :	Union[str, Any]=False							,				snake_case  :	List[str]="add"							,				snake_case  :	Union[str, Any]=12							,				snake_case  :	Any=6							,				snake_case  :	Any=False							,				snake_case  :	Any=False							,				snake_case  :	Any=None							,				snake_case  :	List[str]=None							,				**snake_case  :	int							,				)		->							Union[str, Any]:
          __UpperCAmelCase			:				List[Any]													=    kwargs.pop('''text_config_dict'''							,				__a    )
          __UpperCAmelCase			:				Optional[Any]													=    kwargs.pop('''vision_config_dict'''							,				__a    )

          super().__init__(**__a    )
          __UpperCAmelCase			:				List[Any]													=    share_cross_modal_transformer_layers
          __UpperCAmelCase			:				Dict													=    hidden_act
          __UpperCAmelCase			:				List[Any]													=    hidden_size
          __UpperCAmelCase			:				Any													=    initializer_factor
          __UpperCAmelCase			:				Any													=    layer_norm_eps
          __UpperCAmelCase			:				List[str]													=    share_link_tower_layers
          __UpperCAmelCase			:				Dict													=    link_tower_type
          __UpperCAmelCase			:				Tuple													=    num_attention_heads
          __UpperCAmelCase			:				Optional[int]													=    num_hidden_layers
          __UpperCAmelCase			:				List[str]													=    tie_word_embeddings
          __UpperCAmelCase			:				Any													=    init_layernorm_from_vision_encoder

          if text_config is None:
               __UpperCAmelCase			:				Optional[Any]													=    {}
               logger.info('''`text_config` is `None`. Initializing the `BridgeTowerTextConfig` with default values.'''    )

          if vision_config is None:
               __UpperCAmelCase			:				str													=    {}
               logger.info('''`vision_config` is `None`. Initializing the `BridgeTowerVisionConfig` with default values.'''    )

          __UpperCAmelCase			:				Union[str, Any]													=    BridgeTowerTextConfig(**__a    )
          __UpperCAmelCase			:				List[str]													=    BridgeTowerVisionConfig(**__a    )

     @classmethod
     def 				lowerCamelCase__				(       cls  :	Union[str, Any]							,				snake_case  :	Optional[int]							,				snake_case  :	Union[str, Any]							,				**snake_case  :	Optional[int]    )		->							Dict:
          return cls(text_config=text_config.to_dict()							,				vision_config=vision_config.to_dict()							,				**__a    )






     def 				lowerCamelCase__				(       self  :	Tuple    )		->							Dict:
          __UpperCAmelCase			:				List[str]													=    copy.deepcopy(self.__dict__    )
          __UpperCAmelCase			:				Any													=    self.text_config.to_dict()
          __UpperCAmelCase			:				str													=    self.vision_config.to_dict()
          __UpperCAmelCase			:				Tuple													=    self.__class__.model_type
          return output



'''simple docstring'''



def 			_a			(		_lowercase      :			int = 50000000						):





     '''simple docstring'''






     __UpperCAmelCase			:				List[str]													=    set()
     __UpperCAmelCase			:				Tuple													=    int((limit - 24) ** (1 / 2)						)

     __UpperCAmelCase			:				Tuple													=    set(range(3    ,      prime_square_limit + 1    ,      2						)						)
     primes.add(2						)
     for p in range(3    ,      prime_square_limit + 1    ,      2						):
          if p not in primes:
               continue
          primes.difference_update(set(range(p * p    ,      prime_square_limit + 1    ,      _lowercase						)						)						)

     for primea in primes:
          __UpperCAmelCase			:				Any													=    primea * primea
          for primea in primes:
               __UpperCAmelCase			:				Any													=    primea * primea * primea
               if square + cube >= limit - 16:
                    break
               for primea in primes:
                    __UpperCAmelCase			:				Optional[Any]													=    primea * primea * primea * primea
                    __UpperCAmelCase			:				Union[str, Any]													=    square + cube + tetr
                    if total >= limit:
                         break
                    ret.add(_lowercase						)

     return len(_lowercase						)


if __name__ == "__main__":
      print(f"""{solution() = }""")