"""simple docstring"""
import unittest

from transformers import is_flax_available
from transformers.testing_utils import require_flax, require_sentencepiece, require_tokenizers, require_torch, slow


if is_flax_available():
 import optax
 from flax.training.common_utils import onehot

 from transformers import AutoTokenizer, FlaxMTaForConditionalGeneration
 from transformers.models.ta.modeling_flax_ta import shift_tokens_right




@require_torch
@require_sentencepiece
@require_tokenizers
@require_flax
class        __snake_case	(					unittest.TestCase    ):



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





        '''simple docstring'''





        a__:					List[str]      							=     FlaxMTaForConditionalGeneration.from_pretrained('google/mt5-small')
        a__:					str      							=     AutoTokenizer.from_pretrained('google/mt5-small')

        a__:					int      							=     tokenizer('Hello there'   ,      return_tensors='np').input_ids
        a__:					int      							=     tokenizer('Hi I am'   ,      return_tensors='np').input_ids

        a__:					Any      							=     shift_tokens_right(lowercase   ,      model.config.pad_token_id   ,      model.config.decoder_start_token_id)

        a__:					Union[str, Any]      							=     model(lowercase   ,      decoder_input_ids=lowercase).logits
        a__:					str      							=     optax.softmax_cross_entropy(lowercase   ,      onehot(lowercase   ,      logits.shape[-1])).mean()

        a__:					Optional[Any]      							=     -(labels.shape[-1] * loss.item())

        a__:					Tuple      							=     -84.9127
        self.assertTrue(abs(mtf_score - EXPECTED_SCORE) < 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')


