
"""simple docstring"""

import copy
import os
from typing import TYPE_CHECKING, List, Union


if TYPE_CHECKING:
					pass

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


_A						=			logging.get_logger(__name__)

_A						=			{
    'kakaobrain/align-base': 'https://huggingface.co/kakaobrain/align-base/resolve/main/config.json',
}






class 	_lowercase       (    _lowerCamelCase		):
	lowercase_				=     'align_text_model'




	def __init__(			self		,			UpperCAmelCase_=30522		,			UpperCAmelCase_=768		,			UpperCAmelCase_=12		,			UpperCAmelCase_=12		,			UpperCAmelCase_=3072		,			UpperCAmelCase_="gelu"		,			UpperCAmelCase_=0.1		,			UpperCAmelCase_=0.1		,			UpperCAmelCase_=512		,			UpperCAmelCase_=2		,			UpperCAmelCase_=0.02		,			UpperCAmelCase_=1E-1_2		,			UpperCAmelCase_=0		,			UpperCAmelCase_="absolute"		,			UpperCAmelCase_=True		,			**UpperCAmelCase_		,			)		->							int:
			super().__init__(**lowercase_ )

			lowerCamelCase					:      str          =   vocab_size
			lowerCamelCase					:      Optional[Any]          =   hidden_size
			lowerCamelCase					:      Optional[int]          =   num_hidden_layers
			lowerCamelCase					:      Any          =   num_attention_heads
			lowerCamelCase					:      Dict          =   hidden_act
			lowerCamelCase					:      Tuple          =   intermediate_size
			lowerCamelCase					:      Any          =   hidden_dropout_prob
			lowerCamelCase					:      Optional[int]          =   attention_probs_dropout_prob
			lowerCamelCase					:      int          =   max_position_embeddings
			lowerCamelCase					:      Tuple          =   type_vocab_size
			lowerCamelCase					:      Union[str, Any]          =   initializer_range
			lowerCamelCase					:      Optional[int]          =   layer_norm_eps
			lowerCamelCase					:      Tuple          =   position_embedding_type
			lowerCamelCase					:      Union[str, Any]          =   use_cache
			lowerCamelCase					:      int          =   pad_token_id




	@classmethod
	def       _UpperCamelCase   (			cls		,			UpperCAmelCase_		,			**UpperCAmelCase_ )		->							List[str]:
			cls._set_token_in_kwargs(lowercase_ )

			lowerCamelCase     ,   lowerCamelCase					:      int          =   cls.get_config_dict(lowercase_		,			**lowercase_ )

			# get the text config dict if we are loading from AlignConfig
			if config_dict.get('model_type' ) == "align":
					lowerCamelCase					:      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(lowercase_		,			**lowercase_ )






