



'''simple docstring'''



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 					UpperCAmelCase__	(		UpperCamelCase__ ):
					a      :     Tuple        =							"""informer"""
					a      :     Any        =							{
					    """hidden_size""": """d_model""",
					    """num_attention_heads""": """encoder_attention_heads""",
					    """num_hidden_layers""": """encoder_layers""",
					}



					def __init__(    self			,				UpperCamelCase = None			,				UpperCamelCase = None			,				UpperCamelCase = "student_t"			,				UpperCamelCase = "nll"			,				UpperCamelCase = 1			,				UpperCamelCase = None			,				UpperCamelCase = "mean"			,				UpperCamelCase = 0			,				UpperCamelCase = 0			,				UpperCamelCase = 0			,				UpperCamelCase = 0			,				UpperCamelCase = None			,				UpperCamelCase = None			,				UpperCamelCase = 64			,				UpperCamelCase = 32			,				UpperCamelCase = 32			,				UpperCamelCase = 2			,				UpperCamelCase = 2			,				UpperCamelCase = 2			,				UpperCamelCase = 2			,				UpperCamelCase = True			,				UpperCamelCase = "gelu"			,				UpperCamelCase = 0.05			,				UpperCamelCase = 0.1			,				UpperCamelCase = 0.1			,				UpperCamelCase = 0.1			,				UpperCamelCase = 0.1			,				UpperCamelCase = 100			,				UpperCamelCase = 0.02			,				UpperCamelCase=True			,				UpperCamelCase = "prob"			,				UpperCamelCase = 5			,				UpperCamelCase = True			,				**UpperCamelCase			,				)     ->			Optional[Any]:
						# 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(UpperCamelCase     ) != 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(UpperCamelCase     ) != 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=UpperCamelCase			,				**UpperCamelCase     )



					@property
					def        UpperCAmelCase_ (    self     )     ->			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
						)




'''simple docstring'''



import re



def   __lowerCAmelCase					(							lowerCamelCase   :						str					):






	'''simple docstring'''




	__lowerCAmelCase												=  re.compile(
	    r"^(?:0|94|\+94|0{2}94)" r"7(0|1|2|4|5|6|7|8)" r"(-| |)" r"\d{7}$"					)

	return bool(re.search(lowerCamelCase				,		lowerCamelCase					)					)


if __name__ == "__main__":
	lowerCAmelCase	:		Optional[Any]				=   '''0094702343221'''

	print(is_sri_lankan_phone_number(phone))