


"""simple docstring"""


from __future__ import annotations




def   lowerCAmelCase		(     UpperCamelCase__       :						int    )   ->      bool:
      lowerCamelCase					:					Dict        =	str(UpperCamelCase__    )
      return len(UpperCamelCase__    ) == 9 and set(UpperCamelCase__    ) == set("""123456789"""    )




def   lowerCAmelCase		(     )   ->      int | None:
      for base_num in range(9999			,				4999			,				-1    ):
            lowerCamelCase					:					List[Any]        =	100002 * base_num
            if is_9_pandigital(UpperCamelCase__    ):
                  return candidate

      for base_num in range(333			,				99			,				-1    ):
            lowerCamelCase					:					Tuple        =	1002003 * base_num
            if is_9_pandigital(UpperCamelCase__    ):
                  return candidate

      return None


if __name__ == "__main__":
    print(f"""{solution() = }""")








"""simple docstring"""


from typing import List, Optional, Union

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


__lowerCamelCase      :str	    =		logging.get_logger(__name__)

__lowerCamelCase      :Any	    =		{
    '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 			A__	(						__lowercase):


     """simple docstring"""
     snake_case__	:					List[Any]													='''time_series_transformer'''
     snake_case__	:					List[Any]													={
         '''hidden_size''': '''d_model''',
         '''num_attention_heads''': '''encoder_attention_heads''',
         '''num_hidden_layers''': '''encoder_layers''',
     }

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

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

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

           lowerCamelCase					:					Optional[int]        =	activation_function
           lowerCamelCase					:					Optional[Any]        =	init_std

           lowerCamelCase					:					Optional[Any]        =	use_cache

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







     @property
     def 		a__						(	self:						int	)->    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
           )




