code: 
  
  
  
  '''simple docstring'''
  
  from __future__ import annotations
  
  from queue import Queue
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       Optional[Any]  ,      _lowerCamelCase						:       Tuple		)    ->						tuple[int, int]:
    a ^= b
    b ^= a
    a ^= b
    return a, b
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       int  ,      _lowerCamelCase						:       List[str]		)    ->						list[list[int]]:
    _lowerCAmelCase       :  Tuple   				=					1
    while (1 << j) < max_node:
      for i in range(1  ,      max_node + 1		):
        _lowerCAmelCase       :  Optional[Any]   				=					parent[j - 1][parent[j - 1][i]]
      j += 1
    return parent
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       Optional[int]  ,      _lowerCamelCase						:       List[str]  ,      _lowerCamelCase						:       Any  ,      _lowerCamelCase						:       Optional[Any]		)    ->						int:
  
  
    if level[u] < level[v]:
      _lowerCAmelCase				,					_lowerCAmelCase       :  str   				=					swap(_lowerCamelCase  ,      _lowerCamelCase		)
    # making depth of u same as depth of v
    for i in range(18  ,      -1  ,      -1		):
      if level[u] - (1 << i) >= level[v]:
        _lowerCAmelCase       :  Optional[int]   				=					parent[i][u]
      # at the same depth if u==v that mean lca is found
    if u == v:
      return u
    # moving both nodes upwards till lca in found
    for i in range(18  ,      -1  ,      -1		):
      if parent[i][u] not in [0, parent[i][v]]:
        _lowerCAmelCase				,					_lowerCAmelCase       :  str   				=					parent[i][u], parent[i][v]
      # returning longest common ancestor of u,v
    return parent[0][u]
  
  
  def 	_UpperCAmelCase				(  _lowerCamelCase						:       Union[str, Any]  ,      _lowerCamelCase						:       Union[str, Any]  ,      _lowerCamelCase						:       Optional[int]  ,      _lowerCamelCase						:       int  ,      _lowerCamelCase						:       Tuple = 1  ,      )    ->						tuple[list[int], list[list[int]]]:
    _lowerCAmelCase       :  Tuple   				=					0
    _lowerCAmelCase       :  Dict   				=					Queue(maxsize=_lowerCamelCase		)
    q.put(_lowerCamelCase		)
    while q.qsize() != 0:
      _lowerCAmelCase       :  List[str]   				=					q.get()
      for v in graph[u]:
        if level[v] == -1:
          _lowerCAmelCase       :  str   				=					level[u] + 1
          q.put(_lowerCamelCase		)
          _lowerCAmelCase       :  Dict   				=					u
    return level, parent
  
  
  def 	_UpperCAmelCase				(  )    ->						None:
    _lowerCAmelCase       :  Union[str, Any]   				=					13
    # initializing with 0
    _lowerCAmelCase       :  Optional[int]   				=					[[0 for _ in range(max_node + 10		)] for _ in range(20		)]
    # initializing with -1 which means every node is unvisited
    _lowerCAmelCase       :  Tuple   				=					[-1 for _ in range(max_node + 10		)]
    _lowerCAmelCase       :  int   				=					{
        1: [2, 3, 4],
        2: [5],
        3: [6, 7],
        4: [8],
        5: [9, 10],
        6: [11],
        7: [],
        8: [12, 13],
        9: [],
        10: [],
        11: [],
        12: [],
        13: [],
    }
    _lowerCAmelCase				,					_lowerCAmelCase       :  int   				=					breadth_first_search(_lowerCamelCase  ,      _lowerCamelCase  ,      _lowerCamelCase  ,      _lowerCamelCase  ,      1		)
    _lowerCAmelCase       :  List[Any]   				=					create_sparse(_lowerCamelCase  ,      _lowerCamelCase		)
    print("""LCA of node 1 and 3 is: """  ,      lowest_common_ancestor(1  ,      3  ,      _lowerCamelCase  ,      _lowerCamelCase		)		)
    print("""LCA of node 5 and 6 is: """  ,      lowest_common_ancestor(5  ,      6  ,      _lowerCamelCase  ,      _lowerCamelCase		)		)
    print("""LCA of node 7 and 11 is: """  ,      lowest_common_ancestor(7  ,      11  ,      _lowerCamelCase  ,      _lowerCamelCase		)		)
    print("""LCA of node 6 and 7 is: """  ,      lowest_common_ancestor(6  ,      7  ,      _lowerCamelCase  ,      _lowerCamelCase		)		)
    print("""LCA of node 4 and 12 is: """  ,      lowest_common_ancestor(4  ,      12  ,      _lowerCamelCase  ,      _lowerCamelCase		)		)
    print("""LCA of node 8 and 8 is: """  ,      lowest_common_ancestor(8  ,      8  ,      _lowerCamelCase  ,      _lowerCamelCase		)		)
  
  
  if __name__ == "__main__":
       main()
  
  
  
