



def 	_lowerCAmelCase						(				__lowerCamelCase   :     Optional[int]     ):  # noqa: E741



 """simple docstring"""





 __SCREAMING_SNAKE_CASE       :    str       =	len(lowerCAmelCase__     )
 __SCREAMING_SNAKE_CASE       :    Any       =	0
 __SCREAMING_SNAKE_CASE       :    List[Any]       =	[0] * n
 __SCREAMING_SNAKE_CASE       :    str       =	[False] * n
 __SCREAMING_SNAKE_CASE       :    str       =	[False] * n

 def dfs(__lowerCamelCase   :     int		,	__lowerCamelCase   :     str		,	__lowerCamelCase   :     List[str]		,	__lowerCamelCase   :     Optional[Any]     ):
  if parent == root:
   out_edge_count += 1
  __SCREAMING_SNAKE_CASE       :    Any       =	True
  __SCREAMING_SNAKE_CASE       :    str       =	at

  for to in l[at]:
   if to == parent:
    pass
   elif not visited[to]:
    __SCREAMING_SNAKE_CASE       :    Union[str, Any]       =	dfs(lowerCAmelCase__		,	lowerCAmelCase__		,	lowerCAmelCase__		,	lowerCAmelCase__     )
    __SCREAMING_SNAKE_CASE       :    Tuple       =	min(low[at]		,	low[to]     )

    # AP found via bridge
    if at < low[to]:
     __SCREAMING_SNAKE_CASE       :    List[Any]       =	True
    # AP found via cycle
    if at == low[to]:
     __SCREAMING_SNAKE_CASE       :    int       =	True
   else:
    __SCREAMING_SNAKE_CASE       :    Tuple       =	min(low[at]		,	lowerCAmelCase__     )
  return out_edge_count

 for i in range(lowerCAmelCase__     ):
  if not visited[i]:
   __SCREAMING_SNAKE_CASE       :    List[str]       =	0
   __SCREAMING_SNAKE_CASE       :    Tuple       =	dfs(lowerCAmelCase__		,	lowerCAmelCase__		,	-1		,	lowerCAmelCase__     )
   __SCREAMING_SNAKE_CASE       :    str       =	out_edge_count > 1

 for x in range(len(lowerCAmelCase__     )     ):
  if is_art[x] is True:
   print(lowerCAmelCase__     )


# Adjacency list of graph
_lowerCamelCase						    =  {
    0: [1, 2],
    1: [0, 2],
    2: [0, 1, 3, 5],
    3: [2, 4],
    4: [3],
    5: [2, 6, 8],
    6: [5, 7],
    7: [6, 8],
    8: [5, 7],
}






compute_ap(data)











import inspect
import os
import unittest

import torch

import accelerate
from accelerate import debug_launcher
from accelerate.test_utils import (
    execute_subprocess_async,
    require_cpu,
    require_huggingface_suite,
    require_multi_gpu,
    require_single_gpu,
)
from accelerate.utils import patch_environment

@require_huggingface_suite
class       _SCREAMING_SNAKE_CASE	(unittest.TestCase ):





     def 	__snake_case    (       self :							Optional[Any]				)->Union[str, Any]:
      __SCREAMING_SNAKE_CASE       :    Optional[Any]       =	inspect.getfile(accelerate.test_utils				)
      __SCREAMING_SNAKE_CASE       :    Union[str, Any]       =	os.path.sep.join(
          mod_file.split(os.path.sep				)[:-1] + ["scripts", "external_deps", "test_metrics.py"]				)

      from accelerate.test_utils.scripts.external_deps import test_metrics  # noqa: F401

      __SCREAMING_SNAKE_CASE       :    Tuple       =	test_metrics





     @require_cpu
     def 	__snake_case    (       self :							Union[str, Any]				)->List[Any]:
      debug_launcher(self.test_metrics.main     ,  num_processes=1				)





     @require_cpu
     def 	__snake_case    (       self :							str				)->List[str]:
      debug_launcher(self.test_metrics.main				)





     @require_single_gpu
     def 	__snake_case    (       self :							Union[str, Any]				)->str:
      self.test_metrics.main()






     @require_multi_gpu
     def 	__snake_case    (       self :							List[str]				)->int:
      print(F"""Found {torch.cuda.device_count()} devices."""				)
      __SCREAMING_SNAKE_CASE       :    Any       =	["torchrun", F"""--nproc_per_node={torch.cuda.device_count()}""", self.test_file_path]
      with patch_environment(omp_num_threads=1				):
       execute_subprocess_async(UpperCamelCase     ,  env=os.environ.copy()				)






