'''simple docstring'''




import unittest

from transformers import ElectraConfig, is_torch_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, slow, torch_device

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


if is_torch_available():
  import torch

  from transformers import (
      MODEL_FOR_PRETRAINING_MAPPING,
      ElectraForCausalLM,
      ElectraForMaskedLM,
      ElectraForMultipleChoice,
      ElectraForPreTraining,
      ElectraForQuestionAnswering,
      ElectraForSequenceClassification,
      ElectraForTokenClassification,
      ElectraModel,
  )
  from transformers.models.electra.modeling_electra import ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST




class       __UpperCAmelCase							:





       '''simple docstring'''



       def __init__( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE=13       ,	_SCREAMING_SNAKE_CASE=7       ,	_SCREAMING_SNAKE_CASE=True       ,	_SCREAMING_SNAKE_CASE=True       ,	_SCREAMING_SNAKE_CASE=True       ,	_SCREAMING_SNAKE_CASE=True       ,	_SCREAMING_SNAKE_CASE=99       ,	_SCREAMING_SNAKE_CASE=32       ,	_SCREAMING_SNAKE_CASE=5       ,	_SCREAMING_SNAKE_CASE=4       ,	_SCREAMING_SNAKE_CASE=37       ,	_SCREAMING_SNAKE_CASE="gelu"       ,	_SCREAMING_SNAKE_CASE=0.1       ,	_SCREAMING_SNAKE_CASE=0.1       ,	_SCREAMING_SNAKE_CASE=512       ,	_SCREAMING_SNAKE_CASE=16       ,	_SCREAMING_SNAKE_CASE=2       ,	_SCREAMING_SNAKE_CASE=0.02       ,	_SCREAMING_SNAKE_CASE=3       ,	_SCREAMING_SNAKE_CASE=4       ,	_SCREAMING_SNAKE_CASE=None       ,	)						->	List[str]:
           A_      =  parent
           A_      =  batch_size
           A_      =  seq_length
           A_      =  is_training
           A_      =  use_input_mask
           A_      =  use_token_type_ids
           A_      =  use_labels
           A_      =  vocab_size
           A_      =  hidden_size
           A_      =  num_hidden_layers
           A_      =  num_attention_heads
           A_      =  intermediate_size
           A_      =  hidden_act
           A_      =  hidden_dropout_prob
           A_      =  attention_probs_dropout_prob
           A_      =  max_position_embeddings
           A_      =  type_vocab_size
           A_      =  type_sequence_label_size
           A_      =  initializer_range
           A_      =  num_labels
           A_      =  num_choices
           A_      =  scope

       def    __A			( self					)						->	Any:
           A_      =  ids_tensor([self.batch_size, self.seq_length]       ,	self.vocab_size					)

           A_      =  None
           if self.use_input_mask:
               A_      =  random_attention_mask([self.batch_size, self.seq_length]					)

           A_      =  None
           if self.use_token_type_ids:
               A_      =  ids_tensor([self.batch_size, self.seq_length]       ,	self.type_vocab_size					)

           A_      =  None
           A_      =  None
           A_      =  None
           if self.use_labels:
               A_      =  ids_tensor([self.batch_size]       ,	self.type_sequence_label_size					)
               A_      =  ids_tensor([self.batch_size, self.seq_length]       ,	self.num_labels					)
               A_      =  ids_tensor([self.batch_size]       ,	self.num_choices					)
               A_      =  ids_tensor([self.batch_size, self.seq_length]       ,	1					)

           A_      =  self.get_config()

           return (
               config,
               input_ids,
               token_type_ids,
               input_mask,
               sequence_labels,
               token_labels,
               choice_labels,
               fake_token_labels,
           )

       def    __A			( self					)						->	Union[str, Any]:
           return ElectraConfig(
               vocab_size=self.vocab_size       ,	hidden_size=self.hidden_size       ,	num_hidden_layers=self.num_hidden_layers       ,	num_attention_heads=self.num_attention_heads       ,	intermediate_size=self.intermediate_size       ,	hidden_act=self.hidden_act       ,	hidden_dropout_prob=self.hidden_dropout_prob       ,	attention_probs_dropout_prob=self.attention_probs_dropout_prob       ,	max_position_embeddings=self.max_position_embeddings       ,	type_vocab_size=self.type_vocab_size       ,	is_decoder=_SCREAMING_SNAKE_CASE       ,	initializer_range=self.initializer_range       ,	)

       def    __A			( self					)						->	Optional[Any]:
           (
               (
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,
           )      =  self.prepare_config_and_inputs()

           A_      =  True
           A_      =  floats_tensor([self.batch_size, self.seq_length, self.hidden_size]					)
           A_      =  ids_tensor([self.batch_size, self.seq_length]       ,	vocab_size=2					)

           return (
               config,
               input_ids,
               token_type_ids,
               input_mask,
               sequence_labels,
               token_labels,
               choice_labels,
               encoder_hidden_states,
               encoder_attention_mask,
           )

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	int:
           A_      =  ElectraModel(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE					)
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE					)
           A_      =  model(_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, self.seq_length, self.hidden_size)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	List[str]:
           A_      =  True
           A_      =  ElectraModel(_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(
               _SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	encoder_hidden_states=_SCREAMING_SNAKE_CASE       ,	encoder_attention_mask=_SCREAMING_SNAKE_CASE       ,	)
           A_      =  model(
               _SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	encoder_hidden_states=_SCREAMING_SNAKE_CASE       ,	)
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.last_hidden_state.shape       ,	(self.batch_size, self.seq_length, self.hidden_size)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	Dict:
           A_      =  ElectraForMaskedLM(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	labels=_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.vocab_size)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	Dict:
           A_      =  ElectraForCausalLM(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	labels=_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.vocab_size)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	List[str]:
           A_      =  self.num_labels
           A_      =  ElectraForTokenClassification(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	labels=_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length, self.num_labels)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	int:
           A_      =  self.num_labels
           A_      =  ElectraForPreTraining(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	labels=_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.seq_length)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	Any:
           A_      =  self.num_labels
           A_      =  ElectraForSequenceClassification(_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	labels=_SCREAMING_SNAKE_CASE					)
           self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.num_labels)					)

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	Any:
           A_      =  ElectraForQuestionAnswering(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  model(
               _SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	start_positions=_SCREAMING_SNAKE_CASE       ,	end_positions=_SCREAMING_SNAKE_CASE       ,	)
           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    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	)						->	Union[str, Any]:
           A_      =  self.num_choices
           A_      =  ElectraForMultipleChoice(config=_SCREAMING_SNAKE_CASE					)
           model.to(_SCREAMING_SNAKE_CASE					)
           model.eval()
           A_      =  input_ids.unsqueeze(1					).expand(-1       ,	self.num_choices       ,	-1					).contiguous()
           A_      =  token_type_ids.unsqueeze(1					).expand(-1       ,	self.num_choices       ,	-1					).contiguous()
           A_      =  input_mask.unsqueeze(1					).expand(-1       ,	self.num_choices       ,	-1					).contiguous()
           A_      =  model(
               _SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE       ,	token_type_ids=_SCREAMING_SNAKE_CASE       ,	labels=_SCREAMING_SNAKE_CASE       ,	)
           self.parent.assertEqual(result.logits.shape       ,	(self.batch_size, self.num_choices)					)

       def    __A			( self					)						->	str:
           A_      =  self.prepare_config_and_inputs()
           (
               (
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,(
               A_
           )  ,
           )      =  config_and_inputs
           A_      =  {'''input_ids''': input_ids, '''token_type_ids''': token_type_ids, '''attention_mask''': input_mask}
           return config, inputs_dict




@require_torch
class       __UpperCAmelCase							(							_UpperCamelCase		, _UpperCamelCase		, unittest.TestCase	):





       '''simple docstring'''



       __lowercase   :   List[str]  					=							(
           (
               ElectraModel,
               ElectraForPreTraining,
               ElectraForMaskedLM,
               ElectraForCausalLM,
               ElectraForMultipleChoice,
               ElectraForTokenClassification,
               ElectraForSequenceClassification,
               ElectraForQuestionAnswering,
           )
           if is_torch_available()
           else ()
       )
       __lowercase   :   int  					=							(
           {
               'feature-extraction': ElectraModel,
               'fill-mask': ElectraForMaskedLM,
               'question-answering': ElectraForQuestionAnswering,
               'text-classification': ElectraForSequenceClassification,
               'text-generation': ElectraForCausalLM,
               'token-classification': ElectraForTokenClassification,
               'zero-shot': ElectraForSequenceClassification,
           }
           if is_torch_available()
           else {}
       )
       __lowercase   :   str  					=							True

       def    __A			( self       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE=False					)						->	Any:
           A_      =  super()._prepare_for_class(_SCREAMING_SNAKE_CASE       ,	_SCREAMING_SNAKE_CASE       ,	return_labels=_SCREAMING_SNAKE_CASE					)

           if return_labels:
               if model_class in get_values(_SCREAMING_SNAKE_CASE					):
                   A_      =  torch.zeros(
                       (self.model_tester.batch_size, self.model_tester.seq_length)       ,	dtype=torch.long       ,	device=_SCREAMING_SNAKE_CASE					)
           return inputs_dict

       def    __A			( self					)						->	int:
           A_      =  ElectraModelTester(self					)
           A_      =  ConfigTester(self       ,	config_class=_SCREAMING_SNAKE_CASE       ,	hidden_size=37					)

       def    __A			( self					)						->	str:
           self.config_tester.run_common_tests()

       def    __A			( self					)						->	Optional[int]:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_model(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	Any:
           A_      =  self.model_tester.prepare_config_and_inputs_for_decoder()
           self.model_tester.create_and_check_electra_model_as_decoder(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	List[str]:
           A_      =  self.model_tester.prepare_config_and_inputs()
           for type in ["absolute", "relative_key", "relative_key_query"]:
               A_      =  type
               self.model_tester.create_and_check_electra_model(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	int:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_for_masked_lm(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	Dict:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_for_token_classification(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	Optional[int]:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_for_pretraining(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	List[str]:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_for_sequence_classification(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	Tuple:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_for_question_answering(*_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	List[Any]:
           A_      =  self.model_tester.prepare_config_and_inputs()
           self.model_tester.create_and_check_electra_for_multiple_choice(*_SCREAMING_SNAKE_CASE					)

       @slow
       def    __A			( self					)						->	Dict:
           for model_name in ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
               A_      =  ElectraModel.from_pretrained(_SCREAMING_SNAKE_CASE					)
               self.assertIsNotNone(_SCREAMING_SNAKE_CASE					)

       def    __A			( self					)						->	Tuple:
           A_      =  self.model_tester.prepare_config_and_inputs_for_decoder()
           self.model_tester.create_and_check_electra_for_causal_lm(*_SCREAMING_SNAKE_CASE					)




@require_torch
class       __UpperCAmelCase							(							unittest.TestCase	):





       '''simple docstring'''



       @slow
       def    __A			( self					)						->	str:
           A_      =  ElectraModel.from_pretrained('''google/electra-small-discriminator'''					)
           A_      =  torch.tensor([[0, 345, 232, 328, 740, 140, 1695, 69, 6078, 1588, 2]]					)
           A_      =  torch.tensor([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]					)
           A_      =  model(_SCREAMING_SNAKE_CASE       ,	attention_mask=_SCREAMING_SNAKE_CASE					)[0]
           A_      =  torch.Size((1, 11, 256)					)
           self.assertEqual(output.shape       ,	_SCREAMING_SNAKE_CASE					)
           A_      =  torch.tensor(
               [[[0.4_471, 0.6_821, -0.3_265], [0.4_627, 0.5_255, -0.3_668], [0.4_532, 0.3_313, -0.4_344]]]					)

           self.assertTrue(torch.allclose(output[:, 1:4, 1:4]       ,	_SCREAMING_SNAKE_CASE       ,	atol=1E-4					)					)







'''simple docstring'''




def 	_UpperCAmelCase       (				_UpperCamelCase       :      list[list[int]],  _UpperCamelCase       :      list[list[int]]  )      -> list[list[int]]:
    A_      =  []
    A_      =  len(_UpperCamelCase  )
    for i in range(_UpperCamelCase  ):
        A_      =  []
        for j in range(_UpperCamelCase  ):
            A_      =  0
            for k in range(_UpperCamelCase  ):
                A_      =  val + matrix_a[i][k] * matrix_b[k][j]
            list_a.append(_UpperCamelCase  )
        matrix_c.append(_UpperCamelCase  )
    return matrix_c





def 	_UpperCAmelCase       (				_UpperCamelCase       :      int  )      -> list[list[int]]:
    return [[int(row == column  ) for column in range(_UpperCamelCase  )] for row in range(_UpperCamelCase  )]





def 	_UpperCAmelCase       (				_UpperCamelCase       :      int  )      -> int:
    if n <= 1:
        return n
    A_      =  identity(2  )
    A_      =  [[1, 1], [1, 0]]
    A_      =  n - 1
    while n > 0:
        if n % 2 == 1:
            A_      =  multiply(_UpperCamelCase,  _UpperCamelCase  )
        A_      =  multiply(_UpperCamelCase,  _UpperCamelCase  )
        A_      =  int(n / 2  )
    return res_matrix[0][0]





def 	_UpperCAmelCase       (				_UpperCamelCase       :      int  )      -> int:
    if n <= 1:
        return n
    A_      =  0
    A_      =  1
    for _ in range(2,  n + 1  ):
        A_  ,A_      =  fiba, fiba + fiba
    return fiba





def 	_UpperCAmelCase       (				)      -> None:
    for ordinal in "0th 1st 2nd 3rd 10th 100th 1000th".split():
        A_      =  int(''''''.join(c for c in ordinal if c in '''0123456789'''  )  )  # 1000th --> 1000
        print(
            F'''{ordinal} fibonacci number using matrix exponentiation is '''
            F'''{nth_fibonacci_matrix(_UpperCamelCase  )} and using bruteforce is '''
            F'''{nth_fibonacci_bruteforce(_UpperCamelCase  )}\n'''  )
    # from timeit import timeit
    # print(timeit("nth_fibonacci_matrix(1000000)",
    #              "from main import nth_fibonacci_matrix", number=5))
    # print(timeit("nth_fibonacci_bruteforce(1000000)",
    #              "from main import nth_fibonacci_bruteforce", number=5))
    # 2.3342058970001744
    # 57.256506615000035


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()






