




from typing import List, Optional, Union

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


__lowerCamelCase   :						Optional[Any]				=			logging.get_logger(__name__)

__lowerCamelCase   :						str				=			{
    '''huggingface/informer-tourism-monthly''': (
        '''https://huggingface.co/huggingface/informer-tourism-monthly/resolve/main/config.json'''
    ),
    # See all Informer models at https://huggingface.co/models?filter=informer
}


class    lowerCamelCase    (		UpperCamelCase__						):






			'''simple docstring'''





			UpperCamelCase__								="""informer"""
			UpperCamelCase__								={
			    """hidden_size""": """d_model""",
			    """num_attention_heads""": """encoder_attention_heads""",
			    """num_hidden_layers""": """encoder_layers""",
			}

			def __init__( self			:   str       ,						lowerCamelCase_			:   Any = None       ,						lowerCamelCase_			:   Union[str, Any] = None       ,						lowerCamelCase_			:   Union[str, Any] = "student_t"       ,						lowerCamelCase_			:   Optional[int] = "nll"       ,						lowerCamelCase_			:   Any = 1       ,						lowerCamelCase_			:   Optional[Any] = None       ,						lowerCamelCase_			:   Optional[Any] = "mean"       ,						lowerCamelCase_			:   Union[str, Any] = 0       ,						lowerCamelCase_			:   Optional[Any] = 0       ,						lowerCamelCase_			:   Dict = 0       ,						lowerCamelCase_			:   Union[str, Any] = 0       ,						lowerCamelCase_			:   List[str] = None       ,						lowerCamelCase_			:   Dict = None       ,						lowerCamelCase_			:   int = 64       ,						lowerCamelCase_			:   Any = 32       ,						lowerCamelCase_			:   int = 32       ,						lowerCamelCase_			:   str = 2       ,						lowerCamelCase_			:   List[str] = 2       ,						lowerCamelCase_			:   str = 2       ,						lowerCamelCase_			:   Dict = 2       ,						lowerCamelCase_			:   Optional[int] = True       ,						lowerCamelCase_			:   Union[str, Any] = "gelu"       ,						lowerCamelCase_			:   str = 0.0_5       ,						lowerCamelCase_			:   Any = 0.1       ,						lowerCamelCase_			:   Optional[Any] = 0.1       ,						lowerCamelCase_			:   Optional[Any] = 0.1       ,						lowerCamelCase_			:   int = 0.1       ,						lowerCamelCase_			:   Optional[Any] = 100       ,						lowerCamelCase_			:   str = 0.0_2       ,						lowerCamelCase_			:   List[str]=True       ,						lowerCamelCase_			:   Dict = "prob"       ,						lowerCamelCase_			:   Dict = 5       ,						lowerCamelCase_			:   Tuple = True       ,						**lowerCamelCase_			:   Tuple       ,						)						->   Optional[Any]:
								# time series specific configuration
								__magic_name__							:	Tuple    							=							prediction_length
								__magic_name__							:	List[Any]    							=							context_length or prediction_length
								__magic_name__							:	Dict    							=							distribution_output
								__magic_name__							:	int    							=							loss
								__magic_name__							:	Any    							=							input_size
								__magic_name__							:	List[Any]    							=							num_time_features
								__magic_name__							:	Optional[Any]    							=							lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
								__magic_name__							:	str    							=							scaling
								__magic_name__							:	Any    							=							num_dynamic_real_features
								__magic_name__							:	str    							=							num_static_real_features
								__magic_name__							:	Tuple    							=							num_static_categorical_features

								# set cardinality
								if cardinality and num_static_categorical_features > 0:
													if len(lowerCamelCase_  ) != num_static_categorical_features:
																		raise ValueError(
																		    '''The cardinality should be a list of the same length as `num_static_categorical_features`'''  )
													__magic_name__							:	Dict    							=							cardinality
								else:
													__magic_name__							:	List[str]    							=							[0]

								# set embedding_dimension
								if embedding_dimension and num_static_categorical_features > 0:
													if len(lowerCamelCase_  ) != num_static_categorical_features:
																		raise ValueError(
																		    '''The embedding dimension should be a list of the same length as `num_static_categorical_features`'''  )
													__magic_name__							:	int    							=							embedding_dimension
								else:
													__magic_name__							:	Any    							=							[min(50       ,						(cat + 1) // 2  ) for cat in self.cardinality]

								__magic_name__							:	Tuple    							=							num_parallel_samples

								# Transformer architecture configuration
								__magic_name__							:	Optional[int]    							=							input_size * len(self.lags_sequence  ) + self._number_of_features
								__magic_name__							:	Optional[int]    							=							d_model
								__magic_name__							:	Any    							=							encoder_attention_heads
								__magic_name__							:	Any    							=							decoder_attention_heads
								__magic_name__							:	List[Any]    							=							encoder_ffn_dim
								__magic_name__							:	List[str]    							=							decoder_ffn_dim
								__magic_name__							:	Any    							=							encoder_layers
								__magic_name__							:	List[str]    							=							decoder_layers

								__magic_name__							:	Tuple    							=							dropout
								__magic_name__							:	Dict    							=							attention_dropout
								__magic_name__							:	Union[str, Any]    							=							activation_dropout
								__magic_name__							:	str    							=							encoder_layerdrop
								__magic_name__							:	Union[str, Any]    							=							decoder_layerdrop

								__magic_name__							:	List[Any]    							=							activation_function
								__magic_name__							:	Optional[int]    							=							init_std

								__magic_name__							:	Dict    							=							use_cache

								# Informer
								__magic_name__							:	Optional[int]    							=							attention_type
								__magic_name__							:	List[str]    							=							sampling_factor
								__magic_name__							:	int    							=							distil

								super().__init__(is_encoder_decoder=lowerCamelCase_       ,						**lowerCamelCase_  )


			@property
			def 							UpperCAmelCase__       ( self			:   str  )						->   int:
								return (
								    sum(self.embedding_dimension  )
								    + self.num_dynamic_real_features
								    + self.num_time_features
								    + self.num_static_real_features
								    + self.input_size * 2  # the log1p(abs(loc)) and log(scale) features
								)









import requests







def 		lowercase__   (		__A:	str							,__A:	str				):





					'''simple docstring'''






					__magic_name__							:	Tuple    							=							{'''Content-Type''': '''application/json'''}
					__magic_name__							:	Union[str, Any]    							=							requests.post(__A							,json={'''text''': message_body}							,headers=__A				)
					if response.status_code != 2_0_0:
										__magic_name__							:	int    							=							(
										    '''Request to slack returned an error '''
										    F'''{response.status_code}, the response is:\n{response.text}'''
										)
										raise ValueError(__A				)


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>''')



