



class        UpperCAmelCase_  :

						'''simple docstring'''




						def __init__(   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= {}






						def 	_A     (   self		):







													'''simple docstring'''

													print(self.vertex		)
													for i in self.vertex:
																				print(_UpperCAmelCase				,							' -> '				,							' -> '.join([str(_UpperCAmelCase		) for j in self.vertex[i]]		)		)






						def 	_A     (   self				,							_A				,							_A		):







													'''simple docstring'''

													if from_vertex in self.vertex:
																				self.vertex[from_vertex].append(_UpperCAmelCase		)
													else:
																				# else make a new vertex
																				__SCREAMING_SNAKE_CASE									= [to_vertex]






						def 	_A     (   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= [False] * len(self.vertex		)

													# call the recursive helper function
													for i in range(len(self.vertex		)		):
																				if not visited[i]:
																											self.dfs_recursive(_UpperCAmelCase				,							_UpperCAmelCase		)






						def 	_A     (   self				,							_A				,							_A		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= True

													print(_UpperCAmelCase				,							end=' '		)

													# Recur for all the vertices that are adjacent to this node
													for i in self.vertex:
																				if not visited[i]:
																											self.dfs_recursive(_UpperCAmelCase				,							_UpperCAmelCase		)


if __name__ == "__main__":
			lowerCAmelCase__		:					str							=Graph()
			g.add_edge(0, 1)
			g.add_edge(0, 2)
			g.add_edge(1, 2)
			g.add_edge(2, 0)
			g.add_edge(2, 3)
			g.add_edge(3, 3)

			g.print_graph()
			print('''DFS:''')
			g.dfs()

			# OUTPUT:
			# 0  ->  1 -> 2
			# 1  ->  2
			# 2  ->  0 -> 3
			# 3  ->  3
			# DFS:
			#  0 1 2 3







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase__		:					List[str]							={
    '''configuration_timesformer''': ['''TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''TimesformerConfig'''],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowerCAmelCase__		:					List[str]							=[
			    '''TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''TimesformerModel''',
			    '''TimesformerForVideoClassification''',
			    '''TimesformerPreTrainedModel''',
			]

if TYPE_CHECKING:
			from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_timesformer import (
						    TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TimesformerForVideoClassification,
						    TimesformerModel,
						    TimesformerPreTrainedModel,
						)

else:
			import sys

			lowerCAmelCase__		:					Union[str, Any]							=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






