






"""simple docstring"""



class 					_UpperCAmelCase       :




					def __init__(				self     :						List[Any]   )  ->  Union[str, Any]:
							lowercase_ : List[str]							       =   {}




					def   A  (				self     :						Dict   )  ->  None:
							print(self.vertex   )
							for i in self.vertex:
									print(A    ,						''' -> '''    ,						''' -> '''.join([str(A   ) for j in self.vertex[i]]   )   )




					def   A  (				self     :						Dict    ,						A     :						int    ,						A     :						int   )  ->  None:
							# check if vertex is already present,
							if from_vertex in self.vertex:
									self.vertex[from_vertex].append(A   )
							else:
									# else make a new vertex
									lowercase_ : int							       =   [to_vertex]




					def   A  (				self     :						Any   )  ->  None:
							# visited array for storing already visited nodes
							lowercase_ : int							       =   [False] * len(self.vertex   )

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






					def   A  (				self     :						Tuple    ,						A     :						int    ,						A     :						list   )  ->  None:
							# mark start vertex as visited
							lowercase_ : Optional[Any]							       =   True

							print(A    ,						end=''' '''   )

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


if __name__ == "__main__":
						__A		:       Tuple  				=		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











"""simple docstring"""



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__A		:       List[Any]  				=		{
    '''configuration_mega''': ['''MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MegaConfig''', '''MegaOnnxConfig'''],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						__A		:       List[str]  				=		[
						    '''MEGA_PRETRAINED_MODEL_ARCHIVE_LIST''',
						    '''MegaForCausalLM''',
						    '''MegaForMaskedLM''',
						    '''MegaForMultipleChoice''',
						    '''MegaForQuestionAnswering''',
						    '''MegaForSequenceClassification''',
						    '''MegaForTokenClassification''',
						    '''MegaModel''',
						    '''MegaPreTrainedModel''',
						]

if TYPE_CHECKING:
						from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_mega import (
												    MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MegaForCausalLM,
												    MegaForMaskedLM,
												    MegaForMultipleChoice,
												    MegaForQuestionAnswering,
												    MegaForSequenceClassification,
												    MegaForTokenClassification,
												    MegaModel,
												    MegaPreTrainedModel,
												)

else:
						import sys

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



