





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


__UpperCamelCase:	List[str] = logging.get_logger(__name__)

__UpperCamelCase:	Optional[Any] = {
    """google/vivit-b-16x2-kinetics400""": (
        """https://huggingface.co/google/vivit-b-16x2-kinetics400/resolve/main/config.json"""
    ),
    # See all Vivit models at https://huggingface.co/models?filter=vivit
}


class       __lowerCAmelCase					(       _UpperCamelCase      ):


	'''simple docstring'''





	_A													=				"vivit"

	def __init__(						self:						List[str],					lowerCamelCase_:						Union[str, Any]=224,					lowerCamelCase_:						Union[str, Any]=32,					lowerCamelCase_:						Any=[2, 16, 16],					lowerCamelCase_:						List[Any]=3,					lowerCamelCase_:						Any=768,					lowerCamelCase_:						List[str]=12,					lowerCamelCase_:						Optional[int]=12,					lowerCamelCase_:						Dict=3072,					lowerCamelCase_:						Tuple="gelu_fast",					lowerCamelCase_:						Any=0.0,					lowerCamelCase_:						List[str]=0.0,					lowerCamelCase_:						Any=0.0_2,					lowerCamelCase_:						Optional[int]=1E-06,					lowerCamelCase_:						Any=True,					**lowerCamelCase_:						Optional[Any],					):
			lowercase__					:      Union[str, Any]      =		hidden_size
			lowercase__					:      Tuple      =		num_hidden_layers
			lowercase__					:      Optional[int]      =		num_attention_heads
			lowercase__					:      Optional[Any]      =		intermediate_size
			lowercase__					:      Optional[Any]      =		hidden_act
			lowercase__					:      Dict      =		hidden_dropout_prob
			lowercase__					:      int      =		attention_probs_dropout_prob
			lowercase__					:      Optional[int]      =		initializer_range
			lowercase__					:      Tuple      =		layer_norm_eps

			lowercase__					:      int      =		image_size
			lowercase__					:      List[str]      =		num_frames
			lowercase__					:      Union[str, Any]      =		tubelet_size
			lowercase__					:      int      =		num_channels
			lowercase__					:      int      =		qkv_bias

			super().__init__(**lowerCamelCase_			)









from __future__ import annotations


def       SCREAMING_SNAKE_CASE__  (       _lowercase     : list[float]   ,    _lowercase     : Tuple			)   ->							int:




		'''simple docstring'''
		print(f"""Vertex\tShortest Distance from vertex {src}"""			)
		for i, d in enumerate(_lowercase			):
				print(f"""{i}\t\t{d}"""			)


def       SCREAMING_SNAKE_CASE__  (       _lowercase     : list[dict[str, int]]   ,    _lowercase     : list[float]   ,    _lowercase     : int			)   ->							Any:




		'''simple docstring'''
		for j in range(_lowercase			):
				lowercase__   ,				lowercase__   ,				lowercase__					:      Dict      =		(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__  (       _lowercase     : list[dict[str, int]]   ,    _lowercase     : int   ,    _lowercase     : int   ,    _lowercase     : int			)   ->							list[float]:




		'''simple docstring'''
		lowercase__					:      Dict      =		[float('inf'			)] * vertex_count
		lowercase__					:      Dict      =		0.0

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

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

		lowercase__					:      str      =		check_negative_cycle(_lowercase   ,    _lowercase   ,    _lowercase			)
		if negative_cycle_exists:
				raise Exception('Negative cycle found'			)

		return distance


if __name__ == "__main__":
			import doctest

			doctest.testmod()

			__UpperCamelCase:	Optional[int] = int(input("""Enter number of vertices: """).strip())
			__UpperCamelCase:	Union[str, Any] = 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[str] = (
						    int(x)
						    for x in input("""Enter source, destination, weight: """).strip().split(""" """)
						)
						__UpperCamelCase:	List[Any] = {"""src""": src, """dst""": dest, """weight""": weight}

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


