
"""simple docstring"""

import unittest
from timeit import timeit
def 		UpperCAmelCase					(		a_,						a_			):





		'''simple docstring'''


		lowerCamelCase     :			Optional[int]		=    first_num if first_num >= second_num else second_num
		lowerCamelCase     :			int		=    max_num
		while (common_mult % first_num > 0) or (common_mult % second_num > 0):
				common_mult += max_num
		return common_mult
def 		UpperCAmelCase					(		a_,						a_			):





		'''simple docstring'''


		return b if a == 0 else greatest_common_divisor(b % a,						a_			)
def 		UpperCAmelCase					(		a_,						a_			):





		'''simple docstring'''


		return first_num // greatest_common_divisor(a_,						a_			) * second_num
def 		UpperCAmelCase					(		):





		'''simple docstring'''


		lowerCamelCase     :			List[str]		=    (
		    'from __main__ import least_common_multiple_slow, least_common_multiple_fast'
		)
		print(
		    'least_common_multiple_slow():',						timeit('least_common_multiple_slow(1000, 999)',						setup=a_			),						)
		print(
		    'least_common_multiple_fast():',						timeit('least_common_multiple_fast(1000, 999)',						setup=a_			),						)






class        _lowercase   (				unittest.TestCase		):
	lowercase_        =	(
	    (1_0, 2_0),
	    (1_3, 1_5),
	    (4, 3_1),
	    (1_0, 4_2),
	    (4_3, 3_4),
	    (5, 1_2),
	    (1_2, 2_5),
	    (1_0, 2_5),
	    (6, 9),
	)
	lowercase_        =	(2_0, 1_9_5, 1_2_4, 2_1_0, 1_4_6_2, 6_0, 3_0_0, 5_0, 1_8)




	def 			_UpperCamelCase    ( self					)		->							Optional[Any]:
			for i, (first_num, second_num) in enumerate(self.test_inputs					):
					lowerCamelCase     :			Union[str, Any]		=    least_common_multiple_slow(UpperCAmelCase_		, UpperCAmelCase_					)
					lowerCamelCase     :			Dict		=    least_common_multiple_fast(UpperCAmelCase_		, UpperCAmelCase_					)
					with self.subTest(i=UpperCAmelCase_					):
							self.assertEqual(UpperCAmelCase_		, self.expected_results[i]					)
							self.assertEqual(UpperCAmelCase_		, self.expected_results[i]					)


if __name__ == "__main__":
					benchmark()
					unittest.main()








"""simple docstring"""

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        _lowercase   (				__UpperCAmelCase		):
	lowercase_        =	DPRContextEncoderTokenizer
	lowercase_        =	DPRContextEncoderTokenizerFast
	lowercase_        =	True






@require_tokenizers
class        _lowercase   (				__UpperCAmelCase		):
	lowercase_        =	DPRQuestionEncoderTokenizer
	lowercase_        =	DPRQuestionEncoderTokenizerFast
	lowercase_        =	True






@require_tokenizers
class        _lowercase   (				__UpperCAmelCase		):
	lowercase_        =	DPRReaderTokenizer
	lowercase_        =	DPRReaderTokenizerFast
	lowercase_        =	True




	@slow
	def 			_UpperCamelCase    ( self					)		->							Any:
			lowerCamelCase     :			str		=    self.tokenizer_class.from_pretrained('bert-base-uncased'					)

			lowerCamelCase     :			int		=    tokenizer.encode('question sequence'		, add_special_tokens=UpperCAmelCase_					)
			lowerCamelCase     :			List[Any]		=    tokenizer.encode('title sequence'		, add_special_tokens=UpperCAmelCase_					)
			lowerCamelCase     :			Optional[int]		=    tokenizer.encode('text sequence ' * 4		, add_special_tokens=UpperCAmelCase_					)
			lowerCamelCase     :			Union[str, Any]		=    [[101] + text_a + [102] + text_a + [102] + text_a]
			lowerCamelCase     :			List[str]		=    BatchEncoding({'input_ids': input_ids}					)

			lowerCamelCase     :			Optional[int]		=    [[0] * len(input_ids[0]					)]
			lowerCamelCase     :			str		=    [[0] * len(input_ids[0]					)]
			lowerCamelCase     :			List[Any]		=    [0]
			lowerCamelCase     :			Tuple		=    DPRReaderOutput(UpperCAmelCase_		, UpperCAmelCase_		, UpperCAmelCase_					)

			lowerCamelCase	,    lowerCamelCase     :			Optional[int]		=    8, 9
			lowerCamelCase     :			Optional[int]		=    10
			lowerCamelCase     :			int		=    10
			lowerCamelCase     :			List[Any]		=    tokenizer.decode_best_spans(UpperCAmelCase_		, UpperCAmelCase_					)
			self.assertEqual(predicted_spans[0].start_index		, UpperCAmelCase_					)
			self.assertEqual(predicted_spans[0].end_index		, UpperCAmelCase_					)
			self.assertEqual(predicted_spans[0].doc_id		, 0					)




	@slow
	def 			_UpperCamelCase    ( self					)		->							List[Any]:
			lowerCamelCase     :			Union[str, Any]		=    self.tokenizer_class.from_pretrained('bert-base-uncased'					)

			lowerCamelCase     :			List[str]		=    tokenizer.encode('question sequence'		, add_special_tokens=UpperCAmelCase_					)
			lowerCamelCase     :			List[str]		=    tokenizer.encode('title sequence'		, add_special_tokens=UpperCAmelCase_					)
			lowerCamelCase     :			List[Any]		=    tokenizer.encode('text sequence'		, add_special_tokens=UpperCAmelCase_					)
			lowerCamelCase     :			List[Any]		=    [101] + text_a + [102] + text_a + [102] + text_a
			lowerCamelCase     :			Optional[Any]		=    tokenizer(questions=['question sequence']		, titles=['title sequence']		, texts=['text sequence']					)
			self.assertIn('input_ids'		, UpperCAmelCase_					)
			self.assertIn('attention_mask'		, UpperCAmelCase_					)
			self.assertListEqual(encoded_input['input_ids'][0]		, UpperCAmelCase_					)






