






def   UpperCamelCase  (       snake_case__     :   dict  ):




     '''simple docstring'''






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






def   UpperCamelCase  (       snake_case__     :   dict	,snake_case__     :   int	,snake_case__     :   set	,snake_case__     :   set  ):




     '''simple docstring'''






     visited.add(snake_case__  )
     rec_stk.add(snake_case__  )

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

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


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

     testmod()










from typing import TYPE_CHECKING

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


lowerCamelCase__							=     {"""configuration_dpt""": ["""DPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DPTConfig"""]}

try:
     if not is_vision_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase__							=     ["""DPTFeatureExtractor"""]
     lowerCamelCase__							=     ["""DPTImageProcessor"""]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     lowerCamelCase__							=     [
         """DPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """DPTForDepthEstimation""",
         """DPTForSemanticSegmentation""",
         """DPTModel""",
         """DPTPreTrainedModel""",
     ]


if TYPE_CHECKING:
     from .configuration_dpt import DPT_PRETRAINED_CONFIG_ARCHIVE_MAP, DPTConfig

     try:
          if not is_vision_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .feature_extraction_dpt import DPTFeatureExtractor
          from .image_processing_dpt import DPTImageProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_dpt import (
              DPT_PRETRAINED_MODEL_ARCHIVE_LIST,
              DPTForDepthEstimation,
              DPTForSemanticSegmentation,
              DPTModel,
              DPTPreTrainedModel,
          )


else:
     import sys

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


