code: 
  
  
  
  
  """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 			UpperCAmelCase_						(		unittest.TestCase,     A_							):
  
  
  
  
      def 							__magic_name__							(					self		: Tuple   )   ->							Any:
  
  
  
  
       '''simple docstring'''
  
       A__ =       load_tool("image-captioning"   )
       self.tool.setup()
       A__ =       load_tool("image-captioning"			,				remote=snake_case_   )
  
  
  
  
      def 							__magic_name__							(					self		: str   )   ->							int:
  
  
  
  
       '''simple docstring'''
  
       A__ =       Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
       A__ =       self.tool(snake_case_   )
       self.assertEqual(snake_case_			,				"two cats sleeping on a couch"   )
  
  
  
  
      def 							__magic_name__							(					self		: Any   )   ->							List[str]:
  
  
  
  
       '''simple docstring'''
  
       A__ =       Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
       A__ =       self.remote_tool(snake_case_   )
       self.assertEqual(snake_case_			,				"two cats sleeping on a couch"   )
  
  
  
  
      def 							__magic_name__							(					self		: Dict   )   ->							str:
  
  
  
  
       '''simple docstring'''
  
       A__ =       Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
       A__ =       self.tool(image=snake_case_   )
       self.assertEqual(snake_case_			,				"two cats sleeping on a couch"   )
  
  
  
  
      def 							__magic_name__							(					self		: Tuple   )   ->							Optional[Any]:
  
  
  
  
       '''simple docstring'''
  
       A__ =       Image.open(Path(get_tests_dir("fixtures/tests_samples/COCO"   )   ) / "000000039769.png"   )
       A__ =       self.remote_tool(image=snake_case_   )
       self.assertEqual(snake_case_			,				"two cats sleeping on a couch"   )
  
  
  
  
  
  
style_context: 
  
  
  
  
  """simple docstring"""
  
  
  
  from transformers import PretrainedConfig
  
  
  
  
  class 			UpperCAmelCase_						(		A_							):
      lowercase__		      =   '''custom'''
  
  
  
  
      def __init__(					self		: Any			,				snake_case_		: List[Any]=1			,				**snake_case_		: Any   )   ->							str:
  
  
  
  
       '''simple docstring'''
  
       A__ =       attribute
       super().__init__(**snake_case_   )
  
  
  
  
  
  
  class 			UpperCAmelCase_						(		A_							):
      lowercase__		      =   '''custom'''
  
  
  
  
      def __init__(					self		: Any			,				snake_case_		: Tuple=1			,				**snake_case_		: Dict   )   ->							Any:
  
  
  
  
       '''simple docstring'''
  
       A__ =       attribute
  
  
  
  
  
  