


def 	lowerCAmelCase__			(      a__:		Optional[Any]	)  ->		Optional[Any]:


							'''simple docstring'''





							_UpperCAmelCase					=      [0] * len(a__	)
							_UpperCAmelCase					=      []
							_UpperCAmelCase					=      [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:
														_UpperCAmelCase					=      queue.pop(0	)
														for x in graph[vertex]:
																					indegree[x] -= 1

																					if long_dist[vertex] + 1 > long_dist[x]:
																												_UpperCAmelCase					=      long_dist[vertex] + 1

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

							print(max(a__	)	)


# Adjacency list of Graph
lowerCAmelCase__  :str             =							{0: [2, 3, 4], 1: [2, 7], 2: [5], 3: [5, 7], 4: [7], 5: [6], 6: [7], 7: []}







longest_distance(graph)




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase__  :List[str]             =							{
    '''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__  :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__  :str             =							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
