



'''simple docstring'''


from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowercase							       =			logging.get_logger(__name__)

lowercase							       =			{
    '''google/bit-50''': '''https://huggingface.co/google/bit-50/resolve/main/config.json''',
}







class 	UpperCAmelCase	(		__a					,	__a):


 '''simple docstring'''




 __magic_name__					: List[Any]  =      "bit"
 __magic_name__					: List[Any]  =      ["preactivation", "bottleneck"]
 __magic_name__					: Optional[int]  =      ["SAME", "VALID"]




 def __init__(   self							,  lowerCAmelCase_=3							,  lowerCAmelCase_=6_4							,  lowerCAmelCase_=[2_5_6, 5_1_2, 1_0_2_4, 2_0_4_8]							,  lowerCAmelCase_=[3, 4, 6, 3]							,  lowerCAmelCase_="preactivation"							,  lowerCAmelCase_="relu"							,  lowerCAmelCase_=None							,  lowerCAmelCase_=3_2							,  lowerCAmelCase_=0.0							,  lowerCAmelCase_=False							,  lowerCAmelCase_=3_2							,  lowerCAmelCase_=1							,  lowerCAmelCase_=None							,  lowerCAmelCase_=None							,  **lowerCAmelCase_							,  ) ->      List[str]:



      """simple docstring"""







      super().__init__(**lowerCAmelCase_)
      if layer_type not in self.layer_types:
           raise ValueError(f"""layer_type={layer_type} is not one of {','.join(self.layer_types)}""")
      if global_padding is not None:
           if global_padding.upper() in self.supported_padding:
                a_       		=global_padding.upper()
           else:
                raise ValueError(f"""Padding strategy {global_padding} not supported""")
      a_       		=num_channels
      a_       		=embedding_size
      a_       		=hidden_sizes
      a_       		=depths
      a_       		=layer_type
      a_       		=hidden_act
      a_       		=global_padding
      a_       		=num_groups
      a_       		=drop_path_rate
      a_       		=embedding_dynamic_padding
      a_       		=output_stride
      a_       		=width_factor

      a_       		=["stem"] + [f"""stage{idx}""" for idx in range(1							,  len(lowerCAmelCase_) + 1)]
      a_		,						a_       		=get_aligned_output_features_output_indices(
          out_features=lowerCAmelCase_							,  out_indices=lowerCAmelCase_							,  stage_names=self.stage_names)







'''simple docstring'''


from __future__ import annotations






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     print(F"""Vertex\tShortest Distance from vertex {src}"""       )
     for i, d in enumerate(lowercase__       ):
          print(F"""{i}\t\t{d}"""       )






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     for j in range(lowercase__       ):
          a_		,						a_		,						a_       		=(graph[j][k] for k in ["src", "dst", "weight"])
          if distance[u] != float("inf"       ) and distance[u] + w < distance[v]:
               return True
     return False






def  UpperCAmelCase_       (		lowercase__       ,	lowercase__       ,	lowercase__       ,	lowercase__       ):


     '''simple docstring'''







     a_       		=[float("inf"       )] * vertex_count
     a_       		=0.0

     for _ in range(vertex_count - 1       ):
          for j in range(lowercase__       ):
               a_		,						a_		,						a_       		=(graph[j][k] for k in ["src", "dst", "weight"])

               if distance[u] != float("inf"       ) and distance[u] + w < distance[v]:
                    a_       		=distance[u] + w

     a_       		=check_negative_cycle(lowercase__       ,	lowercase__       ,	lowercase__       )
     if negative_cycle_exists:
          raise Exception("Negative cycle found"       )

     return distance


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  lowercase							       =			int(input('''Enter number of vertices: ''').strip())
  lowercase							       =			int(input('''Enter number of edges: ''').strip())

  lowercase							       =			[{} for _ in range(E)]

  for i in range(E):
    print('''Edge ''', i + 1)
    lowercase       ,      lowercase       ,      lowercase							       =			(
        int(x)
        for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
    )
    lowercase							       =			{'''src''': src, '''dst''': dest, '''weight''': weight}

  lowercase							       =			int(input('''\nEnter shortest path source:''').strip())
  lowercase							       =			bellman_ford(graph, V, E, source)
  print_distance(shortest_distance, 0)


