





from __future__ import annotations


def 			SCREAMING_SNAKE_CASE (			_UpperCAmelCase		,      _UpperCAmelCase					)     ->	str:
    print(F"""Vertex\tShortest Distance from vertex {src}"""					)
    for i, d in enumerate(_UpperCAmelCase					):
        print(F"""{i}\t\t{d}"""					)


def 			SCREAMING_SNAKE_CASE (			_UpperCAmelCase		,      _UpperCAmelCase		,      _UpperCAmelCase					)     ->	List[str]:
    for j in range(_UpperCAmelCase					):
        lowerCamelCase__					,				lowerCamelCase__					,				lowerCamelCase__       : int   					=						(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 			SCREAMING_SNAKE_CASE (			_UpperCAmelCase		,      _UpperCAmelCase		,      _UpperCAmelCase		,      _UpperCAmelCase					)     ->	list[float]:
    lowerCamelCase__       : str   					=						[float('inf'					)] * vertex_count
    lowerCamelCase__       : List[Any]   					=						0.0

    for _ in range(vertex_count - 1					):
        for j in range(_UpperCAmelCase					):
            lowerCamelCase__					,				lowerCamelCase__					,				lowerCamelCase__       : Any   					=						(graph[j][k] for k in ['src', 'dst', 'weight'])

            if distance[u] != float('inf'					) and distance[u] + w < distance[v]:
                lowerCamelCase__       : Any   					=						distance[u] + w

    lowerCamelCase__       : Union[str, Any]   					=						check_negative_cycle(_UpperCAmelCase		,      _UpperCAmelCase		,      _UpperCAmelCase					)
    if negative_cycle_exists:
        raise Exception('Negative cycle found'					)

    return distance


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    _UpperCAmelCase							:			Tuple        =							int(input("""Enter number of vertices: """).strip())
    _UpperCAmelCase							:			str        =							int(input("""Enter number of edges: """).strip())

    _UpperCAmelCase							:			list[dict[str, int]]        =							[{} for _ in range(E)]

    for i in range(E):
        print("""Edge """, i + 1)
        _UpperCAmelCase  ,_UpperCAmelCase  ,_UpperCAmelCase							:			List[Any]        =							(
            int(x)
            for x in input("""Enter source, destination, weight: """).strip().split(""" """)
        )
        _UpperCAmelCase							:			int        =							{"""src""": src, """dst""": dest, """weight""": weight}

    _UpperCAmelCase							:			Optional[Any]        =							int(input("""\nEnter shortest path source:""").strip())
    _UpperCAmelCase							:			int        =							bellman_ford(graph, V, E, source)
    print_distance(shortest_distance, 0)












from typing import List

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


_UpperCAmelCase							:			Any        =							logging.get_logger(__name__)

_UpperCAmelCase							:			Union[str, Any]        =							{
    """snap-research/efficientformer-l1-300""": (
        """https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json"""
    ),
}

class   lowerCAmelCase				(   __UpperCamelCase     ):
 UpperCAmelCase__						=						"""efficientformer"""
 def __init__( self    : Dict     ,	UpperCAmelCase    : List[int] = [3, 2, 6, 4]     ,	UpperCAmelCase    : List[int] = [48, 96, 224, 448]     ,	UpperCAmelCase    : List[bool] = [True, True, True, True]     ,	UpperCAmelCase    : int = 448     ,	UpperCAmelCase    : int = 32     ,	UpperCAmelCase    : int = 4     ,	UpperCAmelCase    : int = 7     ,	UpperCAmelCase    : int = 5     ,	UpperCAmelCase    : int = 8     ,	UpperCAmelCase    : int = 4     ,	UpperCAmelCase    : float = 0.0     ,	UpperCAmelCase    : int = 16     ,	UpperCAmelCase    : int = 3     ,	UpperCAmelCase    : int = 3     ,	UpperCAmelCase    : int = 3     ,	UpperCAmelCase    : int = 2     ,	UpperCAmelCase    : int = 1     ,	UpperCAmelCase    : float = 0.0     ,	UpperCAmelCase    : int = 1     ,	UpperCAmelCase    : bool = True     ,	UpperCAmelCase    : bool = True     ,	UpperCAmelCase    : float = 1e-5     ,	UpperCAmelCase    : str = "gelu"     ,	UpperCAmelCase    : float = 0.0_2     ,	UpperCAmelCase    : float = 1e-12     ,	UpperCAmelCase    : int = 224     ,	UpperCAmelCase    : float = 1e-05     ,	**UpperCAmelCase    : Tuple     ,	)     ->      None:
     super().__init__(**UpperCAmelCase      )

     lowerCamelCase__       : Optional[Any]   					=						hidden_act
     lowerCamelCase__       : int   					=						hidden_dropout_prob
     lowerCamelCase__       : List[Any]   					=						hidden_sizes
     lowerCamelCase__       : int   					=						num_hidden_layers
     lowerCamelCase__       : int   					=						num_attention_heads
     lowerCamelCase__       : Dict   					=						initializer_range
     lowerCamelCase__       : Optional[Any]   					=						layer_norm_eps
     lowerCamelCase__       : int   					=						patch_size
     lowerCamelCase__       : List[Any]   					=						num_channels
     lowerCamelCase__       : List[str]   					=						depths
     lowerCamelCase__       : Any   					=						mlp_expansion_ratio
     lowerCamelCase__       : Any   					=						downsamples
     lowerCamelCase__       : str   					=						dim
     lowerCamelCase__       : Tuple   					=						key_dim
     lowerCamelCase__       : int   					=						attention_ratio
     lowerCamelCase__       : int   					=						resolution
     lowerCamelCase__       : Dict   					=						pool_size
     lowerCamelCase__       : List[str]   					=						downsample_patch_size
     lowerCamelCase__       : Tuple   					=						downsample_stride
     lowerCamelCase__       : int   					=						downsample_pad
     lowerCamelCase__       : Optional[int]   					=						drop_path_rate
     lowerCamelCase__       : Optional[Any]   					=						num_metaad_blocks
     lowerCamelCase__       : Any   					=						distillation
     lowerCamelCase__       : Optional[int]   					=						use_layer_scale
     lowerCamelCase__       : Union[str, Any]   					=						layer_scale_init_value
     lowerCamelCase__       : Optional[int]   					=						image_size
     lowerCamelCase__       : Optional[Any]   					=						batch_norm_eps





