


from collections import deque







def   lowerCamelCase(      a__):
				return input(a__).strip().split(''' ''')







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE	     ={}
				for i in range(a__):
								_SCREAMING_SNAKE_CASE	     =[]

				for e in range(a__):
								_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     =(int(a__) for i in _input(f"Edge {e + 1}: <node1> <node2> "))
								graph[x].append(a__)
				return graph







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE	     ={}
				for i in range(a__):
								_SCREAMING_SNAKE_CASE	     =[]

				for e in range(a__):
								_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     =(int(a__) for i in _input(f"Edge {e + 1}: <node1> <node2> "))
								graph[x].append(a__)
								graph[y].append(a__)
				return graph







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE	     ={}
				for i in range(a__):
								_SCREAMING_SNAKE_CASE	     =[]

				for e in range(a__):
								_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     =(int(a__) for i in _input(f"Edge {e + 1}: <node1> <node2> <weight> "))
								graph[x].append((y, w))
								graph[y].append((x, w))
				return graph


if __name__ == "__main__":
							snake_case_  , snake_case_  :	int							  =							(int(i) for i in _input('''Number of nodes and edges: '''))

							snake_case_  :	Any							  =							int(
							    _input(
							        '''Press 1 or 2 or 3 \n'''
							        '''1. Unweighted directed \n'''
							        '''2. Unweighted undirected \n'''
							        '''3. Weighted undirected \n'''
							    )[0]
							)

							snake_case_  :	str							  =							{
							    1: initialize_unweighted_directed_graph,
							    2: initialize_unweighted_undirected_graph,
							    3: initialize_weighted_undirected_graph,
							}[graph_choice](n, m)







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     ={s}, [s]
				print(a__)
				while _s:
								_SCREAMING_SNAKE_CASE	     =0
								for i in g[_s[-1]]:
												if i not in vis:
																_s.append(a__)
																vis.add(a__)
																_SCREAMING_SNAKE_CASE	     =1
																print(a__)
																break
								if not flag:
												_s.pop()







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     ={s}, deque([s])
				print(a__)
				while q:
								_SCREAMING_SNAKE_CASE	     =q.popleft()
								for v in g[u]:
												if v not in vis:
																vis.add(a__)
																q.append(a__)
																print(a__)







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     ={s: 0}, set(), {s: 0}
				while True:
								if len(a__) == len(a__) - 1:
												break
								_SCREAMING_SNAKE_CASE	     =10_0000
								for i in dist:
												if i not in known and dist[i] < mini:
																_SCREAMING_SNAKE_CASE	     =dist[i]
																_SCREAMING_SNAKE_CASE	     =i
								known.add(a__)
								for v in g[u]:
												if v[0] not in known and dist[u] + v[1] < dist.get(v[0]		,10_0000):
																_SCREAMING_SNAKE_CASE	     =dist[u] + v[1]
																_SCREAMING_SNAKE_CASE	     =u
				for i in dist:
								if i != s:
												print(dist[i])







def   lowerCamelCase(      a__		,a__=None		,a__=None):
				if q is None:
								_SCREAMING_SNAKE_CASE	     =[1]
				if ind is None:
								_SCREAMING_SNAKE_CASE	     =[0] * (len(a__) + 1)  # SInce oth Index is ignored
								for u in g:
												for v in g[u]:
																ind[v] += 1
								_SCREAMING_SNAKE_CASE	     =deque()
								for i in g:
												if ind[i] == 0:
																q.append(a__)
				if len(a__) == 0:
								return
				_SCREAMING_SNAKE_CASE	     =q.popleft()
				print(a__)
				for w in g[v]:
								ind[w] -= 1
								if ind[w] == 0:
												q.append(a__)
				topo(a__		,a__		,a__)







def   lowerCamelCase(      ):
				_SCREAMING_SNAKE_CASE	     =input().strip()
				_SCREAMING_SNAKE_CASE	     =[]
				for _ in range(a__):
								a.append(map(a__		,input().strip().split()))
				return a, n







def   lowerCamelCase(      a__):
				((_SCREAMING_SNAKE_CASE)     , (_SCREAMING_SNAKE_CASE))	     =a_and_n
				_SCREAMING_SNAKE_CASE	     =list(a__)
				_SCREAMING_SNAKE_CASE	     =[[0] * n for i in range(a__)]
				for k in range(a__):
								for i in range(a__):
												for j in range(a__):
																if dist[i][j] > dist[i][k] + dist[k][j]:
																				_SCREAMING_SNAKE_CASE	     =dist[i][k] + dist[k][j]
																				_SCREAMING_SNAKE_CASE	     =k
				print(a__)







def   lowerCamelCase(      a__		,a__):
				_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     ={s: 0}, set(), {s: 0}
				while True:
								if len(a__) == len(a__) - 1:
												break
								_SCREAMING_SNAKE_CASE	     =10_0000
								for i in dist:
												if i not in known and dist[i] < mini:
																_SCREAMING_SNAKE_CASE	     =dist[i]
																_SCREAMING_SNAKE_CASE	     =i
								known.add(a__)
								for v in g[u]:
												if v[0] not in known and v[1] < dist.get(v[0]		,10_0000):
																_SCREAMING_SNAKE_CASE	     =v[1]
																_SCREAMING_SNAKE_CASE	     =u
				return dist







def   lowerCamelCase(      ):
				_SCREAMING_SNAKE_CASE     , _SCREAMING_SNAKE_CASE	     =map(a__		,input().split(''' '''))
				_SCREAMING_SNAKE_CASE	     =[]
				for _ in range(a__):
								edges.append(map(a__		,input().split(''' ''')))
				return edges, n







