






from typing import List, Optional, Union

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


SCREAMING_SNAKE_CASE__      :			str							=		logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__      :			Union[str, Any]							=		{
    """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_				(      lowerCamelCase ):
    a__					       =  '''informer'''
    a__					       =  {
        '''hidden_size''': '''d_model''',
        '''num_attention_heads''': '''encoder_attention_heads''',
        '''num_hidden_layers''': '''encoder_layers''',
    }







    def __init__(						self       ,					__lowerCAmelCase = None       ,					__lowerCAmelCase = None       ,					__lowerCAmelCase = "student_t"       ,					__lowerCAmelCase = "nll"       ,					__lowerCAmelCase = 1       ,					__lowerCAmelCase = None       ,					__lowerCAmelCase = "mean"       ,					__lowerCAmelCase = 0       ,					__lowerCAmelCase = 0       ,					__lowerCAmelCase = 0       ,					__lowerCAmelCase = 0       ,					__lowerCAmelCase = None       ,					__lowerCAmelCase = None       ,					__lowerCAmelCase = 6_4       ,					__lowerCAmelCase = 3_2       ,					__lowerCAmelCase = 3_2       ,					__lowerCAmelCase = 2       ,					__lowerCAmelCase = 2       ,					__lowerCAmelCase = 2       ,					__lowerCAmelCase = 2       ,					__lowerCAmelCase = True       ,					__lowerCAmelCase = "gelu"       ,					__lowerCAmelCase = 0.05       ,					__lowerCAmelCase = 0.1       ,					__lowerCAmelCase = 0.1       ,					__lowerCAmelCase = 0.1       ,					__lowerCAmelCase = 0.1       ,					__lowerCAmelCase = 1_0_0       ,					__lowerCAmelCase = 0.02       ,					__lowerCAmelCase=True       ,					__lowerCAmelCase = "prob"       ,					__lowerCAmelCase = 5       ,					__lowerCAmelCase = True       ,					**__lowerCAmelCase       ,					):
        """simple docstring"""
        __magic_name__		:str        =      prediction_length
        __magic_name__		:List[Any]        =      context_length or prediction_length
        __magic_name__		:Dict        =      distribution_output
        __magic_name__		:Optional[int]        =      loss
        __magic_name__		:Tuple        =      input_size
        __magic_name__		:Optional[Any]        =      num_time_features
        __magic_name__		:Optional[int]        =      lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
        __magic_name__		:Dict        =      scaling
        __magic_name__		:Union[str, Any]        =      num_dynamic_real_features
        __magic_name__		:Union[str, Any]        =      num_static_real_features
        __magic_name__		:List[str]        =      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__		:Optional[int]        =      cardinality
        else:
            __magic_name__		:List[Any]        =      [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__		:Tuple        =      embedding_dimension
        else:
            __magic_name__		:Any        =      [min(5_0       ,					(cat + 1) // 2     ) for cat in self.cardinality]

        __magic_name__		:List[str]        =      num_parallel_samples

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

        __magic_name__		:int        =      dropout
        __magic_name__		:Union[str, Any]        =      attention_dropout
        __magic_name__		:str        =      activation_dropout
        __magic_name__		:str        =      encoder_layerdrop
        __magic_name__		:List[Any]        =      decoder_layerdrop

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

        __magic_name__		:List[str]        =      use_cache

        # Informer
        __magic_name__		:List[str]        =      attention_type
        __magic_name__		:Union[str, Any]        =      sampling_factor
        __magic_name__		:List[Any]        =      distil

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







    @property
    def 			A	(						self     ):
        """simple docstring"""
        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
        )














from urllib.parse import quote

import pytest

from datasets.utils.hub import hf_hub_url

@pytest.mark.parametrize('''repo_id''',  ['''canonical_dataset_name''', '''org-name/dataset-name'''] )
@pytest.mark.parametrize('''path''',  ['''filename.csv''', '''filename with blanks.csv'''] )
@pytest.mark.parametrize('''revision''',  [None, '''v2'''] )
def      __lowercase					( snake_case,  snake_case,  snake_case ):







				"""simple docstring"""






				__magic_name__		:Tuple        =      hf_hub_url(repo_id=snake_case,  path=snake_case,  revision=snake_case )
				assert url == f'''https://huggingface.co/datasets/{repo_id}/resolve/{revision or "main"}/{quote(snake_case )}'''






