





'''simple docstring'''




import os
from pathlib import Path






def 			_lowerCAmelCase     (    )	->	int:
     from torch.utils.cpp_extension import load

     __A		:					Tuple						=			Path(__snake_case     ).resolve().parent.parent.parent / 'kernels' / 'deformable_detr'
     __A		:					Any						=			[
         root / filename
         for filename in [
             'vision.cpp',
             os.path.join('cpu'					,				'ms_deform_attn_cpu.cpp'     ),
             os.path.join('cuda'					,				'ms_deform_attn_cuda.cu'     ),
         ]
     ]

     load(
         'MultiScaleDeformableAttention'					,				__snake_case					,				with_cuda=__snake_case					,				extra_include_paths=[str(__snake_case     )]					,				extra_cflags=['-DWITH_CUDA=1']					,				extra_cuda_cflags=[
             '-DCUDA_HAS_FP16=1',
             '-D__CUDA_NO_HALF_OPERATORS__',
             '-D__CUDA_NO_HALF_CONVERSIONS__',
             '-D__CUDA_NO_HALF2_OPERATORS__',
         ]					,				)

     import MultiScaleDeformableAttention as MSDA

     return MSDA






'''simple docstring'''




def 			_lowerCAmelCase     (    __snake_case    :					Optional[Any]     )	->	Optional[Any]:  # noqa: E741
     __A		:					Tuple						=			len(__snake_case     )
     __A		:					Optional[int]						=			0
     __A		:					str						=			[0] * n
     __A		:					int						=			[False] * n
     __A		:					Tuple						=			[False] * n

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

          for to in l[at]:
               if to == parent:
                    pass
               elif not visited[to]:
                    __A		:					Optional[int]						=			dfs(__snake_case					,				__snake_case					,				__snake_case					,				__snake_case     )
                    __A		:					int						=			min(low[at]					,				low[to]     )

                    # AP found via bridge
                    if at < low[to]:
                         __A		:					Tuple						=			True
                    # AP found via cycle
                    if at == low[to]:
                         __A		:					Optional[Any]						=			True
               else:
                    __A		:					Any						=			min(low[at]					,				__snake_case     )
          return out_edge_count

     for i in range(__snake_case     ):
          if not visited[i]:
               __A		:					Tuple						=			0
               __A		:					List[Any]						=			dfs(__snake_case					,				__snake_case					,				-1					,				__snake_case     )
               __A		:					Union[str, Any]						=			out_edge_count > 1

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


# Adjacency list of graph
lowercase__       : Tuple         =       {
    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)