





"""simple docstring"""






def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE							)		->       Tuple:  # noqa: E741






       """simple docstring"""




       _UpperCAmelCase     =     len(SCREAMING_SNAKE_CASE							)
       _UpperCAmelCase     =     0
       _UpperCAmelCase     =     [0] * n
       _UpperCAmelCase     =     [False] * n
       _UpperCAmelCase     =     [False] * n

       def dfs(SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							):
              if parent == root:
                     out_edge_count += 1
              _UpperCAmelCase     =     True
              _UpperCAmelCase     =     at

              for to in l[at]:
                     if to == parent:
                            pass
                     elif not visited[to]:
                            _UpperCAmelCase     =     dfs(SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)
                            _UpperCAmelCase     =     min(low[at],low[to]							)

                            # AP found via bridge
                            if at < low[to]:
                                   _UpperCAmelCase     =     True
                            # AP found via cycle
                            if at == low[to]:
                                   _UpperCAmelCase     =     True
                     else:
                            _UpperCAmelCase     =     min(low[at],SCREAMING_SNAKE_CASE							)
              return out_edge_count

       for i in range(SCREAMING_SNAKE_CASE							):
              if not visited[i]:
                     _UpperCAmelCase     =     0
                     _UpperCAmelCase     =     dfs(SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE,-1,SCREAMING_SNAKE_CASE							)
                     _UpperCAmelCase     =     out_edge_count > 1

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


# 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)













"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCAmelCase_			=							logging.get_logger(__name__)

lowerCAmelCase_			=							{
    '''microsoft/trocr-base-handwritten''': (
        '''https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json'''
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}



class 	lowerCAmelCase					(      snake_case							):
       lowerCAmelCase__						 =  """trocr"""
       lowerCAmelCase__						 =  ["""past_key_values"""]
       lowerCAmelCase__						 =  {
           """num_attention_heads""": """decoder_attention_heads""",
           """hidden_size""": """d_model""",
           """num_hidden_layers""": """decoder_layers""",
       }






       def __init__(   self    ,  a__=5_02_65    ,  a__=10_24    ,  a__=12    ,  a__=16    ,  a__=40_96    ,  a__="gelu"    ,  a__=5_12    ,  a__=0.1    ,  a__=0.0    ,  a__=0.0    ,  a__=2    ,  a__=0.02    ,  a__=0.0    ,  a__=True    ,  a__=False    ,  a__=True    ,  a__=True    ,  a__=1    ,  a__=0    ,  a__=2    ,  **a__    ,  ):
              _UpperCAmelCase     =     vocab_size
              _UpperCAmelCase     =     d_model
              _UpperCAmelCase     =     decoder_layers
              _UpperCAmelCase     =     decoder_attention_heads
              _UpperCAmelCase     =     decoder_ffn_dim
              _UpperCAmelCase     =     activation_function
              _UpperCAmelCase     =     max_position_embeddings
              _UpperCAmelCase     =     dropout
              _UpperCAmelCase     =     attention_dropout
              _UpperCAmelCase     =     activation_dropout
              _UpperCAmelCase     =     init_std
              _UpperCAmelCase     =     decoder_layerdrop
              _UpperCAmelCase     =     use_cache
              _UpperCAmelCase     =     scale_embedding
              _UpperCAmelCase     =     use_learned_position_embeddings
              _UpperCAmelCase     =     layernorm_embedding

              super().__init__(
                  pad_token_id=a__    ,  bos_token_id=a__    ,  eos_token_id=a__    ,  decoder_start_token_id=a__    ,  **a__    ,  )






