
'''simple docstring'''






from typing import List, Optional, Union

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


A			      =      logging.get_logger(__name__)

A			      =      {
    """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     __snake_case		(   a__):
					_lowerCAmelCase			     =	"informer"
					_lowerCAmelCase			     =	{
					    "hidden_size": "d_model",
					    "num_attention_heads": "encoder_attention_heads",
					    "num_hidden_layers": "encoder_layers",
					}
					def __init__(     self,    A = None,    A = None,    A = "student_t",    A = "nll",    A = 1,    A = None,    A = "mean",    A = 0,    A = 0,    A = 0,    A = 0,    A = None,    A = None,    A = 64,    A = 32,    A = 32,    A = 2,    A = 2,    A = 2,    A = 2,    A = True,    A = "gelu",    A = 0.05,    A = 0.1,    A = 0.1,    A = 0.1,    A = 0.1,    A = 100,    A = 0.02,    A=True,    A = "prob",    A = 5,    A = True,    **A,    ):

									"""simple docstring"""


									lowerCamelCase					:			str									= prediction_length
									lowerCamelCase					:			Optional[int]									= context_length or prediction_length
									lowerCamelCase					:			Any									= distribution_output
									lowerCamelCase					:			List[str]									= loss
									lowerCamelCase					:			str									= input_size
									lowerCamelCase					:			Optional[int]									= num_time_features
									lowerCamelCase					:			List[str]									= lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
									lowerCamelCase					:			Dict									= scaling
									lowerCamelCase					:			Tuple									= num_dynamic_real_features
									lowerCamelCase					:			Dict									= num_static_real_features
									lowerCamelCase					:			str									= 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					:			Optional[Any]									= cardinality
									else:
													lowerCamelCase					:			List[str]									= [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					:			List[Any]									= embedding_dimension
									else:
													lowerCamelCase					:			Dict									= [min(50,    (cat + 1) // 2      ) for cat in self.cardinality]

									lowerCamelCase					:			int									= num_parallel_samples

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

									lowerCamelCase					:			str									= dropout
									lowerCamelCase					:			Any									= attention_dropout
									lowerCamelCase					:			List[Any]									= activation_dropout
									lowerCamelCase					:			Dict									= encoder_layerdrop
									lowerCamelCase					:			Union[str, Any]									= decoder_layerdrop

									lowerCamelCase					:			int									= activation_function
									lowerCamelCase					:			Tuple									= init_std

									lowerCamelCase					:			Dict									= use_cache

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

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




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


'''simple docstring'''






import requests
from bsa import BeautifulSoup





def    UpperCAmelCase							(  UpperCAmelCase__							:							str = "AAPL"):
				lowerCamelCase					:			List[Any]									= F'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
				lowerCamelCase					:			Dict									= BeautifulSoup(requests.get(UpperCAmelCase__).text       ,							'html.parser')
				lowerCamelCase					:			Dict									= 'My(6px) Pos(r) smartphone_Mt(6px)'
				return soup.find('div'       ,							class_=class_).find('span').text


if __name__ == "__main__":
					for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
										print(f"""Current {symbol:<4} stock price is {stock_price(symbol):>8}""")
