def  _lowerCamelCase					(   a_				: dict):
			lowerCamelCase						:set[int]						  =     set()
			# To detect a back edge, keep track of vertices currently in the recursion stack
			lowerCamelCase						:set[int]						  =     set()
			return any(
			    node not in visited and depth_first_search(a_						,			a_						,			a_						,			a_)
			    for node in graph)





def  _lowerCamelCase					(   a_				: dict						,			a_				: int						,			a_				: set						,			a_				: set):
			visited.add(a_)
			rec_stk.add(a_)

			for node in graph[vertex]:
						if node not in visited:
									if depth_first_search(a_						,			a_						,			a_						,			a_):
												return True
						elif node in rec_stk:
									return True

    # The node needs to be removed from recursion stack before function ends
			rec_stk.remove(a_)
			return False


if __name__ == "__main__":
			from doctest import testmod

			testmod()




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


A__           =							{
    """configuration_nllb_moe""": [
        """NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """NllbMoeConfig""",
    ]
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			A__           =							[
			    """NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """NllbMoeForConditionalGeneration""",
			    """NllbMoeModel""",
			    """NllbMoePreTrainedModel""",
			    """NllbMoeTop2Router""",
			    """NllbMoeSparseMLP""",
			]


if TYPE_CHECKING:
			from .configuration_nllb_moe import (
			    NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
			    NllbMoeConfig,
			)

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_nllb_moe import (
						    NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
						    NllbMoeForConditionalGeneration,
						    NllbMoeModel,
						    NllbMoePreTrainedModel,
						    NllbMoeSparseMLP,
						    NllbMoeTopaRouter,
						)


else:
			import sys

			A__           =							_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



