

from typing import List, Optional, Union

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


a_     =			logging.get_logger(__name__)

a_     =			{
    'huggingface/time-series-transformer-tourism-monthly': (
        'https://huggingface.co/huggingface/time-series-transformer-tourism-monthly/resolve/main/config.json'
    ),
    # See all TimeSeriesTransformer models at https://huggingface.co/models?filter=time_series_transformer
}






class _UpperCamelCase							(							UpperCamelCase__      ):
			'''simple docstring'''







			lowerCamelCase__							='time_series_transformer'
			lowerCamelCase__							={
			    'hidden_size': 'd_model',
			    'num_attention_heads': 'encoder_attention_heads',
			    'num_hidden_layers': 'encoder_layers',
			}
			def __init__(	self							:       List[Any]					,					a							:       List[Any] = None					,					a							:       Union[str, Any] = None					,					a							:       Any = "student_t"					,					a							:       List[str] = "nll"					,					a							:       str = 1					,					a							:       Any = [1, 2, 3, 4, 5, 6, 7]					,					a							:       int = "mean"					,					a							:       int = 0					,					a							:       List[Any] = 0					,					a							:       Tuple = 0					,					a							:       Optional[Any] = 0					,					a							:       List[str] = None					,					a							:       List[Any] = None					,					a							:       int = 32					,					a							:       List[Any] = 32					,					a							:       Dict = 2					,					a							:       Optional[int] = 2					,					a							:       List[Any] = 2					,					a							:       int = 2					,					a							:       Optional[int] = True					,					a							:       str = "gelu"					,					a							:       str = 64					,					a							:       Union[str, Any] = 0.1					,					a							:       int = 0.1					,					a							:       str = 0.1					,					a							:       Optional[int] = 0.1					,					a							:       str = 0.1					,					a							:       List[Any] = 100					,					a							:       List[str] = 0.02					,					a							:       Union[str, Any]=True					,					**a							:       Dict					,					)							->				Union[str, Any]:

				"""simple docstring"""

				SCREAMING_SNAKE_CASE      :					Any    =				prediction_length
				SCREAMING_SNAKE_CASE      :					List[Any]    =				context_length or prediction_length
				SCREAMING_SNAKE_CASE      :					Dict    =				distribution_output
				SCREAMING_SNAKE_CASE      :					List[str]    =				loss
				SCREAMING_SNAKE_CASE      :					Any    =				input_size
				SCREAMING_SNAKE_CASE      :					Optional[Any]    =				num_time_features
				SCREAMING_SNAKE_CASE      :					Optional[int]    =				lags_sequence
				SCREAMING_SNAKE_CASE      :					Optional[int]    =				scaling
				SCREAMING_SNAKE_CASE      :					Optional[Any]    =				num_dynamic_real_features
				SCREAMING_SNAKE_CASE      :					str    =				num_static_real_features
				SCREAMING_SNAKE_CASE      :					Union[str, Any]    =				num_static_categorical_features
				if cardinality and num_static_categorical_features > 0:
					if len(_a		) != num_static_categorical_features:
						raise ValueError(
						    "The cardinality should be a list of the same length as `num_static_categorical_features`"		)
					SCREAMING_SNAKE_CASE      :					List[str]    =				cardinality
				else:
					SCREAMING_SNAKE_CASE      :					int    =				[0]
				if embedding_dimension and num_static_categorical_features > 0:
					if len(_a		) != num_static_categorical_features:
						raise ValueError(
						    "The embedding dimension should be a list of the same length as `num_static_categorical_features`"		)
					SCREAMING_SNAKE_CASE      :					Tuple    =				embedding_dimension
				else:
					SCREAMING_SNAKE_CASE      :					Union[str, Any]    =				[min(50					,					(cat + 1) // 2		) for cat in self.cardinality]
				SCREAMING_SNAKE_CASE      :					List[Any]    =				num_parallel_samples

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

				SCREAMING_SNAKE_CASE      :					int    =				dropout
				SCREAMING_SNAKE_CASE      :					Tuple    =				attention_dropout
				SCREAMING_SNAKE_CASE      :					List[str]    =				activation_dropout
				SCREAMING_SNAKE_CASE      :					Optional[int]    =				encoder_layerdrop
				SCREAMING_SNAKE_CASE      :					int    =				decoder_layerdrop

				SCREAMING_SNAKE_CASE      :					Optional[int]    =				activation_function
				SCREAMING_SNAKE_CASE      :					Dict    =				init_std

				SCREAMING_SNAKE_CASE      :					List[str]    =				use_cache

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






			@property
			def 							__UpperCamelCase       (	self							:       str		)							->				int:

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





import requests
from bsa import BeautifulSoup







def 				lowerCAmelCase_	(     snake_case_ = "AAPL"     ):
      _A							:     str			=						f'''https://in.finance.yahoo.com/quote/{symbol}?s={symbol}'''
      _A							:     List[Any]			=						BeautifulSoup(requests.get(snake_case_     ).text,"""html.parser"""     )
      _A							:     Union[str, Any]			=						"""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}""")

