"""simple docstring"""
import math
import time
from typing import Dict, List, Optional

from torch.utils.data import Dataset

from transformers import SeqaSeqTrainer, is_torch_tpu_available
from transformers.trainer_utils import PredictionOutput, speed_metrics


if is_torch_tpu_available(check_device=False):
       import torch_xla.core.xla_model as xm
       import torch_xla.debug.metrics as met




class        __snake_case	(					_a    ):



      def __init__(						self   ,      *lowercase   ,      lowercase=None   ,      lowercase=None   ,      **lowercase)     ->      List[Any]:





        '''simple docstring'''





        super().__init__(*__lowerCAmelCase   ,      **__lowerCAmelCase)
        a__:					Union[str, Any]      							=     eval_examples
        a__:					Dict      							=     post_process_function



      def   lowerCamelCase_       (						self   ,      lowercase = None   ,      lowercase=None   ,      lowercase = None   ,      lowercase = "eval"   ,      **lowercase   ,      )     ->      Dict:





        '''simple docstring'''





        a__:					Union[str, Any]      							=     gen_kwargs.copy()
        a__:					Optional[int]      							=     (
            gen_kwargs['max_length'] if gen_kwargs.get('max_length') is not None else self.args.generation_max_length
        )
        a__:					Union[str, Any]      							=     (
            gen_kwargs['num_beams'] if gen_kwargs.get('num_beams') is not None else self.args.generation_num_beams
        )
        a__:					List[str]      							=     gen_kwargs

        a__:					Optional[int]      							=     self.eval_dataset if eval_dataset is None else eval_dataset
        a__:					int      							=     self.get_eval_dataloader(__lowerCAmelCase)
        a__:					str      							=     self.eval_examples if eval_examples is None else eval_examples

        # Temporarily disable metric computation, we will do it in the loop here.
        a__:					str      							=     self.compute_metrics
        a__:					Tuple      							=     None
        a__:					Tuple      							=     time.time()
        a__:					Optional[int]      							=     self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
        try:
          a__:					Dict      							=     eval_loop(
              __lowerCAmelCase   ,      description='Evaluation'   ,      prediction_loss_only=True if compute_metrics is None else None   ,      ignore_keys=__lowerCAmelCase   ,      metric_key_prefix=__lowerCAmelCase   ,      )
        finally:
          a__:					Any      							=     compute_metrics
        a__:					List[Any]      							=     self.args.eval_batch_size * self.args.world_size
        if f'{metric_key_prefix}_jit_compilation_time' in output.metrics:
          start_time += output.metrics[f'{metric_key_prefix}_jit_compilation_time']
        output.metrics.update(
            speed_metrics(
                __lowerCAmelCase   ,      __lowerCAmelCase   ,      num_samples=output.num_samples   ,      num_steps=math.ceil(output.num_samples / total_batch_size)   ,      ))

        if self.post_process_function is not None and self.compute_metrics is not None and self.args.should_save:
          # Only the main node write the results by default
          a__:					Optional[int]      							=     self.post_process_function(__lowerCAmelCase   ,      __lowerCAmelCase   ,      __lowerCAmelCase)
          a__:					int      							=     self.compute_metrics(__lowerCAmelCase)

          # Prefix all keys with metric_key_prefix + '_'
          for key in list(metrics.keys()):
            if not key.startswith(f'{metric_key_prefix}_'):
              a__:					List[Any]      							=     metrics.pop(__lowerCAmelCase)

          metrics.update(output.metrics)
        else:
          a__:					Any      							=     output.metrics

        if self.args.should_log:
          # Only the main node log the results by default
          self.log(__lowerCAmelCase)

        if self.args.tpu_metrics_debug or self.args.debug:
          # tpu-comment: Logging debug metrics for PyTorch/XLA (compile, execute times, ops, etc.)
          xm.master_print(met.metrics_report())

        a__:					str      							=     self.callback_handler.on_evaluate(self.args   ,      self.state   ,      self.control   ,      __lowerCAmelCase)
        return metrics



      def   lowerCamelCase_       (						self   ,      lowercase   ,      lowercase   ,      lowercase=None   ,      lowercase = "test"   ,      **lowercase)     ->      List[Any]:





        '''simple docstring'''





        a__:					List[Any]      							=     gen_kwargs.copy()

        a__:					Optional[int]      							=     self.get_test_dataloader(__lowerCAmelCase)

        # Temporarily disable metric computation, we will do it in the loop here.
        a__:					Union[str, Any]      							=     self.compute_metrics
        a__:					List[str]      							=     None
        a__:					List[Any]      							=     time.time()
        a__:					int      							=     self.prediction_loop if self.args.use_legacy_prediction_loop else self.evaluation_loop
        try:
          a__:					int      							=     eval_loop(
              __lowerCAmelCase   ,      description='Prediction'   ,      prediction_loss_only=True if compute_metrics is None else None   ,      ignore_keys=__lowerCAmelCase   ,      metric_key_prefix=__lowerCAmelCase   ,      )
        finally:
          a__:					Optional[Any]      							=     compute_metrics

        a__:					Tuple      							=     self.args.eval_batch_size * self.args.world_size
        if f'{metric_key_prefix}_jit_compilation_time' in output.metrics:
          start_time += output.metrics[f'{metric_key_prefix}_jit_compilation_time']
        output.metrics.update(
            speed_metrics(
                __lowerCAmelCase   ,      __lowerCAmelCase   ,      num_samples=output.num_samples   ,      num_steps=math.ceil(output.num_samples / total_batch_size)   ,      ))
        if self.post_process_function is None or self.compute_metrics is None:
          return output

        a__:					List[str]      							=     self.post_process_function(__lowerCAmelCase   ,      __lowerCAmelCase   ,      __lowerCAmelCase   ,      'predict')
        a__:					Optional[int]      							=     self.compute_metrics(__lowerCAmelCase)

        # Prefix all keys with metric_key_prefix + '_'
        for key in list(metrics.keys()):
          if not key.startswith(f'{metric_key_prefix}_'):
            a__:					List[Any]      							=     metrics.pop(__lowerCAmelCase)
        metrics.update(output.metrics)
        return PredictionOutput(predictions=predictions.predictions   ,      label_ids=predictions.label_ids   ,      metrics=__lowerCAmelCase)



"""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')


