






"""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 	a					(       unittest.TestCase,    a_     ):







    def       UpperCamelCase_				(      self	):
      lowercase							   =	load_tool('image-question-answering'	)
      self.tool.setup()
      lowercase							   =	load_tool('image-question-answering'							,		remote=_lowerCamelCase	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	Image.open(Path(get_tests_dir('fixtures/tests_samples/COCO'	)	) / '000000039769.png'	)
      lowercase							   =	self.tool(_lowerCamelCase							,		'How many cats are sleeping on the couch?'	)
      self.assertEqual(_lowerCamelCase							,		'2'	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	Image.open(Path(get_tests_dir('fixtures/tests_samples/COCO'	)	) / '000000039769.png'	)
      lowercase							   =	self.remote_tool(_lowerCamelCase							,		'How many cats are sleeping on the couch?'	)
      self.assertEqual(_lowerCamelCase							,		'2'	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	Image.open(Path(get_tests_dir('fixtures/tests_samples/COCO'	)	) / '000000039769.png'	)
      lowercase							   =	self.tool(image=_lowerCamelCase							,		question='How many cats are sleeping on the couch?'	)
      self.assertEqual(_lowerCamelCase							,		'2'	)







    def       UpperCamelCase_				(      self	):
      lowercase							   =	Image.open(Path(get_tests_dir('fixtures/tests_samples/COCO'	)	) / '000000039769.png'	)
      lowercase							   =	self.remote_tool(image=_lowerCamelCase							,		question='How many cats are sleeping on the couch?'	)
      self.assertEqual(_lowerCamelCase							,		'2'	)










"""simple docstring"""



def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  Dict		, __snake_case      :  str   ):





  '''simple docstring'''





  lowercase							   =	1
  while b > 0:
    if b & 1:
      res *= a

    a *= a
    b >>= 1

  return res
def 						_SCREAMING_SNAKE_CASE			(   __snake_case      :  int		, __snake_case      :  List[str]		, __snake_case      :  str   ):





  '''simple docstring'''





  lowercase							   =	1
  while b > 0:
    if b & 1:
      lowercase							   =	((res % c) * (a % c)) % c

    a *= a
    b >>= 1

  return res


