


from transformers import (
    DPRContextEncoderTokenizer,
    DPRContextEncoderTokenizerFast,
    DPRQuestionEncoderTokenizer,
    DPRQuestionEncoderTokenizerFast,
    DPRReaderOutput,
    DPRReaderTokenizer,
    DPRReaderTokenizerFast,
)
from transformers.testing_utils import require_tokenizers, slow
from transformers.tokenization_utils_base import BatchEncoding

from ..bert.test_tokenization_bert import BertTokenizationTest




@require_tokenizers
class  A_ (			a_  ):







 """simple docstring"""





 _UpperCamelCase					:			Dict     	=       DPRContextEncoderTokenizer
 _UpperCamelCase					:			Optional[Any]     	=       DPRContextEncoderTokenizerFast
 _UpperCamelCase					:			Dict     	=       True




@require_tokenizers
class  A_ (			a_  ):







 """simple docstring"""





 _UpperCamelCase					:			List[Any]     	=       DPRQuestionEncoderTokenizer
 _UpperCamelCase					:			List[Any]     	=       DPRQuestionEncoderTokenizerFast
 _UpperCamelCase					:			Optional[int]     	=       True




@require_tokenizers
class  A_ (			a_  ):







 """simple docstring"""





 _UpperCamelCase					:			Tuple     	=       DPRReaderTokenizer
 _UpperCamelCase					:			Any     	=       DPRReaderTokenizerFast
 _UpperCamelCase					:			int     	=       True
 @slow
 def 	_UpperCamelCase     (      self       :			Any					)     ->      Optional[Any]:
      UpperCAmelCase    :					List[Any]			=      self.tokenizer_class.from_pretrained("bert-base-uncased"					)

      UpperCAmelCase    :					Optional[Any]			=      tokenizer.encode("question sequence"							,     add_special_tokens=_a					)
      UpperCAmelCase    :					Union[str, Any]			=      tokenizer.encode("title sequence"							,     add_special_tokens=_a					)
      UpperCAmelCase    :					Dict			=      tokenizer.encode("text sequence " * 4							,     add_special_tokens=_a					)
      UpperCAmelCase    :					Union[str, Any]			=      [[1_0_1] + text_a + [1_0_2] + text_a + [1_0_2] + text_a]
      UpperCAmelCase    :					List[Any]			=      BatchEncoding({"input_ids": input_ids}					)

      UpperCAmelCase    :					Optional[int]			=      [[0] * len(input_ids[0]					)]
      UpperCAmelCase    :					Any			=      [[0] * len(input_ids[0]					)]
      UpperCAmelCase    :					Dict			=      [0]
      UpperCAmelCase    :					Optional[Any]			=      DPRReaderOutput(_a							,     _a							,     _a					)

      UpperCAmelCase	,			UpperCAmelCase    :					Optional[Any]			=      8, 9
      UpperCAmelCase    :					Union[str, Any]			=      1_0
      UpperCAmelCase    :					List[Any]			=      1_0
      UpperCAmelCase    :					List[Any]			=      tokenizer.decode_best_spans(_a							,     _a					)
      self.assertEqual(predicted_spans[0].start_index							,     _a					)
      self.assertEqual(predicted_spans[0].end_index							,     _a					)
      self.assertEqual(predicted_spans[0].doc_id							,     0					)

 @slow
 def 	_UpperCamelCase     (      self       :			Tuple					)     ->      str:
      UpperCAmelCase    :					List[str]			=      self.tokenizer_class.from_pretrained("bert-base-uncased"					)

      UpperCAmelCase    :					int			=      tokenizer.encode("question sequence"							,     add_special_tokens=_a					)
      UpperCAmelCase    :					Optional[Any]			=      tokenizer.encode("title sequence"							,     add_special_tokens=_a					)
      UpperCAmelCase    :					int			=      tokenizer.encode("text sequence"							,     add_special_tokens=_a					)
      UpperCAmelCase    :					List[str]			=      [1_0_1] + text_a + [1_0_2] + text_a + [1_0_2] + text_a
      UpperCAmelCase    :					int			=      tokenizer(questions=["question sequence"]							,     titles=["title sequence"]							,     texts=["text sequence"]					)
      self.assertIn("input_ids"							,     _a					)
      self.assertIn("attention_mask"							,     _a					)
      self.assertListEqual(encoded_input["input_ids"][0]							,     _a					)







from __future__ import annotations

import sys







def 	A (		A__		,		A__			):
     # base cases
     if abs(A__			) == 1:
          return a, 0
     elif abs(A__			) == 1:
          return 0, b

     UpperCAmelCase	,			UpperCAmelCase    :					Any			=      a, b
     UpperCAmelCase	,			UpperCAmelCase    :					List[Any]			=      1, 0
     UpperCAmelCase	,			UpperCAmelCase    :					Union[str, Any]			=      0, 1

     while remainder != 0:
          UpperCAmelCase    :					Union[str, Any]			=      old_remainder // remainder
          UpperCAmelCase	,			UpperCAmelCase    :					Dict			=      remainder, old_remainder - quotient * remainder
          UpperCAmelCase	,			UpperCAmelCase    :					int			=      coeff_a, old_coeff_a - quotient * coeff_a
          UpperCAmelCase	,			UpperCAmelCase    :					Optional[Any]			=      coeff_b, old_coeff_b - quotient * coeff_b

     # sign correction for negative numbers
     if a < 0:
          UpperCAmelCase    :					Union[str, Any]			=      -old_coeff_a
     if b < 0:
          UpperCAmelCase    :					int			=      -old_coeff_b

     return old_coeff_a, old_coeff_b







def 	A (		):
     if len(sys.argv			) < 3:
          print("2 integer arguments required"			)
          return 1
     UpperCAmelCase    :					Union[str, Any]			=      int(sys.argv[1]			)
     UpperCAmelCase    :					Any			=      int(sys.argv[2]			)
     print(extended_euclidean_algorithm(A__		,		A__			)			)
     return 0


if __name__ == "__main__":
      raise SystemExit(main())



