'''simple docstring'''





def      lowerCAmelCase_    ( snake_case_	:			List[Any]      )   ->				Tuple:


     '''simple docstring'''




     UpperCAmelCase_	   =       [0] * len(__lowerCAmelCase      )
     UpperCAmelCase_	   =       []
     UpperCAmelCase_	   =       [1] * len(__lowerCAmelCase      )

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

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

     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(__lowerCAmelCase      )

     print(max(__lowerCAmelCase      )      )


# Adjacency list of Graph
SCREAMING_SNAKE_CASE_:					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'''





import unittest

from transformers import load_tool
from transformers.utils import is_torch_available


if is_torch_available():
    import torch

from transformers.testing_utils import require_torch

from .test_tools_common import ToolTesterMixin




@require_torch
class 	__A				(			unittest.TestCase		,     UpperCamelCase__     ):



    def  _lowercase						(self   :   Tuple			):
         UpperCAmelCase_	   =       load_tool("text-to-speech"			)
         self.tool.setup()



    def  _lowercase						(self   :   Union[str, Any]			):
         # SpeechT5 isn't deterministic
         torch.manual_seed(0			)
         UpperCAmelCase_	   =       self.tool("hey"			)
         UpperCAmelCase_	   =       result.to_raw()
         self.assertTrue(
             torch.allclose(
                 resulting_tensor[:3]       ,      torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]			)       ,      )			)






    def  _lowercase						(self   :   List[str]			):
         # SpeechT5 isn't deterministic
         torch.manual_seed(0			)
         UpperCAmelCase_	   =       self.tool("hey"			)
         UpperCAmelCase_	   =       result.to_raw()
         self.assertTrue(
             torch.allclose(
                 resulting_tensor[:3]       ,      torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]			)       ,      )			)




