





"""simple docstring"""



import copy

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


a_			=      logging.get_logger(__name__)

a_			=      {
    """SenseTime/deformable-detr""": """https://huggingface.co/sensetime/deformable-detr/resolve/main/config.json""",
    # See all Deformable DETR models at https://huggingface.co/models?filter=deformable-detr
}






class 		__snake_case (		__lowerCAmelCase					):





 """simple docstring"""


 _lowerCamelCase				=					'''deformable_detr'''
 _lowerCamelCase				=					{
     '''hidden_size''': '''d_model''',
     '''num_attention_heads''': '''encoder_attention_heads''',
 }

 def __init__(   self ,						__lowerCamelCase=True ,						__lowerCamelCase=None ,						__lowerCamelCase=3 ,						__lowerCamelCase=300 ,						__lowerCamelCase=1024 ,						__lowerCamelCase=6 ,						__lowerCamelCase=1024 ,						__lowerCamelCase=8 ,						__lowerCamelCase=6 ,						__lowerCamelCase=1024 ,						__lowerCamelCase=8 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=True ,						__lowerCamelCase="relu" ,						__lowerCamelCase=256 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0_2 ,						__lowerCamelCase=1.0 ,						__lowerCamelCase=True ,						__lowerCamelCase=False ,						__lowerCamelCase="sine" ,						__lowerCamelCase="resnet50" ,						__lowerCamelCase=True ,						__lowerCamelCase=False ,						__lowerCamelCase=4 ,						__lowerCamelCase=4 ,						__lowerCamelCase=4 ,						__lowerCamelCase=False ,						__lowerCamelCase=300 ,						__lowerCamelCase=False ,						__lowerCamelCase=1 ,						__lowerCamelCase=5 ,						__lowerCamelCase=2 ,						__lowerCamelCase=1 ,						__lowerCamelCase=1 ,						__lowerCamelCase=5 ,						__lowerCamelCase=2 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=0.2_5 ,						__lowerCamelCase=False ,						**__lowerCamelCase ,						):



     '''simple docstring'''




     if backbone_config is not None and use_timm_backbone:
         raise ValueError('''You can\'t specify both `backbone_config` and `use_timm_backbone`.'''  )

     if not use_timm_backbone:
         if backbone_config is None:
             logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''  )
             __A   :						List[Any]									=					CONFIG_MAPPING['''resnet'''](out_features=['''stage4''']  )
         elif isinstance(lowerCAmelCase_ ,						lowerCAmelCase_  ):
             __A   :						Tuple									=					backbone_config.get('''model_type'''  )
             __A   :						List[str]									=					CONFIG_MAPPING[backbone_model_type]
             __A   :						Union[str, Any]									=					config_class.from_dict(lowerCAmelCase_  )
     __A   :						Optional[int]									=					use_timm_backbone
     __A   :						Union[str, Any]									=					backbone_config
     __A   :						Tuple									=					num_channels
     __A   :						List[str]									=					num_queries
     __A   :						Optional[Any]									=					max_position_embeddings
     __A   :						Any									=					d_model
     __A   :						Tuple									=					encoder_ffn_dim
     __A   :						Union[str, Any]									=					encoder_layers
     __A   :						Tuple									=					encoder_attention_heads
     __A   :						str									=					decoder_ffn_dim
     __A   :						Tuple									=					decoder_layers
     __A   :						Union[str, Any]									=					decoder_attention_heads
     __A   :						str									=					dropout
     __A   :						Optional[int]									=					attention_dropout
     __A   :						Tuple									=					activation_dropout
     __A   :						Tuple									=					activation_function
     __A   :						str									=					init_std
     __A   :						List[str]									=					init_xavier_std
     __A   :						int									=					encoder_layerdrop
     __A   :						Optional[Any]									=					auxiliary_loss
     __A   :						Any									=					position_embedding_type
     __A   :						List[Any]									=					backbone
     __A   :						Optional[Any]									=					use_pretrained_backbone
     __A   :						str									=					dilation
     # deformable attributes
     __A   :						Optional[Any]									=					num_feature_levels
     __A   :						Optional[int]									=					encoder_n_points
     __A   :						List[str]									=					decoder_n_points
     __A   :						int									=					two_stage
     __A   :						Optional[Any]									=					two_stage_num_proposals
     __A   :						Tuple									=					with_box_refine
     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   :						Tuple									=					bbox_cost
     __A   :						int									=					giou_cost
     # Loss coefficients
     __A   :						Dict									=					mask_loss_coefficient
     __A   :						Tuple									=					dice_loss_coefficient
     __A   :						List[str]									=					bbox_loss_coefficient
     __A   :						List[str]									=					giou_loss_coefficient
     __A   :						Tuple									=					eos_coefficient
     __A   :						Tuple									=					focal_alpha
     __A   :						Optional[Any]									=					disable_custom_kernels
     super().__init__(is_encoder_decoder=lowerCAmelCase_ ,						**lowerCAmelCase_  )

 @property
 def  UpperCamelCase__(   self  ):



     '''simple docstring'''




     return self.encoder_attention_heads

 @property
 def  UpperCamelCase__(   self  ):



     '''simple docstring'''




     return self.d_model







 def  UpperCamelCase__(   self  ):



     '''simple docstring'''




     __A   :						Any									=					copy.deepcopy(self.__dict__  )
     if self.backbone_config is not None:
         __A   :						Union[str, Any]									=					self.backbone_config.to_dict()
     __A   :						int									=					self.__class__.model_type
     return output










"""simple docstring"""



from math import factorial







def 		__lowercase					(       snake_case_  :  int    ,snake_case_  :  int						)       ->int:



    '''simple docstring'''







    if n < k or k < 0:
        raise ValueError('''Please enter positive integers for n and k where n >= k'''						)
    return factorial(snake_case_						) // (factorial(snake_case_						) * factorial(n - k						))


if __name__ == "__main__":
       print(
           """The number of five-card hands possible from a standard""",
           f'''fifty-two card deck is: {combinations(52, 5)}\n''',
       )

       print(
           """If a class of 40 students must be arranged into groups of""",
           f'''4 for group projects, there are {combinations(40, 4)} ways''',
           """to arrange them.\n""",
       )

       print(
           """If 10 teams are competing in a Formula One race, there""",
           f'''are {combinations(10, 3)} ways that first, second and''',
           """third place can be awarded.""",
       )




