




'''simple docstring'''


def 		snake_case_    (UpperCamelCase       :  int      ):





							'''simple docstring'''


							if not isinstance(UpperCamelCase ,						UpperCamelCase      ):
														raise ValueError('''double_factorial() only accepts integral values'''      )
							if n < 0:
														raise ValueError('''double_factorial() not defined for negative values'''      )
							return 1 if n <= 1 else n * double_factorial(n - 2      )


if __name__ == "__main__":
				import doctest

				doctest.testmod()







'''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    __lowerCAmelCase			(  self       :  Optional[int]					)			->							Optional[int]:


														"""simple docstring"""


														_a	     =				load_tool('''image-question-answering'''					)
														self.tool.setup()
														_a	     =				load_tool('''image-question-answering'''							,			remote=lowerCAmelCase_					)







							def    __lowerCAmelCase			(  self       :  Tuple					)			->							Optional[int]:


														"""simple docstring"""


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







							def    __lowerCAmelCase			(  self       :  List[str]					)			->							Union[str, Any]:


														"""simple docstring"""


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







							def    __lowerCAmelCase			(  self       :  Dict					)			->							Tuple:


														"""simple docstring"""


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







							def    __lowerCAmelCase			(  self       :  Tuple					)			->							Dict:


														"""simple docstring"""


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

