


from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCAmelCase    =					logging.get_logger(__name__)

UpperCAmelCase    =					{
    """shi-labs/dinat-mini-in1k-224""": """https://huggingface.co/shi-labs/dinat-mini-in1k-224/resolve/main/config.json""",
    # See all Dinat models at https://huggingface.co/models?filter=dinat
}







class lowerCAmelCase_		(				lowerCamelCase__      ,		lowerCamelCase__ ):

 '''simple docstring'''

 __snake_case				=						"dinat"

 __snake_case				=						{
     "num_attention_heads": "num_heads",
     "num_hidden_layers": "num_layers",
 }



 def __init__(			self	,   _UpperCAmelCase=4	,   _UpperCAmelCase=3	,   _UpperCAmelCase=64	,   _UpperCAmelCase=[3, 4, 6, 5]	,   _UpperCAmelCase=[2, 4, 8, 16]	,   _UpperCAmelCase=7	,   _UpperCAmelCase=[[1, 8, 1], [1, 4, 1, 4], [1, 2, 1, 2, 1, 2], [1, 1, 1, 1, 1]]	,   _UpperCAmelCase=3.0	,   _UpperCAmelCase=True	,   _UpperCAmelCase=0.0	,   _UpperCAmelCase=0.0	,   _UpperCAmelCase=0.1	,   _UpperCAmelCase="gelu"	,   _UpperCAmelCase=0.02	,   _UpperCAmelCase=1E-5	,   _UpperCAmelCase=0.0	,   _UpperCAmelCase=None	,   _UpperCAmelCase=None	,   **_UpperCAmelCase	,   ):
       super().__init__(**_UpperCAmelCase      )

       snake_case_ =   patch_size
       snake_case_ =   num_channels
       snake_case_ =   embed_dim
       snake_case_ =   depths
       snake_case_ =   len(_UpperCAmelCase      )
       snake_case_ =   num_heads
       snake_case_ =   kernel_size
       snake_case_ =   dilations
       snake_case_ =   mlp_ratio
       snake_case_ =   qkv_bias
       snake_case_ =   hidden_dropout_prob
       snake_case_ =   attention_probs_dropout_prob
       snake_case_ =   drop_path_rate
       snake_case_ =   hidden_act
       snake_case_ =   layer_norm_eps
       snake_case_ =   initializer_range
       # we set the hidden_size attribute in order to make Dinat work with VisionEncoderDecoderModel
       # this indicates the channel dimension after the last stage of the model
       snake_case_ =   int(embed_dim * 2 ** (len(_UpperCAmelCase      ) - 1)      )
       snake_case_ =   layer_scale_init_value
       snake_case_ =   ['''stem'''] + [F'''stage{idx}''' for idx in range(1	,   len(_UpperCAmelCase      ) + 1      )]
       snake_case_ ,					snake_case_ =   get_aligned_output_features_output_indices(
           out_features=_UpperCAmelCase	,   out_indices=_UpperCAmelCase	,   stage_names=self.stage_names      )



import requests






def  __lowerCAmelCase					(SCREAMING_SNAKE_CASE      ,      SCREAMING_SNAKE_CASE      )->						None:




      """simple docstring"""

      snake_case_ =   {'''Content-Type''': '''application/json'''}
      snake_case_ =   requests.post(SCREAMING_SNAKE_CASE      ,      json={'''text''': message_body}      ,      headers=SCREAMING_SNAKE_CASE      )
      if response.status_code != 200:
            snake_case_ =   (
                '''Request to slack returned an error '''
                f'''{response.status_code}, the response is:\n{response.text}'''
            )
            raise ValueError(SCREAMING_SNAKE_CASE      )


if __name__ == "__main__":
   # Set the slack url to the one provided by Slack when you create the webhook at
   # https://my.slack.com/services/new/incoming-webhook/
   send_slack_message("""<YOUR MESSAGE BODY>""", """<SLACK CHANNEL URL>""")