





import os
import tempfile
import unittest

from transformers import FlaubertConfig, is_torch_available
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch

      from transformers import (
          FlaubertForMultipleChoice,
          FlaubertForQuestionAnswering,
          FlaubertForQuestionAnsweringSimple,
          FlaubertForSequenceClassification,
          FlaubertForTokenClassification,
          FlaubertModel,
          FlaubertWithLMHeadModel,
      )
      from transformers.models.flaubert.modeling_flaubert import FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST





class      lowercase__    (							__A  ):







  def __init__(	self    ,						_lowercase    ,						_lowercase=13    ,						_lowercase=7    ,						_lowercase=True    ,						_lowercase=True    ,						_lowercase=True    ,						_lowercase=True    ,						_lowercase=True    ,						_lowercase=False    ,						_lowercase=False    ,						_lowercase=False    ,						_lowercase=2    ,						_lowercase=99    ,						_lowercase=0    ,						_lowercase=32    ,						_lowercase=5    ,						_lowercase=4    ,						_lowercase=0.1    ,						_lowercase=0.1    ,						_lowercase=512    ,						_lowercase=12    ,						_lowercase=2    ,						_lowercase=0.02    ,						_lowercase=3    ,						_lowercase=4    ,						_lowercase="last"    ,						_lowercase=None    ,						_lowercase=None    ,						):
       lowerCAmelCase_					:       Optional[Any]    =		parent
       lowerCAmelCase_					:       List[Any]    =		batch_size
       lowerCAmelCase_					:       str    =		seq_length
       lowerCAmelCase_					:       Optional[int]    =		is_training
       lowerCAmelCase_					:       List[str]    =		use_input_lengths
       lowerCAmelCase_					:       Any    =		use_token_type_ids
       lowerCAmelCase_					:       Optional[Any]    =		use_labels
       lowerCAmelCase_					:       List[Any]    =		gelu_activation
       lowerCAmelCase_					:       int    =		sinusoidal_embeddings
       lowerCAmelCase_					:       Any    =		causal
       lowerCAmelCase_					:       Optional[int]    =		asm
       lowerCAmelCase_					:       str    =		n_langs
       lowerCAmelCase_					:       Any    =		vocab_size
       lowerCAmelCase_					:       Optional[Any]    =		n_special
       lowerCAmelCase_					:       Optional[Any]    =		hidden_size
       lowerCAmelCase_					:       List[Any]    =		num_hidden_layers
       lowerCAmelCase_					:       List[Any]    =		num_attention_heads
       lowerCAmelCase_					:       Optional[int]    =		hidden_dropout_prob
       lowerCAmelCase_					:       Optional[int]    =		attention_probs_dropout_prob
       lowerCAmelCase_					:       Optional[int]    =		max_position_embeddings
       lowerCAmelCase_					:       Optional[Any]    =		type_vocab_size
       lowerCAmelCase_					:       Optional[int]    =		type_sequence_label_size
       lowerCAmelCase_					:       Union[str, Any]    =		initializer_range
       lowerCAmelCase_					:       Dict    =		num_labels
       lowerCAmelCase_					:       Any    =		num_choices
       lowerCAmelCase_					:       str    =		summary_type
       lowerCAmelCase_					:       List[Any]    =		use_proj
       lowerCAmelCase_					:       Optional[Any]    =		scope







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Any    =		ids_tensor([self.batch_size, self.seq_length]    ,						self.vocab_size						)
       lowerCAmelCase_					:       Any    =		random_attention_mask([self.batch_size, self.seq_length]						)

       lowerCAmelCase_					:       List[str]    =		None
       if self.use_input_lengths:
            lowerCAmelCase_					:       Optional[int]    =		(
                ids_tensor([self.batch_size]    ,						vocab_size=2						) + self.seq_length - 2
            )  # small variation of seq_length

       lowerCAmelCase_					:       Dict    =		None
       if self.use_token_type_ids:
            lowerCAmelCase_					:       str    =		ids_tensor([self.batch_size, self.seq_length]    ,						self.n_langs						)

       lowerCAmelCase_					:       int    =		None
       lowerCAmelCase_					:       Union[str, Any]    =		None
       lowerCAmelCase_					:       Dict    =		None
       if self.use_labels:
            lowerCAmelCase_					:       Any    =		ids_tensor([self.batch_size]    ,						self.type_sequence_label_size						)
            lowerCAmelCase_					:       Dict    =		ids_tensor([self.batch_size, self.seq_length]    ,						self.num_labels						)
            lowerCAmelCase_					:       Dict    =		ids_tensor([self.batch_size]    ,						2						).float()
            lowerCAmelCase_					:       int    =		ids_tensor([self.batch_size]    ,						self.num_choices						)

       lowerCAmelCase_					:       List[Any]    =		self.get_config()

       return (
           config,
           input_ids,
           token_type_ids,
           input_lengths,
           sequence_labels,
           token_labels,
           is_impossible_labels,
           choice_labels,
           input_mask,
       )







  def 	UpperCAmelCase__		(	self						):
       return FlaubertConfig(
           vocab_size=self.vocab_size    ,						n_special=self.n_special    ,						emb_dim=self.hidden_size    ,						n_layers=self.num_hidden_layers    ,						n_heads=self.num_attention_heads    ,						dropout=self.hidden_dropout_prob    ,						attention_dropout=self.attention_probs_dropout_prob    ,						gelu_activation=self.gelu_activation    ,						sinusoidal_embeddings=self.sinusoidal_embeddings    ,						asm=self.asm    ,						causal=self.causal    ,						n_langs=self.n_langs    ,						max_position_embeddings=self.max_position_embeddings    ,						initializer_range=self.initializer_range    ,						summary_type=self.summary_type    ,						use_proj=self.use_proj    ,						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       List[Any]    =		FlaubertModel(config=_lowercase						)
       model.to(_lowercase						)
       model.eval()
       lowerCAmelCase_					:       Dict    =		model(_lowercase    ,						lengths=_lowercase    ,						langs=_lowercase						)
       lowerCAmelCase_					:       Optional[int]    =		model(_lowercase    ,						langs=_lowercase						)
       lowerCAmelCase_					:       Any    =		model(_lowercase						)
       self.parent.assertEqual(result.last_hidden_state.shape    ,						(self.batch_size, self.seq_length, self.hidden_size)						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       List[Any]    =		FlaubertWithLMHeadModel(_lowercase						)
       model.to(_lowercase						)
       model.eval()

       lowerCAmelCase_					:       Optional[Any]    =		model(_lowercase    ,						token_type_ids=_lowercase    ,						labels=_lowercase						)
       self.parent.assertEqual(result.loss.shape    ,						()						)
       self.parent.assertEqual(result.logits.shape    ,						(self.batch_size, self.seq_length, self.vocab_size)						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       int    =		FlaubertForQuestionAnsweringSimple(_lowercase						)
       model.to(_lowercase						)
       model.eval()

       lowerCAmelCase_					:       Optional[int]    =		model(_lowercase						)

       lowerCAmelCase_					:       int    =		model(_lowercase    ,						start_positions=_lowercase    ,						end_positions=_lowercase						)
       self.parent.assertEqual(result.start_logits.shape    ,						(self.batch_size, self.seq_length)						)
       self.parent.assertEqual(result.end_logits.shape    ,						(self.batch_size, self.seq_length)						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       int    =		FlaubertForQuestionAnswering(_lowercase						)
       model.to(_lowercase						)
       model.eval()

       lowerCAmelCase_					:       Optional[Any]    =		model(_lowercase						)

       lowerCAmelCase_					:       str    =		model(
           _lowercase    ,						start_positions=_lowercase    ,						end_positions=_lowercase    ,						cls_index=_lowercase    ,						is_impossible=_lowercase    ,						p_mask=_lowercase    ,						)

       lowerCAmelCase_					:       Optional[Any]    =		model(
           _lowercase    ,						start_positions=_lowercase    ,						end_positions=_lowercase    ,						cls_index=_lowercase    ,						is_impossible=_lowercase    ,						)

       ((lowerCAmelCase_)   ,  )					:       int    =		result_with_labels.to_tuple()

       lowerCAmelCase_					:       Tuple    =		model(_lowercase    ,						start_positions=_lowercase    ,						end_positions=_lowercase						)

       ((lowerCAmelCase_)   ,  )					:       List[Any]    =		result_with_labels.to_tuple()

       self.parent.assertEqual(result_with_labels.loss.shape    ,						()						)
       self.parent.assertEqual(result.start_top_log_probs.shape    ,						(self.batch_size, model.config.start_n_top)						)
       self.parent.assertEqual(result.start_top_index.shape    ,						(self.batch_size, model.config.start_n_top)						)
       self.parent.assertEqual(
           result.end_top_log_probs.shape    ,						(self.batch_size, model.config.start_n_top * model.config.end_n_top)						)
       self.parent.assertEqual(
           result.end_top_index.shape    ,						(self.batch_size, model.config.start_n_top * model.config.end_n_top)						)
       self.parent.assertEqual(result.cls_logits.shape    ,						(self.batch_size,)						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       List[str]    =		FlaubertForSequenceClassification(_lowercase						)
       model.to(_lowercase						)
       model.eval()

       lowerCAmelCase_					:       int    =		model(_lowercase						)
       lowerCAmelCase_					:       Dict    =		model(_lowercase    ,						labels=_lowercase						)

       self.parent.assertEqual(result.loss.shape    ,						()						)
       self.parent.assertEqual(result.logits.shape    ,						(self.batch_size, self.type_sequence_label_size)						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       Dict    =		self.num_labels
       lowerCAmelCase_					:       Tuple    =		FlaubertForTokenClassification(_lowercase						)
       model.to(_lowercase						)
       model.eval()

       lowerCAmelCase_					:       List[Any]    =		model(_lowercase    ,						attention_mask=_lowercase    ,						labels=_lowercase						)
       self.parent.assertEqual(result.logits.shape    ,						(self.batch_size, self.seq_length, self.num_labels)						)







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						):
       lowerCAmelCase_					:       str    =		self.num_choices
       lowerCAmelCase_					:       Optional[int]    =		FlaubertForMultipleChoice(config=_lowercase						)
       model.to(_lowercase						)
       model.eval()
       lowerCAmelCase_					:       Tuple    =		input_ids.unsqueeze(1						).expand(-1    ,						self.num_choices    ,						-1						).contiguous()
       lowerCAmelCase_					:       int    =		token_type_ids.unsqueeze(1						).expand(-1    ,						self.num_choices    ,						-1						).contiguous()
       lowerCAmelCase_					:       Optional[int]    =		input_mask.unsqueeze(1						).expand(-1    ,						self.num_choices    ,						-1						).contiguous()
       lowerCAmelCase_					:       Optional[int]    =		model(
           _lowercase    ,						attention_mask=_lowercase    ,						token_type_ids=_lowercase    ,						labels=_lowercase    ,						)
       self.parent.assertEqual(result.logits.shape    ,						(self.batch_size, self.num_choices)						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Tuple    =		self.prepare_config_and_inputs()
       (
           (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  (
           lowerCAmelCase_
       )   ,  
       )					:       List[str]    =		config_and_inputs
       lowerCAmelCase_					:       Union[str, Any]    =		{
           """input_ids""": input_ids,
           """token_type_ids""": token_type_ids,
           """lengths""": input_lengths,
           """attention_mask""": input_mask,
       }
       return config, inputs_dict





@require_torch
class      lowercase__    (							__A     ,					__A     ,					unittest.TestCase  ):
  __UpperCamelCase	     =  (
      (
          FlaubertModel,
          FlaubertWithLMHeadModel,
          FlaubertForQuestionAnswering,
          FlaubertForQuestionAnsweringSimple,
          FlaubertForSequenceClassification,
          FlaubertForTokenClassification,
          FlaubertForMultipleChoice,
      )
      if is_torch_available()
      else ()
  )
  __UpperCamelCase	     =  (
      {
          """feature-extraction""": FlaubertModel,
          """fill-mask""": FlaubertWithLMHeadModel,
          """question-answering""": FlaubertForQuestionAnsweringSimple,
          """text-classification""": FlaubertForSequenceClassification,
          """token-classification""": FlaubertForTokenClassification,
          """zero-shot""": FlaubertForSequenceClassification,
      }
      if is_torch_available()
      else {}
  )







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase    ,						_lowercase						):
       if (
           pipeline_test_casse_name == "QAPipelineTests"
           and tokenizer_name is not None
           and not tokenizer_name.endswith("""Fast"""						)
       ):
            # `QAPipelineTests` fails for a few models when the slower tokenizer are used.
            # (The slower tokenizers were never used for pipeline tests before the pipeline testing rework)
            # TODO: check (and possibly fix) the `QAPipelineTests` with slower tokenizer
            return True

       return False







  def 	UpperCAmelCase__		(	self    ,						_lowercase    ,						_lowercase    ,						_lowercase=False						):
       lowerCAmelCase_					:       List[str]    =		super()._prepare_for_class(_lowercase    ,						_lowercase    ,						return_labels=_lowercase						)

       if return_labels:
            if model_class.__name__ == "FlaubertForQuestionAnswering":
                 lowerCAmelCase_					:       Tuple    =		torch.zeros(
                     self.model_tester.batch_size    ,						dtype=torch.long    ,						device=_lowercase						)
                 lowerCAmelCase_					:       Any    =		torch.zeros(
                     self.model_tester.batch_size    ,						dtype=torch.long    ,						device=_lowercase						)

       return inputs_dict







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Union[str, Any]    =		FlaubertModelTester(self						)
       lowerCAmelCase_					:       int    =		ConfigTester(self    ,						config_class=_lowercase    ,						emb_dim=37						)







  def 	UpperCAmelCase__		(	self						):
       self.config_tester.run_common_tests()







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Tuple    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_model(*_lowercase						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Optional[Any]    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_lm_head(*_lowercase						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Optional[int]    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_simple_qa(*_lowercase						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Dict    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_qa(*_lowercase						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Tuple    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_sequence_classif(*_lowercase						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       str    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_token_classif(*_lowercase						)







  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Optional[int]    =		self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_flaubert_multiple_choice(*_lowercase						)







  @slow
  def 	UpperCAmelCase__		(	self						):
       for model_name in FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
            lowerCAmelCase_					:       Optional[Any]    =		FlaubertModel.from_pretrained(_lowercase						)
            self.assertIsNotNone(_lowercase						)







  @slow
  @require_torch_gpu
  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_   ,  lowerCAmelCase_					:       Optional[int]    =		self.model_tester.prepare_config_and_inputs_for_common()
       for model_class in self.all_model_classes:
            # FlauBertForMultipleChoice behaves incorrectly in JIT environments.
            if model_class == FlaubertForMultipleChoice:
                 return

            lowerCAmelCase_					:       List[Any]    =		True
            lowerCAmelCase_					:       Optional[int]    =		model_class(config=_lowercase						)

            lowerCAmelCase_					:       Any    =		self._prepare_for_class(_lowercase    ,						_lowercase						)
            lowerCAmelCase_					:       Optional[Any]    =		torch.jit.trace(
                _lowercase    ,						(inputs_dict["""input_ids"""].to("""cpu"""						), inputs_dict["""attention_mask"""].to("""cpu"""						))						)

            with tempfile.TemporaryDirectory() as tmp:
                 torch.jit.save(_lowercase    ,						os.path.join(_lowercase    ,						"""traced_model.pt"""						)						)
                 lowerCAmelCase_					:       Any    =		torch.jit.load(os.path.join(_lowercase    ,						"""traced_model.pt"""						)    ,						map_location=_lowercase						)
                 loaded(inputs_dict["""input_ids"""].to(_lowercase						)    ,						inputs_dict["""attention_mask"""].to(_lowercase						)						)





@require_torch
class      lowercase__    (							unittest.TestCase  ):







  @slow
  def 	UpperCAmelCase__		(	self						):
       lowerCAmelCase_					:       Tuple    =		FlaubertModel.from_pretrained("""flaubert/flaubert_base_cased"""						)
       lowerCAmelCase_					:       List[Any]    =		torch.tensor([[0, 345, 232, 328, 740, 140, 1_695, 69, 6_078, 1_588, 2]]						)
       with torch.no_grad():
            lowerCAmelCase_					:       Dict    =		model(_lowercase						)[0]
       lowerCAmelCase_					:       Tuple    =		torch.Size((1, 11, 768)						)
       self.assertEqual(output.shape    ,						_lowercase						)
       lowerCAmelCase_					:       Dict    =		torch.tensor(
           [[[-2.6251, -1.4298, -0.0227], [-2.8510, -1.6387, 0.2258], [-2.8114, -1.1832, -0.3066]]]						)

       self.assertTrue(torch.allclose(output[:, :3, :3]    ,						_lowercase    ,						atol=1e-4						)						)







def 							_lowerCAmelCase (  _a   :					int					,   _a   :					bool = False			)	->			bool:
     if n == 2:
          return True
     if not n % 2 or n < 2:
          return False
     if n > 5 and n % 10 not in (1, 3, 7, 9):  # can quickly check last digit
          return False
     if n > 3_31_70_44_06_46_79_88_73_85_96_19_81 and not allow_probable:
          raise ValueError(
              """Warning: upper bound of deterministic test is exceeded. """
              """Pass allow_probable=True to allow probabilistic test. """
              """A return value of True indicates a probable prime."""			)
     # array bounds provided by analysis
     lowerCAmelCase_					:       Optional[int]    =		[
         20_47,
         1_37_36_53,
         25_32_60_01,
         32_15_03_17_51,
         2_15_23_02_89_87_47,
         3_47_47_49_66_03_83,
         3_41_55_00_71_72_83_21,
         1,
         3_82_51_23_05_65_46_41_30_51,
         1,
         1,
         31_86_65_85_78_34_03_11_51_16_74_61,
         3_31_70_44_06_46_79_88_73_85_96_19_81,
     ]

     lowerCAmelCase_					:       Dict    =		[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41]
     for idx, _p in enumerate(_a					,   1			):
          if n < _p:
               # then we have our last prime to check
               lowerCAmelCase_					:       str    =		primes[:idx]
               break
     lowerCAmelCase_   ,  lowerCAmelCase_					:       Optional[Any]    =		n - 1, 0
     # break up n -1 into a power of 2 (s) and
     # remaining odd component
     # essentially, solve for d * 2 ** s == n - 1
     while d % 2 == 0:
          d //= 2
          s += 1
     for prime in plist:
          lowerCAmelCase_					:       Tuple    =		False
          for r in range(_a			):
               lowerCAmelCase_					:       Tuple    =		pow(_a					,   d * 2**r					,   _a			)
               # see article for analysis explanation for m
               if (r == 0 and m == 1) or ((m + 1) % n == 0):
                    lowerCAmelCase_					:       List[Any]    =		True
                    # this loop will not determine compositeness
                    break
          if pr:
               continue
          # if pr is False, then the above loop never evaluated to true,
          # and the n MUST be composite
          return False
     return True






def 							_lowerCAmelCase (  )	->			None:
     assert not miller_rabin(5_61			)
     assert miller_rabin(5_63			)
     # 2047

     assert not miller_rabin(83_82_01			)
     assert miller_rabin(83_82_07			)
     # 1_373_653

     assert not miller_rabin(17_31_60_01			)
     assert miller_rabin(17_31_60_17			)
     # 25_326_001

     assert not miller_rabin(30_78_38_66_41			)
     assert miller_rabin(30_78_38_66_53			)
     # 3_215_031_751

     assert not miller_rabin(1_71_30_45_57_48_01			)
     assert miller_rabin(1_71_30_45_57_48_19			)
     # 2_152_302_898_747

     assert not miller_rabin(2_77_97_99_72_83_07			)
     assert miller_rabin(2_77_97_99_72_83_27			)
     # 3_474_749_660_383

     assert not miller_rabin(1_13_85_00_23_90_94_41			)
     assert miller_rabin(1_13_85_00_23_90_95_27			)
     # 341_550_071_728_321

     assert not miller_rabin(1_27_50_41_01_88_48_80_43_51			)
     assert miller_rabin(1_27_50_41_01_88_48_80_43_91			)
     # 3_825_123_056_546_413_051

     assert not miller_rabin(7_96_66_46_44_58_50_77_87_79_18_67			)
     assert miller_rabin(7_96_66_46_44_58_50_77_87_79_19_51			)
     # 318_665_857_834_031_151_167_461

     assert not miller_rabin(55_28_40_67_74_46_64_78_97_66_03_33			)
     assert miller_rabin(55_28_40_67_74_46_64_78_97_66_03_59			)
     # 3_317_044_064_679_887_385_961_981
     # upper limit for probabilistic test


if __name__ == "__main__":
      test_miller_rabin()
