

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






  def        SCREAMING_SNAKE_CASE    (			self :    List[str]    )							->	List[Any]:






     """simple docstring"""







     __lowerCAmelCase  :			Tuple					    =						load_tool("""image-captioning"""    )
     self.tool.setup()
     __lowerCAmelCase  :			Union[str, Any]					    =						load_tool("""image-captioning"""       ,							remote=lowerCAmelCase    )







  def        SCREAMING_SNAKE_CASE    (			self :    int    )							->	int:






     """simple docstring"""







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







  def        SCREAMING_SNAKE_CASE    (			self :    Tuple    )							->	Tuple:






     """simple docstring"""







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







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






     """simple docstring"""







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







  def        SCREAMING_SNAKE_CASE    (			self :    List[str]    )							->	Any:






     """simple docstring"""







     __lowerCAmelCase  :			int					    =						Image.open(Path(get_tests_dir("""fixtures/tests_samples/COCO"""    )    ) / """000000039769.png"""    )
     __lowerCAmelCase  :			Dict					    =						self.remote_tool(image=lowerCAmelCase    )
     self.assertEqual(lowerCAmelCase       ,							"""two cats sleeping on a couch"""    )





from math import sqrt





def 	snake_case_      (__A     :						int     )			->	list[int]:
   __lowerCAmelCase  :			List[str]					    =						[1]
   for i in range(2					,   int(sqrt(__A     )     ) + 1					,   1     ):
      if number % i == 0:
         values.append(__A     )
         if int(number // i     ) != i:
            values.append(int(number // i     )     )
   return sorted(__A     )





def 	snake_case_      (__A     :						int     )			->	bool:
   return sum(factors(__A     )     ) > n





def 	snake_case_      (__A     :						int     )			->	bool:
   __lowerCAmelCase  :			Any					    =						factors(__A     )
   __lowerCAmelCase  :			Union[str, Any]					    =						len(__A     )
   __lowerCAmelCase  :			str					    =						[[0 for i in range(number + 1     )] for j in range(r + 1     )]
   for i in range(r + 1     ):
      __lowerCAmelCase  :			Tuple					    =						True

   for i in range(1					,   number + 1     ):
      __lowerCAmelCase  :			List[str]					    =						False

   for i in range(1					,   r + 1     ):
      for j in range(1					,   number + 1     ):
         if j < values[i - 1]:
            __lowerCAmelCase  :			Dict					    =						subset[i - 1][j]
         else:
            __lowerCAmelCase  :			Dict					    =						subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

   return subset[r][number] != 0





def 	snake_case_      (__A     :						int     )			->	bool:
   return abundant(__A     ) and not semi_perfect(__A     )


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   for number in (69, 70, 71):
      print(F'{number} is {"" if weird(number) else "not "}weird.')


