






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__lowerCamelCase						= {'configuration_detr': ['DETR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'DetrConfig', 'DetrOnnxConfig']}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__lowerCamelCase						= ['DetrFeatureExtractor']
						__lowerCamelCase						= ['DetrImageProcessor']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__lowerCamelCase						= [
						    'DETR_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'DetrForObjectDetection',
						    'DetrForSegmentation',
						    'DetrModel',
						    'DetrPreTrainedModel',
						]


if TYPE_CHECKING:
						from .configuration_detr import DETR_PRETRAINED_CONFIG_ARCHIVE_MAP, DetrConfig, DetrOnnxConfig

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_detr import DetrFeatureExtractor
												from .image_processing_detr import DetrImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_detr import (
												    DETR_PRETRAINED_MODEL_ARCHIVE_LIST,
												    DetrForObjectDetection,
												    DetrForSegmentation,
												    DetrModel,
												    DetrPreTrainedModel,
												)

else:
						import sys

						__lowerCamelCase						= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)







__lowerCamelCase						= {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]}

__lowerCamelCase						= {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []}






def    UpperCamelCase__  (   UpperCAmelCase    ,	UpperCAmelCase    ,	UpperCAmelCase     )     ->		list:







							"""simple docstring"""





							_a  :    List[Any]			=						True
							_a  :    Optional[Any]			=						[]

							for neighbour in graph[vert]:
														if not visited[neighbour]:
																					connected_verts += dfs(UpperCAmelCase    ,	UpperCAmelCase    ,	UpperCAmelCase     )

							return [vert, *connected_verts]






def    UpperCamelCase__  (   UpperCAmelCase     )     ->		list:







							"""simple docstring"""





							_a  :    Optional[int]			=						len(UpperCAmelCase     )
							_a  :    Optional[Any]			=						graph_size * [False]
							_a  :    Optional[int]			=						[]

							for i in range(UpperCAmelCase     ):
														if not visited[i]:
																					_a  :    List[str]			=						dfs(UpperCAmelCase    ,	UpperCAmelCase    ,	UpperCAmelCase     )
																					components_list.append(UpperCAmelCase     )

							return components_list


if __name__ == "__main__":
						import doctest

						doctest.testmod()