




'''simple docstring'''


from __future__ import annotations

import random

class 			A    :
							lowercase_							=				6







							def __init__(  self       :  Dict					)			->							int:


														"""simple docstring"""


														_a	     =				list(range(1							,			Dice.NUM_SIDES + 1					)					)







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


														"""simple docstring"""


														return random.choice(self.sides					)



def 		snake_case_    (UpperCamelCase       :  int ,						UpperCamelCase       :  int = 2      ):





							'''simple docstring'''


							_a	     =				[Dice() for i in range(UpperCamelCase      )]
							_a	     =				[0] * (len(UpperCamelCase      ) * Dice.NUM_SIDES + 1)
							for _ in range(UpperCamelCase      ):
														count_of_sum[sum(dice.roll() for dice in dices      )] += 1
							_a	     =				[round((count * 100) / num_throws ,						2      ) for count in count_of_sum]
							return probability[num_dice:]  # remove probability of sums that never appear


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'''					)

