




'''simple docstring'''


import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING


UpperCamelCase       			= logging.get_logger(__name__)

UpperCamelCase       			= {
    """ut/deta""": """https://huggingface.co/ut/deta/resolve/main/config.json""",
}






class 		lowerCAmelCase_     (    _UpperCAmelCase				):







  '''simple docstring'''

  UpperCamelCase_       :	Optional[int]				       =							'''deta'''
  UpperCamelCase_       :	Optional[int]				       =							{
      '''hidden_size''': '''d_model''',
      '''num_attention_heads''': '''encoder_attention_heads''',
  }



  def __init__(      self							:				Optional[Any] ,   SCREAMING_SNAKE_CASE_							:				Tuple=None ,   SCREAMING_SNAKE_CASE_							:				str=9_00 ,   SCREAMING_SNAKE_CASE_							:				int=20_48 ,   SCREAMING_SNAKE_CASE_							:				List[Any]=6 ,   SCREAMING_SNAKE_CASE_							:				Tuple=20_48 ,   SCREAMING_SNAKE_CASE_							:				Optional[int]=8 ,   SCREAMING_SNAKE_CASE_							:				Any=6 ,   SCREAMING_SNAKE_CASE_							:				Tuple=10_24 ,   SCREAMING_SNAKE_CASE_							:				Tuple=8 ,   SCREAMING_SNAKE_CASE_							:				Optional[Any]=0.0 ,   SCREAMING_SNAKE_CASE_							:				List[str]=True ,   SCREAMING_SNAKE_CASE_							:				List[str]="relu" ,   SCREAMING_SNAKE_CASE_							:				Tuple=2_56 ,   SCREAMING_SNAKE_CASE_							:				int=0.1 ,   SCREAMING_SNAKE_CASE_							:				Any=0.0 ,   SCREAMING_SNAKE_CASE_							:				int=0.0 ,   SCREAMING_SNAKE_CASE_							:				Any=0.02 ,   SCREAMING_SNAKE_CASE_							:				Tuple=1.0 ,   SCREAMING_SNAKE_CASE_							:				List[str]=True ,   SCREAMING_SNAKE_CASE_							:				Tuple=False ,   SCREAMING_SNAKE_CASE_							:				List[str]="sine" ,   SCREAMING_SNAKE_CASE_							:				Optional[int]=5 ,   SCREAMING_SNAKE_CASE_							:				Optional[Any]=4 ,   SCREAMING_SNAKE_CASE_							:				Tuple=4 ,   SCREAMING_SNAKE_CASE_							:				List[Any]=True ,   SCREAMING_SNAKE_CASE_							:				Dict=3_00 ,   SCREAMING_SNAKE_CASE_							:				Optional[int]=True ,   SCREAMING_SNAKE_CASE_							:				List[Any]=True ,   SCREAMING_SNAKE_CASE_							:				Any=1 ,   SCREAMING_SNAKE_CASE_							:				Union[str, Any]=5 ,   SCREAMING_SNAKE_CASE_							:				Tuple=2 ,   SCREAMING_SNAKE_CASE_							:				str=1 ,   SCREAMING_SNAKE_CASE_							:				Dict=1 ,   SCREAMING_SNAKE_CASE_							:				int=5 ,   SCREAMING_SNAKE_CASE_							:				int=2 ,   SCREAMING_SNAKE_CASE_							:				Union[str, Any]=0.1 ,   SCREAMING_SNAKE_CASE_							:				Optional[int]=0.25 ,   **SCREAMING_SNAKE_CASE_							:				Tuple ,   )       ->						List[Any]:







       '''simple docstring'''



       if backbone_config is None:
            logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''     )
            A:						str						=						CONFIG_MAPPING['''resnet'''](out_features=['''stage2''', '''stage3''', '''stage4''']     )
       else:
            if isinstance(lowerCAmelCase__ ,   lowerCAmelCase__     ):
                 A:						Tuple						=						backbone_config.pop('''model_type'''     )
                 A:						Any						=						CONFIG_MAPPING[backbone_model_type]
                 A:						Optional[int]						=						config_class.from_dict(lowerCAmelCase__     )

       A:						int						=						backbone_config
       A:						int						=						num_queries
       A:						List[Any]						=						max_position_embeddings
       A:						Tuple						=						d_model
       A:						List[Any]						=						encoder_ffn_dim
       A:						List[Any]						=						encoder_layers
       A:						int						=						encoder_attention_heads
       A:						List[Any]						=						decoder_ffn_dim
       A:						Any						=						decoder_layers
       A:						Union[str, Any]						=						decoder_attention_heads
       A:						List[str]						=						dropout
       A:						Union[str, Any]						=						attention_dropout
       A:						List[Any]						=						activation_dropout
       A:						List[Any]						=						activation_function
       A:						Any						=						init_std
       A:						Dict						=						init_xavier_std
       A:						str						=						encoder_layerdrop
       A:						Tuple						=						auxiliary_loss
       A:						Any						=						position_embedding_type
       # deformable attributes
       A:						str						=						num_feature_levels
       A:						Tuple						=						encoder_n_points
       A:						int						=						decoder_n_points
       A:						List[str]						=						two_stage
       A:						Dict						=						two_stage_num_proposals
       A:						List[Any]						=						with_box_refine
       A:						Any						=						assign_first_stage
       if two_stage is True and with_box_refine is False:
            raise ValueError('''If two_stage is True, with_box_refine must be True.'''     )
       # Hungarian matcher
       A:						Tuple						=						class_cost
       A:						int						=						bbox_cost
       A:						Union[str, Any]						=						giou_cost
       # Loss coefficients
       A:						Union[str, Any]						=						mask_loss_coefficient
       A:						int						=						dice_loss_coefficient
       A:						List[str]						=						bbox_loss_coefficient
       A:						str						=						giou_loss_coefficient
       A:						Tuple						=						eos_coefficient
       A:						Optional[int]						=						focal_alpha
       super().__init__(is_encoder_decoder=lowerCAmelCase__ ,   **lowerCAmelCase__     )



  @property
  def  _snake_case			(      self							:				Optional[Any]     )       ->						int:







       '''simple docstring'''



       return self.encoder_attention_heads



  @property
  def  _snake_case			(      self							:				Dict     )       ->						int:







       '''simple docstring'''



       return self.d_model




  def  _snake_case			(      self							:				Union[str, Any]     )       ->						List[str]:







       '''simple docstring'''



       A:						Optional[int]						=						copy.deepcopy(self.__dict__     )
       A:						List[str]						=						self.backbone_config.to_dict()
       A:						Any						=						self.__class__.model_type
       return output







from decimal import Decimal, getcontext
from math import ceil, factorial





def 				UpperCAmelCase						(    lowercase							):







				"""simple docstring"""



				if not isinstance(lowercase							,			lowercase							):
								raise TypeError('''Undefined for non-integers'''							)
				elif precision < 1:
								raise ValueError('''Undefined for non-natural numbers'''							)

				__lowercase 			=							precision
				__lowercase 			=							ceil(precision / 14							)
				__lowercase 			=							426880 * Decimal(10005							).sqrt()
				__lowercase 			=							1
				__lowercase 			=							13591409
				__lowercase 			=							Decimal(lowercase							)
				for k in range(1							,			lowercase							):
								__lowercase 			=							factorial(6 * k							) // (factorial(3 * k							) * factorial(lowercase							) ** 3)
								linear_term += 545140134
								exponential_term *= -262537412640768000
								partial_sum += Decimal(multinomial_term * linear_term							) / exponential_term
				return str(constant_term / partial_sum							)[:-1]


if __name__ == "__main__":
		__a  :     Optional[Any]       =  5_0
		print(F'''The first {n} digits of pi is: {pi(n)}''')