


'''simple docstring'''







def 			lowercase				(_A					):







       """simple docstring"""







       _lowerCAmelCase    :							Tuple   			=       [0] * len(_A					)
       _lowerCAmelCase    :							Dict   			=       []
       _lowerCAmelCase    :							List[Any]   			=       [1] * len(_A					)

       for values in graph.values():
              for i in values:
                     indegree[i] += 1

       for i in range(len(_A					)					):
              if indegree[i] == 0:
                     queue.append(_A					)

       while queue:
              _lowerCAmelCase    :							List[str]   			=       queue.pop(0					)
              for x in graph[vertex]:
                     indegree[x] -= 1

                     if long_dist[vertex] + 1 > long_dist[x]:
                            _lowerCAmelCase    :							List[Any]   			=       long_dist[vertex] + 1

                     if indegree[x] == 0:
                            queue.append(_A					)

       print(max(_A					)					)


# Adjacency list of Graph
lowerCAmelCase    :     Optional[int]					=						{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}
longest_distance(graph)






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase    :     Any					=						{
    """configuration_x_clip""": [
        """XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """XCLIPConfig""",
        """XCLIPTextConfig""",
        """XCLIPVisionConfig""",
    ],
    """processing_x_clip""": ["""XCLIPProcessor"""],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCAmelCase    :     Optional[Any]					=						[
           """XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST""",
           """XCLIPModel""",
           """XCLIPPreTrainedModel""",
           """XCLIPTextModel""",
           """XCLIPVisionModel""",
       ]

if TYPE_CHECKING:
       from .configuration_x_clip import (
           XCLIP_PRETRAINED_CONFIG_ARCHIVE_MAP,
           XCLIPConfig,
           XCLIPTextConfig,
           XCLIPVisionConfig,
       )
       from .processing_x_clip import XCLIPProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_x_clip import (
                  XCLIP_PRETRAINED_MODEL_ARCHIVE_LIST,
                  XCLIPModel,
                  XCLIPPreTrainedModel,
                  XCLIPTextModel,
                  XCLIPVisionModel,
              )

else:
       import sys

       lowerCAmelCase    :     Dict					=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