def   lowerCamelCase(      a__):
				# Sort edges on the basis of distance
				((_SCREAMING_SNAKE_CASE)     , (_SCREAMING_SNAKE_CASE))	     =e_and_n
				e.sort(reverse=a__		,key=lambda a__: x[2])
				_SCREAMING_SNAKE_CASE	     =[{i} for i in range(1		,n + 1)]
				while True:
								if len(a__) == 1:
												break
								print(a__)
								_SCREAMING_SNAKE_CASE	     =e.pop()
								for i in range(len(a__)):
												if x[0] in s[i]:
																break
								for j in range(len(a__)):
												if x[1] in s[j]:
																if i == j:
																				break
																s[j].update(s[i])
																s.pop(a__)
																break







def   lowerCamelCase(      a__):
				_SCREAMING_SNAKE_CASE	     =[]
				for node in graph:
								if not graph[node]:
												isolated.append(a__)
				return isolated



from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


snake_case_  :	Any							  =							logging.get_logger(__name__)

snake_case_  :	Any							  =							{
    '''apple/mobilevit-small''': '''https://huggingface.co/apple/mobilevit-small/resolve/main/config.json''',
    '''apple/mobilevit-x-small''': '''https://huggingface.co/apple/mobilevit-x-small/resolve/main/config.json''',
    '''apple/mobilevit-xx-small''': '''https://huggingface.co/apple/mobilevit-xx-small/resolve/main/config.json''',
    '''apple/deeplabv3-mobilevit-small''': (
        '''https://huggingface.co/apple/deeplabv3-mobilevit-small/resolve/main/config.json'''
    ),
    '''apple/deeplabv3-mobilevit-x-small''': (
        '''https://huggingface.co/apple/deeplabv3-mobilevit-x-small/resolve/main/config.json'''
    ),
    '''apple/deeplabv3-mobilevit-xx-small''': (
        '''https://huggingface.co/apple/deeplabv3-mobilevit-xx-small/resolve/main/config.json'''
    ),
    # See all MobileViT models at https://huggingface.co/models?filter=mobilevit
}

class   A__							(						UpperCamelCase__     ):
						UpperCAmelCase									=  "mobilevit"




						def __init__(				self    :					Tuple ,			_a    :					Any=3 ,			_a    :					Any=256 ,			_a    :					Any=2 ,			_a    :					List[str]=[144, 192, 240] ,			_a    :					Optional[int]=[16, 32, 64, 96, 128, 160, 640] ,			_a    :					Union[str, Any]=4 ,			_a    :					Any=2.0 ,			_a    :					List[str]=4.0 ,			_a    :					Tuple="silu" ,			_a    :					Optional[Any]=3 ,			_a    :					List[str]=32 ,			_a    :					Union[str, Any]=0.1 ,			_a    :					Tuple=0.0 ,			_a    :					Union[str, Any]=0.1 ,			_a    :					Union[str, Any]=0.02 ,			_a    :					Tuple=1E-5 ,			_a    :					Any=True ,			_a    :					str=256 ,			_a    :					Tuple=[6, 12, 18] ,			_a    :					int=0.1 ,			_a    :					str=255 ,			**_a    :					Any ,			)							->   Optional[int]:


										"""simple docstring"""





										super().__init__(**_a     )

										_SCREAMING_SNAKE_CASE	     =num_channels
										_SCREAMING_SNAKE_CASE	     =image_size
										_SCREAMING_SNAKE_CASE	     =patch_size
										_SCREAMING_SNAKE_CASE	     =hidden_sizes
										_SCREAMING_SNAKE_CASE	     =neck_hidden_sizes
										_SCREAMING_SNAKE_CASE	     =num_attention_heads
										_SCREAMING_SNAKE_CASE	     =mlp_ratio
										_SCREAMING_SNAKE_CASE	     =expand_ratio
										_SCREAMING_SNAKE_CASE	     =hidden_act
										_SCREAMING_SNAKE_CASE	     =conv_kernel_size
										_SCREAMING_SNAKE_CASE	     =output_stride
										_SCREAMING_SNAKE_CASE	     =hidden_dropout_prob
										_SCREAMING_SNAKE_CASE	     =attention_probs_dropout_prob
										_SCREAMING_SNAKE_CASE	     =classifier_dropout_prob
										_SCREAMING_SNAKE_CASE	     =initializer_range
										_SCREAMING_SNAKE_CASE	     =layer_norm_eps
										_SCREAMING_SNAKE_CASE	     =qkv_bias

										# decode head attributes for semantic segmentation
										_SCREAMING_SNAKE_CASE	     =aspp_out_channels
										_SCREAMING_SNAKE_CASE	     =atrous_rates
										_SCREAMING_SNAKE_CASE	     =aspp_dropout_prob
										_SCREAMING_SNAKE_CASE	     =semantic_loss_ignore_index

class   A__							(						UpperCamelCase__     ):
						UpperCAmelCase									=  version.parse("1.11"     )




						@property
						def 							__UpperCamelCase (				self    :					Union[str, Any]     )							->   Mapping[str, Mapping[int, str]]:


										"""simple docstring"""





										return OrderedDict([('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''})]     )




						@property
						def 							__UpperCamelCase (				self    :					Dict     )							->   Mapping[str, Mapping[int, str]]:


										"""simple docstring"""





										if self.task == "image-classification":
														return OrderedDict([('''logits''', {0: '''batch'''})]     )
										else:
														return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]     )




						@property
						def 							__UpperCamelCase (				self    :					List[Any]     )							->   float:


										"""simple docstring"""





										return 1E-4