



def 		_UpperCAmelCase    (				snake_case      ):





					"""simple docstring"""

					if not isinstance(snake_case     ,						snake_case      ):
										raise ValueError("""double_factorial() only accepts integral values"""      )
					if num < 0:
										raise ValueError("""double_factorial() not defined for negative values"""      )
					_lowerCAmelCase      =   1
					for i in range(snake_case     ,						0     ,						-2      ):
										value *= i
					return value


if __name__ == "__main__":
	import doctest

	doctest.testmod()








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	,						lowerCamelCase__	):




				def 							snake_case       (							self		):



									"""simple docstring"""





									_lowerCAmelCase      =   load_tool("""image-question-answering"""		)
									self.tool.setup()
									_lowerCAmelCase      =   load_tool("""image-question-answering"""						,    remote=_snake_case		)




				def 							snake_case       (							self		):



									"""simple docstring"""





									_lowerCAmelCase      =   Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""		)		) / """000000039769.png"""		)
									_lowerCAmelCase      =   self.tool(_snake_case						,    """How many cats are sleeping on the couch?"""		)
									self.assertEqual(_snake_case						,    """2"""		)




				def 							snake_case       (							self		):



									"""simple docstring"""





									_lowerCAmelCase      =   Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""		)		) / """000000039769.png"""		)
									_lowerCAmelCase      =   self.remote_tool(_snake_case						,    """How many cats are sleeping on the couch?"""		)
									self.assertEqual(_snake_case						,    """2"""		)




				def 							snake_case       (							self		):



									"""simple docstring"""





									_lowerCAmelCase      =   Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""		)		) / """000000039769.png"""		)
									_lowerCAmelCase      =   self.tool(image=_snake_case						,    question="""How many cats are sleeping on the couch?"""		)
									self.assertEqual(_snake_case						,    """2"""		)




				def 							snake_case       (							self		):



									"""simple docstring"""





									_lowerCAmelCase      =   Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""		)		) / """000000039769.png"""		)
									_lowerCAmelCase      =   self.remote_tool(image=_snake_case						,    question="""How many cats are sleeping on the couch?"""		)
									self.assertEqual(_snake_case						,    """2"""		)



