




"""simple docstring"""

from __future__ import annotations
class      A__   :




	def __init__( self	:						Union[str, Any]   ,     lowercase	:						int						)       ->			None:
						__snake_case        =						vertices
						__snake_case        =						[[0] * vertices for _ in range(lowercase						)]




	def 				a_		( self	:						List[Any]   ,     lowercase	:						list[int]						)       ->			None:
						print("""Vertex \t Distance from Source"""						)
						for vertex in range(self.vertices						):
											print(lowercase   ,     """\t\t"""   ,     distances_from_source[vertex]						)




	def 				a_		( self	:						Any   ,     lowercase	:						list[int]   ,     lowercase	:						list[bool]						)       ->			int:
						__snake_case        =						1e7
						__snake_case        =						0

						# Search not nearest vertex not in the shortest path tree
						for vertex in range(self.vertices						):
											if distances_from_source[vertex] < minimum and visited[vertex] is False:
																__snake_case        =						distances_from_source[vertex]
																__snake_case        =						vertex
						return min_index




	def 				a_		( self	:						Optional[Any]   ,     lowercase	:						int						)       ->			None:
						__snake_case        =						[int(1e7						)] * self.vertices  # distances from the source
						__snake_case        =						0
						__snake_case        =						[False] * self.vertices

						for _ in range(self.vertices						):
											__snake_case        =						self.minimum_distance(lowercase   ,     lowercase						)
											__snake_case        =						True

											# Update dist value of the adjacent vertices
											# of the picked vertex only if the current
											# distance is greater than new distance and
											# the vertex in not in the shortest path tree
											for v in range(self.vertices						):
																if (
																    self.graph[u][v] > 0
																    and visited[v] is False
																    and distances[v] > distances[u] + self.graph[u][v]
																):
																					__snake_case        =						distances[u] + self.graph[u][v]

						self.print_solution(lowercase						)


if __name__ == "__main__":
		UpperCamelCase__			:     Dict			       =				Graph(9)
		UpperCamelCase__			:     Optional[int]			       =				[
		    [0, 4, 0, 0, 0, 0, 0, 8, 0],
		    [4, 0, 8, 0, 0, 0, 0, 11, 0],
		    [0, 8, 0, 7, 0, 4, 0, 0, 2],
		    [0, 0, 7, 0, 9, 14, 0, 0, 0],
		    [0, 0, 0, 9, 0, 10, 0, 0, 0],
		    [0, 0, 4, 14, 10, 0, 2, 0, 0],
		    [0, 0, 0, 0, 0, 2, 0, 1, 6],
		    [8, 11, 0, 0, 0, 0, 1, 0, 7],
		    [0, 0, 2, 0, 0, 0, 6, 7, 0],
		]
		graph.dijkstra(0)








"""simple docstring"""

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
from ..clip.configuration_clip import CLIPVisionConfig


UpperCamelCase__			:     Optional[Any]			       =				logging.get_logger(__name__)
class      A__   (   lowercase_  ):
	A_				:					List[str]      =   """vision-text-dual-encoder"""
	A_				:					Tuple      =   True




	def __init__( self	:						Tuple   ,     lowercase	:						List[Any]=512   ,     lowercase	:						Any=2.65_92   ,     **lowercase	:						int						)       ->			int:
						super().__init__(**lowercase						)

						if "vision_config" not in kwargs:
											raise ValueError("""`vision_config` can not be `None`."""						)

						if "text_config" not in kwargs:
											raise ValueError("""`text_config` can not be `None`."""						)

						__snake_case        =						kwargs.pop("""vision_config"""						)
						__snake_case        =						kwargs.pop("""text_config"""						)

						__snake_case        =						vision_config.pop("""model_type"""						)
						__snake_case        =						text_config.pop("""model_type"""						)

						if vision_model_type == "clip":
											__snake_case        =						AutoConfig.for_model(lowercase   ,     **lowercase						).vision_config
						elif vision_model_type == "clip_vision_model":
											__snake_case        =						CLIPVisionConfig(**lowercase						)
						else:
											__snake_case        =						AutoConfig.for_model(lowercase   ,     **lowercase						)

						__snake_case        =						AutoConfig.for_model(lowercase   ,     **lowercase						)

						__snake_case        =						projection_dim
						__snake_case        =						logit_scale_init_value




	@classmethod
	def 				a_		( cls	:						Union[str, Any]   ,     lowercase	:						PretrainedConfig   ,     lowercase	:						PretrainedConfig   ,     **lowercase	:						Optional[int]						)       ->			Dict:
						return cls(vision_config=vision_config.to_dict()   ,     text_config=text_config.to_dict()   ,     **lowercase						)




	def 				a_		( self	:						Dict						)       ->			Dict:
						__snake_case        =						copy.deepcopy(self.__dict__						)
						__snake_case        =						self.vision_config.to_dict()
						__snake_case        =						self.text_config.to_dict()
						__snake_case        =						self.__class__.model_type
						return output


