"""simple docstring"""







from typing import TYPE_CHECKING

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


UpperCamelCase_				:				Tuple							      =						{"""configuration_levit""": ["""LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LevitConfig""", """LevitOnnxConfig"""]}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCamelCase_				:				Any							      =						["""LevitFeatureExtractor"""]
						UpperCamelCase_				:				List[str]							      =						["""LevitImageProcessor"""]

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						UpperCamelCase_				:				Optional[Any]							      =						[
						    """LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """LevitForImageClassification""",
						    """LevitForImageClassificationWithTeacher""",
						    """LevitModel""",
						    """LevitPreTrainedModel""",
						]


if TYPE_CHECKING:
						from .configuration_levit import LEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, LevitConfig, LevitOnnxConfig

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_levit import LevitFeatureExtractor
												from .image_processing_levit import LevitImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_levit import (
												    LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    LevitForImageClassification,
												    LevitForImageClassificationWithTeacher,
												    LevitModel,
												    LevitPreTrainedModel,
												)
else:
						import sys

						UpperCamelCase_				:				str							      =						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)








from __future__ import annotations

from collections import deque
from queue import Queue
from timeit import timeit

_lowerCamelCase       =	{
    'A': ['B', 'C'],
    'B': ['A', 'D', 'E'],
    'C': ['A', 'F'],
    'D': ['B'],
    'E': ['B', 'F'],
    'F': ['C', 'E'],
}






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							dict    ,      UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					{start}
		SCREAMING_SNAKE_CASE__								=					[start]
		SCREAMING_SNAKE_CASE__								=					Queue()
		queue.put(UpperCamelCase__			)
		while not queue.empty():
				SCREAMING_SNAKE_CASE__								=					queue.get()
				for w in graph[v]:
						if w not in explored:
								explored.add(UpperCamelCase__			)
								result.append(UpperCamelCase__			)
								queue.put(UpperCamelCase__			)
		return result






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							dict    ,      UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					{start}
		SCREAMING_SNAKE_CASE__								=					[start]
		SCREAMING_SNAKE_CASE__								=					deque([start]			)
		while queue:
				SCREAMING_SNAKE_CASE__								=					queue.popleft()
				for child in graph[v]:
						if child not in visited:
								visited.add(UpperCamelCase__			)
								result.append(UpperCamelCase__			)
								queue.append(UpperCamelCase__			)
		return result






def  SCREAMING_SNAKE_CASE__							(				UpperCamelCase__:							str			):
		SCREAMING_SNAKE_CASE__								=					f'''from __main__ import G, {name}'''
		SCREAMING_SNAKE_CASE__								=					10_000
		SCREAMING_SNAKE_CASE__								=					timeit(f'''{name}(G, \'A\')'''    ,      setup=UpperCamelCase__    ,      number=UpperCamelCase__			)
		print(f'''{name:<35} finished {number} runs in {res:.5f} seconds'''			)


if __name__ == "__main__":
	import doctest

	doctest.testmod()

	benchmark_function('breadth_first_search')
	benchmark_function('breadth_first_search_with_deque')
	# breadth_first_search                finished 10000 runs in 0.20999 seconds
	# breadth_first_search_with_deque     finished 10000 runs in 0.01421 seconds