
"""simple docstring"""
from typing import List, Optional, Union

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


lowercase_       :						Union[str, Any]     					=	logging.get_logger(__name__)

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




       """simple docstring"""


       _SCREAMING_SNAKE_CASE   :				Dict							    = prediction_length
       _SCREAMING_SNAKE_CASE   :				Optional[int]							    = context_length or prediction_length
       _SCREAMING_SNAKE_CASE   :				Dict							    = distribution_output
       _SCREAMING_SNAKE_CASE   :				Union[str, Any]							    = loss
       _SCREAMING_SNAKE_CASE   :				str							    = input_size
       _SCREAMING_SNAKE_CASE   :				List[str]							    = num_time_features
       _SCREAMING_SNAKE_CASE   :				Tuple							    = lags_sequence if lags_sequence is not None else [1, 2, 3, 4, 5, 6, 7]
       _SCREAMING_SNAKE_CASE   :				Any							    = scaling
       _SCREAMING_SNAKE_CASE   :				Dict							    = num_dynamic_real_features
       _SCREAMING_SNAKE_CASE   :				Optional[int]							    = num_static_real_features
       _SCREAMING_SNAKE_CASE   :				Optional[Any]							    = num_static_categorical_features

       # set cardinality
       if cardinality and num_static_categorical_features > 0:
         if len(snake_case__				) != num_static_categorical_features:
           raise ValueError(
               "The cardinality should be a list of the same length as `num_static_categorical_features`"				)
         _SCREAMING_SNAKE_CASE   :				Tuple							    = cardinality
       else:
         _SCREAMING_SNAKE_CASE   :				Union[str, Any]							    = [0]

       # set embedding_dimension
       if embedding_dimension and num_static_categorical_features > 0:
         if len(snake_case__				) != 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   :				List[Any]							    = embedding_dimension
       else:
         _SCREAMING_SNAKE_CASE   :				List[str]							    = [min(50  ,     (cat + 1) // 2				) for cat in self.cardinality]

       _SCREAMING_SNAKE_CASE   :				Optional[int]							    = num_parallel_samples

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

       _SCREAMING_SNAKE_CASE   :				int							    = dropout
       _SCREAMING_SNAKE_CASE   :				str							    = attention_dropout
       _SCREAMING_SNAKE_CASE   :				List[str]							    = activation_dropout
       _SCREAMING_SNAKE_CASE   :				List[Any]							    = encoder_layerdrop
       _SCREAMING_SNAKE_CASE   :				Optional[Any]							    = decoder_layerdrop

       _SCREAMING_SNAKE_CASE   :				Dict							    = activation_function
       _SCREAMING_SNAKE_CASE   :				int							    = init_std

       _SCREAMING_SNAKE_CASE   :				Any							    = use_cache

       # Informer
       _SCREAMING_SNAKE_CASE   :				List[Any]							    = attention_type
       _SCREAMING_SNAKE_CASE   :				Dict							    = sampling_factor
       _SCREAMING_SNAKE_CASE   :				Tuple							    = distil

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




     @property
     def 				__SCREAMING_SNAKE_CASE							(     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"""
def    _lowerCAmelCase    (     lowerCamelCase__							:							str,						lowerCamelCase__							:							str				)  ->    Union[str, Any]:
  print("\nThe shortest path matrix using Floyd Warshall algorithm\n"				)
  for i in range(lowerCamelCase__				):
    for j in range(lowerCamelCase__				):
      if dist[i][j] != float("inf"				):
        print(int(dist[i][j]				),						end="\t"				)
      else:
        print("INF",						end="\t"				)
    print()





def    _lowerCAmelCase    (     lowerCamelCase__							:							Dict,						lowerCamelCase__							:							Any				)  ->    List[str]:
  _SCREAMING_SNAKE_CASE   :				List[Any]							    = [[float("inf"				) for _ in range(lowerCamelCase__				)] for _ in range(lowerCamelCase__				)]

  for i in range(lowerCamelCase__				):
    for j in range(lowerCamelCase__				):
      _SCREAMING_SNAKE_CASE   :				List[Any]							    = graph[i][j]

      # check vertex k against all other vertices (i, j)
  for k in range(lowerCamelCase__				):
    # looping through rows of graph array
    for i in range(lowerCamelCase__				):
      # looping through columns of graph array
      for j in range(lowerCamelCase__				):
        if (
            dist[i][k] != float("inf"				)
            and dist[k][j] != float("inf"				)
            and dist[i][k] + dist[k][j] < dist[i][j]
        ):
          _SCREAMING_SNAKE_CASE   :				List[Any]							    = dist[i][k] + dist[k][j]

  _print_dist(lowerCamelCase__,						lowerCamelCase__				)
  return dist, v


if __name__ == "__main__":
      lowercase_       :						Tuple     					=	int(input('''Enter number of vertices: '''))
      lowercase_       :						List[Any]     					=	int(input('''Enter number of edges: '''))

      lowercase_       :						Optional[Any]     					=	[[float('''inf''') for i in range(v)] for j in range(v)]

      for i in range(v):
            lowercase_       :						Tuple     					=	0.0

            # src and dst are indices that must be within the array size graph[e][v]
            # failure to follow this will result in an error
      for i in range(e):
            print('''\nEdge ''', i + 1)
            lowercase_       :						str     					=	int(input('''Enter source:'''))
            lowercase_       :						Optional[Any]     					=	int(input('''Enter destination:'''))
            lowercase_       :						Union[str, Any]     					=	float(input('''Enter weight:'''))
            lowercase_       :						str     					=	weight

      floyd_warshall(graph, v)

      # Example Input
      # Enter number of vertices: 3
      # Enter number of edges: 2

      # # generated graph from vertex and edge inputs
      # [[inf, inf, inf], [inf, inf, inf], [inf, inf, inf]]
      # [[0.0, inf, inf], [inf, 0.0, inf], [inf, inf, 0.0]]

      # specify source, destination and weight for edge #1
      # Edge  1
      # Enter source:1
      # Enter destination:2
      # Enter weight:2

      # specify source, destination and weight for edge #2
      # Edge  2
      # Enter source:2
      # Enter destination:1
      # Enter weight:1

      # # Expected Output from the vertice, edge and src, dst, weight inputs!!
      # 0		INF	INF
      # INF	0	2
      # INF	1	0