style_context: 
  '''simple docstring'''
  
  import json
  import os
  import unittest
  
  from transformers.models.gpt_neox_japanese.tokenization_gpt_neox_japanese import (
      VOCAB_FILES_NAMES,
      GPTNeoXJapaneseTokenizer,
  )
  from transformers.testing_utils import require_tokenizers, slow
  
  from ...test_tokenization_common import TokenizerTesterMixin
  
  
  @require_tokenizers
  class   a_  (_a							,			unittest.TestCase    ):
         __lowerCAmelCase    :				List[Any]    =      GPTNeoXJapaneseTokenizer
         __lowerCAmelCase    :				Any    =      False
         __lowerCAmelCase    :				List[Any]    =      {"""do_clean_text""": False, """add_prefix_space""": False}
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           super().setUp()
  
           _lowerCAmelCase       :  Any   				=					[
               """こん""",
               """こんに""",
               """にちは""",
               """ばんは""",
               """世界,㔺界""",
               """、""",
               """。""",
               """<BR>""",
               """<SP>""",
               """<TAB>""",
               """<URL>""",
               """<EMAIL>""",
               """<TEL>""",
               """<DATE>""",
               """<PRICE>""",
               """<BLOCK>""",
               """<KIGOU>""",
               """<U2000U2BFF>""",
               """<|emoji1|>""",
               """<unk>""",
               """<|startoftext|>""",
               """<|endoftext|>""",
           ]
           _lowerCAmelCase       :  Union[str, Any]   				=					{"""emoji""": {"""\ud83d\ude00""": """<|emoji1|>"""}, """emoji_inv""": {"""<|emoji1|>""": """\ud83d\ude00"""}}  # 😀
           _lowerCAmelCase       :  Any   				=					{"""unk_token""": """<unk>"""}
  
           _lowerCAmelCase       :  Optional[int]   				=					os.path.join(self.tmpdirname   ,   VOCAB_FILES_NAMES["""vocab_file"""]  )
           _lowerCAmelCase       :  Any   				=					os.path.join(self.tmpdirname   ,   VOCAB_FILES_NAMES["""emoji_file"""]  )
           with open(self.vocab_file   ,   """w"""   ,   encoding="""utf-8"""  ) as vocab_writer:
             vocab_writer.write("""""".join([x + """\n""" for x in vocab_tokens]  )  )
           with open(self.emoji_file   ,   """w"""  ) as emoji_writer:
             emoji_writer.write(json.dumps(snake_case_  )  )
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   **snake_case_  ):
           kwargs.update(self.special_tokens_map  )
           return GPTNeoXJapaneseTokenizer.from_pretrained(self.tmpdirname   ,   **snake_case_  )
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           _lowerCAmelCase       :  Tuple   				=					"""こんにちは、世界。 \nこんばんは、㔺界。😀"""
           _lowerCAmelCase       :  str   				=					"""こんにちは、世界。 \nこんばんは、世界。😀"""
           return input_text, output_text
  
  
  
  
         def 							__UpperCamelCase       (     self   ,   snake_case_  ):
           _lowerCAmelCase				,					_lowerCAmelCase       :  str   				=					self.get_input_output_texts(snake_case_  )
           _lowerCAmelCase       :  Tuple   				=					tokenizer.encode(snake_case_   ,   add_special_tokens=snake_case_  )
           _lowerCAmelCase       :  Optional[Any]   				=					tokenizer.decode(snake_case_   ,   clean_up_tokenization_spaces=snake_case_  )
           return text, ids
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           pass  # TODO add if relevant
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           pass  # TODO add if relevant
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           pass  # TODO add if relevant
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           _lowerCAmelCase       :  List[Any]   				=					self.get_tokenizer()
  
           # Testing tokenization
           _lowerCAmelCase       :  Tuple   				=					"""こんにちは、世界。　こんばんは、㔺界。"""
           _lowerCAmelCase       :  Optional[Any]   				=					["""こん""", """にちは""", """、""", """世界""", """。""", """<SP>""", """こん""", """ばんは""", """、""", """㔺界""", """。"""]
           _lowerCAmelCase       :  Tuple   				=					tokenizer.tokenize(snake_case_  )
           self.assertListEqual(snake_case_   ,   snake_case_  )
  
           # Testing conversion to ids without special tokens
           _lowerCAmelCase       :  Optional[int]   				=					[0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6]
           _lowerCAmelCase       :  Optional[int]   				=					tokenizer.convert_tokens_to_ids(snake_case_  )
           self.assertListEqual(snake_case_   ,   snake_case_  )
  
           # Testing conversion to ids with special tokens
           _lowerCAmelCase       :  Optional[Any]   				=					tokens + [tokenizer.unk_token]
           _lowerCAmelCase       :  List[str]   				=					[0, 2, 5, 4, 6, 8, 0, 3, 5, 4, 6, 1_9]
           _lowerCAmelCase       :  Dict   				=					tokenizer.convert_tokens_to_ids(snake_case_  )
           self.assertListEqual(snake_case_   ,   snake_case_  )
  
  
  
  
         @slow
         def 							__UpperCamelCase       (     self  ):
           _lowerCAmelCase       :  int   				=					self.tokenizer_class.from_pretrained("""abeja/gpt-neox-japanese-2.7b"""  )
  
           _lowerCAmelCase       :  List[Any]   				=					tokenizer.encode("""ありがとう。"""   ,   add_special_tokens=snake_case_  )
           _lowerCAmelCase       :  List[str]   				=					tokenizer.encode("""どういたしまして。"""   ,   add_special_tokens=snake_case_  )
  
           _lowerCAmelCase       :  int   				=					tokenizer.build_inputs_with_special_tokens(snake_case_  )
           _lowerCAmelCase       :  Any   				=					tokenizer.build_inputs_with_special_tokens(snake_case_   ,   snake_case_  )
  
           assert encoded_sentence == ids_a
           assert encoded_pair == ids_a + ids_a
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           # Intentionally convert some words to accommodate character fluctuations unique to Japanese
           pass
  
  
  
  
  
  
  
         def 							__UpperCamelCase       (     self  ):
           # tokenizer has no padding token
           pass
  
  
  