"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


__lowerCamelCase      :			Optional[int]							       =		{'''configuration_swin''': ['''SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''SwinConfig''', '''SwinOnnxConfig''']}


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __lowerCamelCase      :			Optional[Any]							       =		[
       '''SWIN_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''SwinForImageClassification''',
       '''SwinForMaskedImageModeling''',
       '''SwinModel''',
       '''SwinPreTrainedModel''',
       '''SwinBackbone''',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __lowerCamelCase      :			int							       =		[
       '''TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''TFSwinForImageClassification''',
       '''TFSwinForMaskedImageModeling''',
       '''TFSwinModel''',
       '''TFSwinPreTrainedModel''',
   ]

if TYPE_CHECKING:
   from .configuration_swin import SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinConfig, SwinOnnxConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_swin import (
          SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
          SwinBackbone,
          SwinForImageClassification,
          SwinForMaskedImageModeling,
          SwinModel,
          SwinPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_swin import (
          TF_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFSwinForImageClassification,
          TFSwinForMaskedImageModeling,
          TFSwinModel,
          TFSwinPreTrainedModel,
      )

else:
   import sys

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

def      __SCREAMING_SNAKE_CASE  ( __UpperCamelCase   :	List[Any]     )							-> Any:







  """simple docstring"""





  SCREAMING_SNAKE_CASE__      							=				[0] * len(__UpperCamelCase     )
  SCREAMING_SNAKE_CASE__      							=				[]
  SCREAMING_SNAKE_CASE__      							=				[1] * len(__UpperCamelCase     )

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

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

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

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

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

  print(max(__UpperCamelCase     )     )


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






longest_distance(graph)
