

import os
import tempfile
import unittest
from pathlib import Path

from transformers import AutoConfig, is_tf_available
from transformers.testing_utils import require_tf


if is_tf_available():
					import tensorflow as tf

					from transformers import TensorFlowBenchmark, TensorFlowBenchmarkArguments





@require_tf
class 	snake_case_   (		unittest.TestCase					):







			'''simple docstring'''

			def 				snake_case__(     self :				Dict							,   _UpperCamelCase :				str							)      ->List[str]:
									for model_result in results.values():
															for batch_size, sequence_length in zip(model_result['''bs''']							,   model_result['''ss''']							):
																					snake_case_   =	model_result['''result'''][batch_size][sequence_length]
																					self.assertIsNotNone(_UpperCamelCase							)







			def 				snake_case__(     self :				Dict							)      ->Any:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   eager_mode=_UpperCamelCase							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			def 				snake_case__(     self :				Dict							)      ->Any:
									snake_case_   =	'''sgugger/tiny-distilbert-classification'''
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   multi_process=_UpperCamelCase							,   only_pretrain_model=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			def 				snake_case__(     self :				Optional[Any]							)      ->Tuple:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			def 				snake_case__(     self :				Dict							)      ->int:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	AutoConfig.from_pretrained(_UpperCamelCase							)
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   eager_mode=_UpperCamelCase							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							,   [config]							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			def 				snake_case__(     self :				List[str]							)      ->Union[str, Any]:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	AutoConfig.from_pretrained(_UpperCamelCase							)
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							,   [config]							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			def 				snake_case__(     self :				Tuple							)      ->List[Any]:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_train_result							)
									self.check_results_dict_not_empty(results.memory_train_result							)







			def 				snake_case__(     self :				List[str]							)      ->Optional[Any]:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	AutoConfig.from_pretrained(_UpperCamelCase							)
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							,   [config]							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_train_result							)
									self.check_results_dict_not_empty(results.memory_train_result							)







			def 				snake_case__(     self :				Union[str, Any]							)      ->Any:
									snake_case_   =	'''patrickvonplaten/t5-tiny-random'''
									snake_case_   =	AutoConfig.from_pretrained(_UpperCamelCase							)
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							,   configs=[config]							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			@unittest.skipIf(is_tf_available() and len(tf.config.list_physical_devices('''GPU'''							)							) == 0							,   '''Cannot do xla on CPU.'''							)
			def 				snake_case__(     self :				Optional[int]							)      ->Optional[int]:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									snake_case_   =	TensorFlowBenchmarkArguments(
									    models=[MODEL_ID]							,   training=_UpperCamelCase							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   use_xla=_UpperCamelCase							,   multi_process=_UpperCamelCase							,   )
									snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
									snake_case_   =	benchmark.run()
									self.check_results_dict_not_empty(results.time_inference_result							)
									self.check_results_dict_not_empty(results.memory_inference_result							)







			def 				snake_case__(     self :				str							)      ->Tuple:
									snake_case_   =	'''sshleifer/tiny-gpt2'''
									with tempfile.TemporaryDirectory() as tmp_dir:
															snake_case_   =	TensorFlowBenchmarkArguments(
															    models=[MODEL_ID]							,   inference=_UpperCamelCase							,   save_to_csv=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   inference_time_csv_file=os.path.join(_UpperCamelCase							,   '''inf_time.csv'''							)							,   inference_memory_csv_file=os.path.join(_UpperCamelCase							,   '''inf_mem.csv'''							)							,   env_info_csv_file=os.path.join(_UpperCamelCase							,   '''env.csv'''							)							,   multi_process=_UpperCamelCase							,   )
															snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
															benchmark.run()
															self.assertTrue(Path(os.path.join(_UpperCamelCase							,   '''inf_time.csv'''							)							).exists()							)
															self.assertTrue(Path(os.path.join(_UpperCamelCase							,   '''inf_mem.csv'''							)							).exists()							)
															self.assertTrue(Path(os.path.join(_UpperCamelCase							,   '''env.csv'''							)							).exists()							)







			def 				snake_case__(     self :				List[str]							)      ->Union[str, Any]:
									snake_case_   =	'''sshleifer/tiny-gpt2'''

									def _check_summary_is_not_empty(_UpperCamelCase :				int							):
															self.assertTrue(hasattr(_UpperCamelCase							,   '''sequential'''							)							)
															self.assertTrue(hasattr(_UpperCamelCase							,   '''cumulative'''							)							)
															self.assertTrue(hasattr(_UpperCamelCase							,   '''current'''							)							)
															self.assertTrue(hasattr(_UpperCamelCase							,   '''total'''							)							)

									with tempfile.TemporaryDirectory() as tmp_dir:
															snake_case_   =	TensorFlowBenchmarkArguments(
															    models=[MODEL_ID]							,   inference=_UpperCamelCase							,   sequence_lengths=[8]							,   batch_sizes=[1]							,   log_filename=os.path.join(_UpperCamelCase							,   '''log.txt'''							)							,   log_print=_UpperCamelCase							,   trace_memory_line_by_line=_UpperCamelCase							,   eager_mode=_UpperCamelCase							,   multi_process=_UpperCamelCase							,   )
															snake_case_   =	TensorFlowBenchmark(_UpperCamelCase							)
															snake_case_   =	benchmark.run()
															_check_summary_is_not_empty(result.inference_summary							)
															self.assertTrue(Path(os.path.join(_UpperCamelCase							,   '''log.txt'''							)							).exists()							)


import math


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
						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.
					lowerCAmelCase_       	=	'''Enter the base and the power separated by a comma: '''
					lowerCAmelCase_	,      lowerCAmelCase_       	=	map(int, input(prompt).split(''','''))
					lowerCAmelCase_	,      lowerCAmelCase_       	=	map(int, input(prompt).split(''','''))

					# We find the log of each number, using the function res(), which takes two
					# arguments.
					lowerCAmelCase_       	=	res(xa, ya)
					lowerCAmelCase_       	=	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''')