



'''simple docstring'''
from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass






@dataclass
class 							lowercase__	:
	lowercase__  				=			42
	lowercase__  				=			42






class 							lowercase__	:





	def __init__( self					:				List[str] ,lowerCamelCase__					:				int ):







							'''simple docstring'''
							_UpperCamelCase					:		list[list[Edge]] 				=   [[] for _ in range(lowerCamelCase__ )]
							_UpperCamelCase					:		Dict 				=   size





	def __getitem__( self					:				Tuple ,lowerCamelCase__					:				int ):







							'''simple docstring'''
							return iter(self._graph[vertex] )





	@property
	def 	UpperCamelCase_  ( self					:				Optional[Any] ):







							'''simple docstring'''
							return self._size





	def 	UpperCamelCase_  ( self					:				Tuple ,lowerCamelCase__					:				int ,lowerCamelCase__					:				int ,lowerCamelCase__					:				int ):







							'''simple docstring'''
							if weight not in (0, 1):
													raise ValueError('Edge weight must be either 0 or 1.' )

							if to_vertex < 0 or to_vertex >= self.size:
													raise ValueError('Vertex indexes must be in [0; size).' )

							self._graph[from_vertex].append(Edge(lowerCamelCase__ ,lowerCamelCase__ ) )





	def 	UpperCamelCase_  ( self					:				Dict ,lowerCamelCase__					:				int ,lowerCamelCase__					:				int ):







							'''simple docstring'''
							_UpperCamelCase					:		Optional[int] 				=   deque([start_vertex] )
							_UpperCamelCase					:		list[int | None] 				=   [None] * self.size
							_UpperCamelCase					:		Union[str, Any] 				=   0

							while queue:
													_UpperCamelCase					:		str 				=   queue.popleft()
													_UpperCamelCase					:		int 				=   distances[current_vertex]
													if current_distance is None:
																			continue

													for edge in self[current_vertex]:
																			_UpperCamelCase					:		Optional[int] 				=   current_distance + edge.weight
																			_UpperCamelCase					:		Any 				=   distances[edge.destination_vertex]
																			if (
																			    isinstance(lowerCamelCase__ ,lowerCamelCase__ )
																			    and new_distance >= dest_vertex_distance
																			):
																									continue
																			_UpperCamelCase					:		Optional[Any] 				=   new_distance
																			if edge.weight == 0:
																									queue.appendleft(edge.destination_vertex )
																			else:
																									queue.append(edge.destination_vertex )

							if distances[finish_vertex] is None:
													raise ValueError('No path from start_vertex to finish_vertex.' )

							return distances[finish_vertex]


if __name__ == "__main__":
					import doctest

					doctest.testmod()



"""simple docstring"""






from collections import OrderedDict
from typing import List, Mapping

from packaging import version

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


__lowerCAmelCase    :       List[Any]					     =logging.get_logger(__name__)

__lowerCAmelCase    :       Union[str, Any]					     ={
    """google/efficientnet-b7""": """https://huggingface.co/google/efficientnet-b7/resolve/main/config.json""",
}





class  _A						(       lowerCAmelCase	):
      snake_case__			:   Optional[int]							  =	'efficientnet'

      def __init__(						self		,       __lowerCAmelCase = 3		,       __lowerCAmelCase = 600		,       __lowerCAmelCase = 2.0		,       __lowerCAmelCase = 3.1		,       __lowerCAmelCase = 8		,       __lowerCAmelCase = [3, 3, 5, 3, 5, 5, 3]		,       __lowerCAmelCase = [32, 16, 24, 40, 80, 112, 192]		,       __lowerCAmelCase = [16, 24, 40, 80, 112, 192, 320]		,       __lowerCAmelCase = []		,       __lowerCAmelCase = [1, 2, 2, 2, 1, 2, 1]		,       __lowerCAmelCase = [1, 2, 2, 3, 3, 4, 1]		,       __lowerCAmelCase = [1, 6, 6, 6, 6, 6, 6]		,       __lowerCAmelCase = 0.2_5		,       __lowerCAmelCase = "swish"		,       __lowerCAmelCase = 2560		,       __lowerCAmelCase = "mean"		,       __lowerCAmelCase = 0.0_2		,       __lowerCAmelCase = 0.0_0_1		,       __lowerCAmelCase = 0.9_9		,       __lowerCAmelCase = 0.5		,       __lowerCAmelCase = 0.2		,       **__lowerCAmelCase		,       ):







            """simple docstring"""



            super().__init__(**__lowerCAmelCase						)

            lowercase														=	num_channels
            lowercase														=	image_size
            lowercase														=	width_coefficient
            lowercase														=	depth_coefficient
            lowercase														=	depth_divisor
            lowercase														=	kernel_sizes
            lowercase														=	in_channels
            lowercase														=	out_channels
            lowercase														=	depthwise_padding
            lowercase														=	strides
            lowercase														=	num_block_repeats
            lowercase														=	expand_ratios
            lowercase														=	squeeze_expansion_ratio
            lowercase														=	hidden_act
            lowercase														=	hidden_dim
            lowercase														=	pooling_type
            lowercase														=	initializer_range
            lowercase														=	batch_norm_eps
            lowercase														=	batch_norm_momentum
            lowercase														=	dropout_rate
            lowercase														=	drop_connect_rate
            lowercase														=	sum(__lowerCAmelCase						) * 4






class  _A						(       lowerCAmelCase	):
      snake_case__			:   Dict							  =	version.parse('1.11'	)

      @property
      def 				A__       (						self						):







            """simple docstring"""



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







      @property
      def 				A__       (						self						):







            """simple docstring"""



            return 1E-5



