




from typing import List, Optional, Union

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


UpperCamelCase								=					logging.get_logger(__name__)

UpperCamelCase								=					{
    '''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	(   _a   ):




    """simple docstring"""

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


    def __init__(	self					:					Dict       ,     SCREAMING_SNAKE_CASE__					:					Optional[int] = None       ,     SCREAMING_SNAKE_CASE__					:					Optional[int] = None       ,     SCREAMING_SNAKE_CASE__					:					str = "student_t"       ,     SCREAMING_SNAKE_CASE__					:					str = "nll"       ,     SCREAMING_SNAKE_CASE__					:					int = 1       ,     SCREAMING_SNAKE_CASE__					:					List[int] = None       ,     SCREAMING_SNAKE_CASE__					:					Optional[Union[str, bool]] = "mean"       ,     SCREAMING_SNAKE_CASE__					:					int = 0       ,     SCREAMING_SNAKE_CASE__					:					int = 0       ,     SCREAMING_SNAKE_CASE__					:					int = 0       ,     SCREAMING_SNAKE_CASE__					:					int = 0       ,     SCREAMING_SNAKE_CASE__					:					Optional[List[int]] = None       ,     SCREAMING_SNAKE_CASE__					:					Optional[List[int]] = None       ,     SCREAMING_SNAKE_CASE__					:					int = 64       ,     SCREAMING_SNAKE_CASE__					:					int = 32       ,     SCREAMING_SNAKE_CASE__					:					int = 32       ,     SCREAMING_SNAKE_CASE__					:					int = 2       ,     SCREAMING_SNAKE_CASE__					:					int = 2       ,     SCREAMING_SNAKE_CASE__					:					int = 2       ,     SCREAMING_SNAKE_CASE__					:					int = 2       ,     SCREAMING_SNAKE_CASE__					:					bool = True       ,     SCREAMING_SNAKE_CASE__					:					str = "gelu"       ,     SCREAMING_SNAKE_CASE__					:					float = 0.05       ,     SCREAMING_SNAKE_CASE__					:					float = 0.1       ,     SCREAMING_SNAKE_CASE__					:					float = 0.1       ,     SCREAMING_SNAKE_CASE__					:					float = 0.1       ,     SCREAMING_SNAKE_CASE__					:					float = 0.1       ,     SCREAMING_SNAKE_CASE__					:					int = 100       ,     SCREAMING_SNAKE_CASE__					:					float = 0.02       ,     SCREAMING_SNAKE_CASE__					:					int=True       ,     SCREAMING_SNAKE_CASE__					:					str = "prob"       ,     SCREAMING_SNAKE_CASE__					:					int = 5       ,     SCREAMING_SNAKE_CASE__					:					bool = True       ,     **SCREAMING_SNAKE_CASE__					:					str       ,     )				->	Tuple:
     # time series specific configuration
     lowerCAmelCase__          =			prediction_length
     lowerCAmelCase__          =			context_length or prediction_length
     lowerCAmelCase__          =			distribution_output
     lowerCAmelCase__          =			loss
     lowerCAmelCase__          =			input_size
     lowerCAmelCase__          =			num_time_features
     lowerCAmelCase__          =			lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
     lowerCAmelCase__          =			scaling
     lowerCAmelCase__          =			num_dynamic_real_features
     lowerCAmelCase__          =			num_static_real_features
     lowerCAmelCase__          =			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`"       )
      lowerCAmelCase__          =			cardinality
     else:
      lowerCAmelCase__          =			[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`"       )
      lowerCAmelCase__          =			embedding_dimension
     else:
      lowerCAmelCase__          =			[min(50       ,     (cat + 1) // 2       ) for cat in self.cardinality]

     lowerCAmelCase__          =			num_parallel_samples

     # Transformer architecture configuration
     lowerCAmelCase__          =			input_size * len(self.lags_sequence       ) + self._number_of_features
     lowerCAmelCase__          =			d_model
     lowerCAmelCase__          =			encoder_attention_heads
     lowerCAmelCase__          =			decoder_attention_heads
     lowerCAmelCase__          =			encoder_ffn_dim
     lowerCAmelCase__          =			decoder_ffn_dim
     lowerCAmelCase__          =			encoder_layers
     lowerCAmelCase__          =			decoder_layers

     lowerCAmelCase__          =			dropout
     lowerCAmelCase__          =			attention_dropout
     lowerCAmelCase__          =			activation_dropout
     lowerCAmelCase__          =			encoder_layerdrop
     lowerCAmelCase__          =			decoder_layerdrop

     lowerCAmelCase__          =			activation_function
     lowerCAmelCase__          =			init_std

     lowerCAmelCase__          =			use_cache

     # Informer
     lowerCAmelCase__          =			attention_type
     lowerCAmelCase__          =			sampling_factor
     lowerCAmelCase__          =			distil

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


    @property
    def        a				(	self					:					Optional[Any]       )				->	List[str]:
     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 string



def 							_A       (						lowerCAmelCase_					: str      ):
     """simple docstring"""

     for key in range(len(string.ascii_uppercase      )      ):
          lowerCAmelCase__          =			""
          for symbol in message:
               if symbol in string.ascii_uppercase:
                    lowerCAmelCase__          =			string.ascii_uppercase.find(lowerCAmelCase_      )
                    lowerCAmelCase__          =			num - key
                    if num < 0:
                         lowerCAmelCase__          =			num + len(string.ascii_uppercase      )
                    lowerCAmelCase__          =			translated + string.ascii_uppercase[num]
               else:
                    lowerCAmelCase__          =			translated + symbol
          print(F'Decryption using Key #{key}: {translated}'      )



def 							_A       (						):
     """simple docstring"""

     lowerCAmelCase__          =			input("Encrypted message: "      )
     lowerCAmelCase__          =			message.upper()
     decrypt(lowerCAmelCase_      )


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     main()
