"""simple docstring"""
import unittest

import numpy as np

from transformers import AlbertConfig, is_flax_available
from transformers.testing_utils import require_flax, slow

from ...test_modeling_flax_common import FlaxModelTesterMixin, ids_tensor, random_attention_mask


if is_flax_available():
 import jax.numpy as jnp

 from transformers.models.albert.modeling_flax_albert import (
     FlaxAlbertForMaskedLM,
     FlaxAlbertForMultipleChoice,
     FlaxAlbertForPreTraining,
     FlaxAlbertForQuestionAnswering,
     FlaxAlbertForSequenceClassification,
     FlaxAlbertForTokenClassification,
     FlaxAlbertModel,
 )




class        __snake_case	(					unittest.TestCase    ):



      def __init__(						self   ,      lowercase   ,      lowercase=13   ,      lowercase=7   ,      lowercase=True   ,      lowercase=True   ,      lowercase=True   ,      lowercase=True   ,      lowercase=99   ,      lowercase=32   ,      lowercase=5   ,      lowercase=4   ,      lowercase=37   ,      lowercase="gelu"   ,      lowercase=0.1   ,      lowercase=0.1   ,      lowercase=5_12   ,      lowercase=16   ,      lowercase=2   ,      lowercase=0.02   ,      lowercase=4   ,      )     ->      List[Any]:





        '''simple docstring'''





        a__:					Any      							=     parent
        a__:					List[Any]      							=     batch_size
        a__:					List[str]      							=     seq_length
        a__:					Optional[int]      							=     is_training
        a__:					Any      							=     use_attention_mask
        a__:					List[str]      							=     use_token_type_ids
        a__:					int      							=     use_labels
        a__:					Optional[Any]      							=     vocab_size
        a__:					Any      							=     hidden_size
        a__:					Optional[Any]      							=     num_hidden_layers
        a__:					int      							=     num_attention_heads
        a__:					str      							=     intermediate_size
        a__:					Dict      							=     hidden_act
        a__:					Any      							=     hidden_dropout_prob
        a__:					Optional[int]      							=     attention_probs_dropout_prob
        a__:					Optional[int]      							=     max_position_embeddings
        a__:					int      							=     type_vocab_size
        a__:					int      							=     type_sequence_label_size
        a__:					Union[str, Any]      							=     initializer_range
        a__:					str      							=     num_choices



      def   lowerCamelCase_       (						self)     ->      Optional[Any]:





        '''simple docstring'''





        a__:					Union[str, Any]      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.vocab_size)

        a__:					List[str]      							=     None
        if self.use_attention_mask:
          a__:					Tuple      							=     random_attention_mask([self.batch_size, self.seq_length])

        a__:					Any      							=     None
        if self.use_token_type_ids:
          a__:					Optional[int]      							=     ids_tensor([self.batch_size, self.seq_length]   ,      self.type_vocab_size)

        a__:					Optional[Any]      							=     AlbertConfig(
            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=lowercase   ,      initializer_range=self.initializer_range   ,      )

        return config, input_ids, token_type_ids, attention_mask



      def   lowerCamelCase_       (						self)     ->      Optional[int]:





        '''simple docstring'''





        a__:					Dict      							=     self.prepare_config_and_inputs()
        a__							,   a__							,   a__							,   a__:					Tuple      							=     config_and_inputs
        a__:					List[str]      							=     {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'attention_mask': attention_mask}
        return config, inputs_dict







@require_flax
class        __snake_case	(					__lowerCAmelCase	,				unittest.TestCase    ):
      a__				=		(
          (
              FlaxAlbertModel,
              FlaxAlbertForPreTraining,
              FlaxAlbertForMaskedLM,
              FlaxAlbertForMultipleChoice,
              FlaxAlbertForQuestionAnswering,
              FlaxAlbertForSequenceClassification,
              FlaxAlbertForTokenClassification,
              FlaxAlbertForQuestionAnswering,
          )
          if is_flax_available()
          else ()
      )



      def   lowerCamelCase_       (						self)     ->      List[str]:





        '''simple docstring'''





        a__:					str      							=     FlaxAlbertModelTester(self)



      @slow
      def   lowerCamelCase_       (						self)     ->      int:





        '''simple docstring'''





        for model_class_name in self.all_model_classes:
          a__:					Any      							=     model_class_name.from_pretrained('albert-base-v2')
          a__:					Any      							=     model(np.ones((1, 1)))
          self.assertIsNotNone(lowercase)







@require_flax
class        __snake_case	(					unittest.TestCase    ):



      @slow
      def   lowerCamelCase_       (						self)     ->      str:





        '''simple docstring'''





        a__:					Optional[Any]      							=     FlaxAlbertModel.from_pretrained('albert-base-v2')
        a__:					Dict      							=     np.array([[0, 3_45, 2_32, 3_28, 7_40, 1_40, 16_95, 69, 60_78, 15_88, 2]])
        a__:					Dict      							=     np.array([[0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]])
        a__:					List[Any]      							=     model(lowercase   ,      attention_mask=lowercase)[0]
        a__:					int      							=     (1, 11, 7_68)
        self.assertEqual(output.shape   ,      lowercase)
        a__:					int      							=     np.array(
            [[[-0.6513, 1.5035, -0.2766], [-0.6515, 1.5046, -0.2780], [-0.6512, 1.5049, -0.2784]]])

        self.assertTrue(jnp.allclose(output[:, 1:4, 1:4]   ,      lowercase   ,      atol=1e-4))



"""simple docstring"""
import math







def 						__a       (     _SCREAMING_SNAKE_CASE		,					_SCREAMING_SNAKE_CASE       )     ->Optional[int]:
  if 0 not in (x, y):
    # We use the relation x^y = y*log10(x), where 10 is the base.
    return y * math.logaa(_SCREAMING_SNAKE_CASE       )
  else:
    if x == 0:  # 0 raised to any number is 0
      return 0
    elif y == 0:
      return 1  # any number raised to 0 is 1
  raise AssertionError('This should never happen'       )


if __name__ == "__main__":  # Main function
 # Read two numbers from input and typecast them to int using map function.
 # Here x is the base and y is the power.
 lowercase__ 	=     'Enter the base and the power separated by a comma: '
 lowercase__	, lowercase__ 	=     map(int, input(prompt).split(','))
 lowercase__	, lowercase__ 	=     map(int, input(prompt).split(','))

 # We find the log of each number, using the function res(), which takes two
 # arguments.
 lowercase__ 	=     res(xa, ya)
 lowercase__ 	=     res(xa, ya)

 # We check for the largest number
 if resa > resa:
  print('Largest number is', xa, '^', ya)
 elif resa > resa:
  print('Largest number is', xa, '^', ya)
 else:
  print('Both are equal')


