



"""simple docstring"""






import unittest
from pathlib import Path

from transformers import is_vision_available, load_tool
from transformers.testing_utils import get_tests_dir

from .test_tools_common import ToolTesterMixin


if is_vision_available():
				from PIL import Image

class 	__lowerCAmelCase							(unittest.TestCase					,__UpperCamelCase  ):


					'''simple docstring'''


					def 		_a (      self   ):




										"""simple docstring"""





										snake_case_						:Optional[int]								=						load_tool("image-captioning"   )
										self.tool.setup()
										snake_case_						:Union[str, Any]								=						load_tool("image-captioning"    ,       remote=a   )







					def 		_a (      self   ):




										"""simple docstring"""





										snake_case_						:Optional[Any]								=						Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
										snake_case_						:str								=						self.tool(a   )
										self.assertEqual(a    ,       "two cats sleeping on a couch"   )







					def 		_a (      self   ):




										"""simple docstring"""





										snake_case_						:List[Any]								=						Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
										snake_case_						:List[Any]								=						self.remote_tool(a   )
										self.assertEqual(a    ,       "two cats sleeping on a couch"   )







					def 		_a (      self   ):




										"""simple docstring"""





										snake_case_						:Tuple								=						Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
										snake_case_						:int								=						self.tool(image=a   )
										self.assertEqual(a    ,       "two cats sleeping on a couch"   )







					def 		_a (      self   ):




										"""simple docstring"""





										snake_case_						:Optional[int]								=						Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
										snake_case_						:Union[str, Any]								=						self.remote_tool(image=a   )
										self.assertEqual(a    ,       "two cats sleeping on a couch"   )






"""simple docstring"""






def      A      (			_A,     _A							):




					"""simple docstring"""
					if n == 0:
										return 1

					elif n % 2 == 1:
										return binary_exponentiation(_A,     n - 1							) * a

					else:
										snake_case_						:Optional[int]								=						binary_exponentiation(_A,     n / 2							)
										return b * b


if __name__ == "__main__":
				try:
								__UpperCAmelCase      :      str   					=					int(input('Enter Base : ').strip())
								__UpperCAmelCase      :      Any   					=					int(input('Enter Power : ').strip())
				except ValueError:
								print('Invalid literal for integer')

				__UpperCAmelCase      :      Optional[int]   					=					binary_exponentiation(BASE, POWER)
				print(F'''{BASE}^({POWER}) : {RESULT}''')

