
from ...processing_utils import ProcessorMixin





class 			_lowerCAmelCase      (			_UpperCAmelCase ):
				_lowercase    	=["""image_processor""", """feature_extractor"""]
				_lowercase    	="""TvltImageProcessor"""
				_lowercase    	="""TvltFeatureExtractor"""




				def __init__(      self       ,       _UpperCamelCase       ,       _UpperCamelCase  )       ->   Any:
							super().__init__(image_processor=lowercase__       ,       feature_extractor=lowercase__  )

							lowerCAmelCase_      			=			image_processor
							lowerCAmelCase_      			=			feature_extractor




				def __call__(      self       ,       _UpperCamelCase=None       ,       _UpperCamelCase=None       ,       _UpperCamelCase=None       ,       _UpperCamelCase=None       ,       _UpperCamelCase=False       ,       _UpperCamelCase=False       ,       *_UpperCamelCase       ,       **_UpperCamelCase       ,       )       ->   Any:

							if images is None and audio is None:
										raise ValueError("You need to specify either an `images` or `audio` input to process."  )

							lowerCAmelCase_      			=			None
							if images is not None:
										lowerCAmelCase_      			=			self.image_processor(lowercase__       ,       mask_pixel=lowercase__       ,       *lowercase__       ,       **lowercase__  )
							if images_mixed is not None:
										lowerCAmelCase_      			=			self.image_processor(lowercase__       ,       is_mixed=lowercase__       ,       *lowercase__       ,       **lowercase__  )
							if audio is not None:
										lowerCAmelCase_      			=			self.feature_extractor(
										    lowercase__       ,       *lowercase__       ,       sampling_rate=lowercase__       ,       mask_audio=lowercase__       ,       **lowercase__  )

							lowerCAmelCase_      			=			{}
							if audio is not None:
										output_dict.update(lowercase__  )
							if images is not None:
										output_dict.update(lowercase__  )
							if images_mixed_dict is not None:
										output_dict.update(lowercase__  )
							return output_dict




				@property
				def   __a		(      self  )       ->   List[str]:
							lowerCAmelCase_      			=			self.image_processor.model_input_names
							lowerCAmelCase_      			=			self.feature_extractor.model_input_names
							return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names  )  )





import math





class 			_lowerCAmelCase      :




				def __init__(      self       ,       _UpperCamelCase=0  )       ->   Tuple:  # a graph with Node 0,1,...,N-1
							lowerCAmelCase_      			=			n
							lowerCAmelCase_      			=			[
							    [math.inf for j in range(0       ,       _UpperCamelCase  )] for i in range(0       ,       _UpperCamelCase  )
							]  # adjacency matrix for weight
							lowerCAmelCase_      			=			[
							    [math.inf for j in range(0       ,       _UpperCamelCase  )] for i in range(0       ,       _UpperCamelCase  )
							]  # dp[i][j] stores minimum distance from i to j




				def   __a		(      self       ,       _UpperCamelCase       ,       _UpperCamelCase       ,       _UpperCamelCase  )       ->   List[Any]:
							lowerCAmelCase_      			=			w




				def   __a		(      self  )       ->   List[str]:
							for k in range(0       ,       self.n  ):
										for i in range(0       ,       self.n  ):
													for j in range(0       ,       self.n  ):
																lowerCAmelCase_      			=			min(self.dp[i][j]       ,       self.dp[i][k] + self.dp[k][j]  )




				def   __a		(      self       ,       _UpperCamelCase       ,       _UpperCamelCase  )       ->   Dict:
							return self.dp[u][v]


if __name__ == "__main__":
			_A     =  Graph(5)
			graph.add_edge(0, 2, 9)
			graph.add_edge(0, 4, 10)
			graph.add_edge(1, 3, 5)
			graph.add_edge(2, 3, 7)
			graph.add_edge(3, 0, 10)
			graph.add_edge(3, 1, 2)
			graph.add_edge(3, 2, 1)
			graph.add_edge(3, 4, 6)
			graph.add_edge(4, 1, 3)
			graph.add_edge(4, 2, 4)
			graph.add_edge(4, 3, 9)
			graph.floyd_warshall()
			graph.show_min(1, 4)
			graph.show_min(0, 3)