class 	_lowercase       (    _lowerCamelCase		):
	lowercase_				=     'align_vision_model'




	def __init__(			self		,			UpperCAmelCase_ = 3		,			UpperCAmelCase_ = 600		,			UpperCAmelCase_ = 2.0		,			UpperCAmelCase_ = 3.1		,			UpperCAmelCase_ = 8		,			UpperCAmelCase_ = [3, 3, 5, 3, 5, 5, 3]		,			UpperCAmelCase_ = [32, 16, 24, 40, 80, 112, 192]		,			UpperCAmelCase_ = [16, 24, 40, 80, 112, 192, 320]		,			UpperCAmelCase_ = []		,			UpperCAmelCase_ = [1, 2, 2, 2, 1, 2, 1]		,			UpperCAmelCase_ = [1, 2, 2, 3, 3, 4, 1]		,			UpperCAmelCase_ = [1, 6, 6, 6, 6, 6, 6]		,			UpperCAmelCase_ = 0.25		,			UpperCAmelCase_ = "swish"		,			UpperCAmelCase_ = 2560		,			UpperCAmelCase_ = "mean"		,			UpperCAmelCase_ = 0.02		,			UpperCAmelCase_ = 0.001		,			UpperCAmelCase_ = 0.99		,			UpperCAmelCase_ = 0.2		,			**UpperCAmelCase_		,			)		->							Optional[int]:
			super().__init__(**lowercase_ )

			lowerCamelCase					:      Union[str, Any]          =   num_channels
			lowerCamelCase					:      Tuple          =   image_size
			lowerCamelCase					:      List[Any]          =   width_coefficient
			lowerCamelCase					:      Union[str, Any]          =   depth_coefficient
			lowerCamelCase					:      Optional[int]          =   depth_divisor
			lowerCamelCase					:      List[Any]          =   kernel_sizes
			lowerCamelCase					:      str          =   in_channels
			lowerCamelCase					:      str          =   out_channels
			lowerCamelCase					:      Dict          =   depthwise_padding
			lowerCamelCase					:      List[Any]          =   strides
			lowerCamelCase					:      Any          =   num_block_repeats
			lowerCamelCase					:      str          =   expand_ratios
			lowerCamelCase					:      List[str]          =   squeeze_expansion_ratio
			lowerCamelCase					:      List[str]          =   hidden_act
			lowerCamelCase					:      Any          =   hidden_dim
			lowerCamelCase					:      int          =   pooling_type
			lowerCamelCase					:      Optional[Any]          =   initializer_range
			lowerCamelCase					:      List[Any]          =   batch_norm_eps
			lowerCamelCase					:      Optional[Any]          =   batch_norm_momentum
			lowerCamelCase					:      List[str]          =   drop_connect_rate
			lowerCamelCase					:      Optional[Any]          =   sum(lowercase_ ) * 4




	@classmethod
	def       _UpperCamelCase   (			cls		,			UpperCAmelCase_		,			**UpperCAmelCase_ )		->							str:
			cls._set_token_in_kwargs(lowercase_ )

			lowerCamelCase     ,   lowerCamelCase					:      Union[str, Any]          =   cls.get_config_dict(lowercase_		,			**lowercase_ )

			# get the vision config dict if we are loading from AlignConfig
			if config_dict.get('model_type' ) == "align":
					lowerCamelCase					:      int          =   config_dict['vision_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(lowercase_		,			**lowercase_ )






class 	_lowercase       (    _lowerCamelCase		):
	lowercase_				=     'align'
	lowercase_				=     True




	def __init__(			self		,			UpperCAmelCase_=None		,			UpperCAmelCase_=None		,			UpperCAmelCase_=640		,			UpperCAmelCase_=1.0		,			UpperCAmelCase_=0.02		,			**UpperCAmelCase_		,			)		->							Any:
			super().__init__(**lowercase_ )

			if text_config is None:
					lowerCamelCase					:      Tuple          =   {}
					logger.info('text_config is None. Initializing the AlignTextConfig with default values.' )

			if vision_config is None:
					lowerCamelCase					:      Dict          =   {}
					logger.info('vision_config is None. Initializing the AlignVisionConfig with default values.' )

			lowerCamelCase					:      Optional[Any]          =   AlignTextConfig(**lowercase_ )
			lowerCamelCase					:      str          =   AlignVisionConfig(**lowercase_ )

			lowerCamelCase					:      Any          =   projection_dim
			lowerCamelCase					:      Union[str, Any]          =   temperature_init_value
			lowerCamelCase					:      Optional[int]          =   initializer_range




	@classmethod
	def       _UpperCamelCase   (			cls		,			UpperCAmelCase_		,			UpperCAmelCase_		,			**UpperCAmelCase_ )		->							Dict:
			return cls(text_config=text_config.to_dict()		,			vision_config=vision_config.to_dict()		,			**lowercase_ )




	def       _UpperCamelCase   (			self )		->							Optional[int]:
			lowerCamelCase					:      Optional[int]          =   copy.deepcopy(self.__dict__ )
			lowerCamelCase					:      Optional[int]          =   self.text_config.to_dict()
			lowerCamelCase					:      Optional[Any]          =   self.vision_config.to_dict()
			lowerCamelCase					:      Optional[int]          =   self.__class__.model_type
			return output








"""simple docstring"""

def 		UpperCAmelCase (		a_ = 1000      ):





		'''simple docstring'''


		lowerCamelCase					:      Dict          =   2**power
		lowerCamelCase					:      List[str]          =   str(a_      )
		lowerCamelCase					:      Dict          =   list(a_      )
		lowerCamelCase					:      Optional[Any]          =   0

		for i in list_num:
				sum_of_num += int(a_      )

		return sum_of_num


if __name__ == "__main__":
					_A						=			int(input('Enter the power of 2: ').strip())
					print('2 ^ ', power, ' = ', 2**power)
					_A						=			solution(power)
					print('Sum of the digits is: ', result)






