




'''simple docstring'''







from collections import deque



def        lowerCamelCase__				(      __lowercase				):
     snake_case			:      Dict        =			len(__lowercase				)
     snake_case			:      Any        =			deque()
     snake_case			:      str        =			[False for _ in range(__lowercase				)]
     snake_case			:      List[Any]        =			[-1 for _ in range(__lowercase				)]
     snake_case			:      Dict        =			index_of[:]

     def strong_connect(__lowercase     ,   __lowercase     ,   __lowercase				):
          snake_case			:      Dict        =			index  # the number when this node is seen
          snake_case			:      str        =			index  # lowest rank node reachable from here
          index += 1
          stack.append(__lowercase				)
          snake_case			:      Optional[int]        =			True

          for w in g[v]:
               if index_of[w] == -1:
                    snake_case			:      Union[str, Any]        =			strong_connect(__lowercase     ,   __lowercase     ,   __lowercase				)
                    snake_case			:      Any        =			(
                        lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                    )
               elif on_stack[w]:
                    snake_case			:      List[Any]        =			(
                        lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                    )

          if lowlink_of[v] == index_of[v]:
               snake_case			:      Tuple        =			[]
               snake_case			:      Union[str, Any]        =			stack.pop()
               snake_case			:      str        =			False
               component.append(__lowercase				)
               while w != v:
                    snake_case			:      List[Any]        =			stack.pop()
                    snake_case			:      Optional[Any]        =			False
                    component.append(__lowercase				)
               components.append(__lowercase				)
          return index

     snake_case			:      int        =			[]
     for v in range(__lowercase				):
          if index_of[v] == -1:
               strong_connect(__lowercase     ,   0     ,   __lowercase				)

     return components



def        lowerCamelCase__				(      __lowercase     ,   __lowercase				):
     snake_case			:      List[str]        =			[[] for _ in range(__lowercase				)]
     for u, v in edges:
          g[u].append(__lowercase				)
     return g


if __name__ == "__main__":
      # Test
      lowercase      :   Tuple      =       7
      lowercase      :   List[Any]      =       [0, 0, 1, 2, 3, 3, 4, 4, 6]
      lowercase      :   Any      =       [1, 3, 2, 0, 1, 4, 5, 6, 5]
      lowercase      :   Tuple      =       [(u, v) for u, v in zip(source, target)]
      lowercase      :   Tuple      =       create_graph(n_vertices, edges)

      assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)









'''simple docstring'''







import json
from typing import List, Optional, Tuple

from tokenizers import normalizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from .tokenization_lxmert import LxmertTokenizer


lowercase      :   Tuple      =       {"""vocab_file""": """vocab.txt""", """tokenizer_file""": """tokenizer.json"""}

lowercase      :   Dict      =       {
    """vocab_file""": {
        """unc-nlp/lxmert-base-uncased""": """https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/vocab.txt""",
    },
    """tokenizer_file""": {
        """unc-nlp/lxmert-base-uncased""": (
            """https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/tokenizer.json"""
        ),
    },
}

lowercase      :   List[Any]      =       {
    """unc-nlp/lxmert-base-uncased""": 512,
}

lowercase      :   Tuple      =       {
    """unc-nlp/lxmert-base-uncased""": {"""do_lower_case""": True},
}







class 					_a (a__	):





     '''simple docstring'''



     lowerCAmelCase_  :     Optional[int]          =					VOCAB_FILES_NAMES
     lowerCAmelCase_  :     Optional[int]          =					PRETRAINED_VOCAB_FILES_MAP
     lowerCAmelCase_  :     Any          =					PRETRAINED_INIT_CONFIGURATION
     lowerCAmelCase_  :     Optional[int]          =					PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     lowerCAmelCase_  :     Optional[int]          =					LxmertTokenizer







     def __init__(				self							,__a=None							,__a=None							,__a=True							,__a="[UNK]"							,__a="[SEP]"							,__a="[PAD]"							,__a="[CLS]"							,__a="[MASK]"							,__a=True							,__a=None							,**__a							,)      ->				str:
          super().__init__(
              __a							,tokenizer_file=__a							,do_lower_case=__a							,unk_token=__a							,sep_token=__a							,pad_token=__a							,cls_token=__a							,mask_token=__a							,tokenize_chinese_chars=__a							,strip_accents=__a							,**__a							,)

          snake_case			:      List[Any]        =			json.loads(self.backend_tokenizer.normalizer.__getstate__()							)
          if (
              normalizer_state.get("""lowercase"""							,__a							) != do_lower_case
              or normalizer_state.get("""strip_accents"""							,__a							) != strip_accents
              or normalizer_state.get("""handle_chinese_chars"""							,__a							) != tokenize_chinese_chars
          ):
               snake_case			:      Union[str, Any]        =			getattr(__a							,normalizer_state.pop("""type"""							)							)
               snake_case			:      Optional[int]        =			do_lower_case
               snake_case			:      Optional[int]        =			strip_accents
               snake_case			:      List[Any]        =			tokenize_chinese_chars
               snake_case			:      Union[str, Any]        =			normalizer_class(**__a							)

          snake_case			:      str        =			do_lower_case







     def 			snake_case_      (				self							,__a							,__a=None							)      ->				Optional[int]:
          snake_case			:      Tuple        =			[self.cls_token_id] + token_ids_a + [self.sep_token_id]

          if token_ids_a:
               output += token_ids_a + [self.sep_token_id]

          return output







     def 			snake_case_      (				self							,__a							,__a = None							)      ->				List[int]:
          snake_case			:      int        =			[self.sep_token_id]
          snake_case			:      Any        =			[self.cls_token_id]
          if token_ids_a is None:
               return len(cls + token_ids_a + sep							) * [0]
          return len(cls + token_ids_a + sep							) * [0] + len(token_ids_a + sep							) * [1]







     def 			snake_case_      (				self							,__a							,__a = None							)      ->				Tuple[str]:
          snake_case			:      Optional[int]        =			self._tokenizer.model.save(__a							,name=__a							)
          return tuple(__a							)



