




"""simple docstring"""

from ..utils import DummyObject, requires_backends

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       Tuple   ,  *_lowerCamelCase :       Tuple   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     int								= ["""tokenizers"""]







				def __init__(				self :       Any   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       str							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Any								= ["""tokenizers"""]







				def __init__(				self :       int   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       int   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[Any]								= ["""tokenizers"""]







				def __init__(				self :       Tuple   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       List[Any]   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Dict								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       Any   ,  *_lowerCamelCase :       Tuple   ,  **_lowerCamelCase :       List[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     int								= ["""tokenizers"""]







				def __init__(				self :       Optional[int]   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[str]								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       List[Any]   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Any								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       Tuple   ,  **_lowerCamelCase :       List[str]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       Optional[int]   ,  *_lowerCamelCase :       Dict   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     int								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[Any]								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Dict								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[Any]								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       Dict   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       List[Any]   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       List[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[str]								= ["""tokenizers"""]







				def __init__(				self :       List[str]   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       List[str]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Any								= ["""tokenizers"""]







				def __init__(				self :       Any   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       List[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     str								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[str]								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       Optional[int]   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       List[str]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       int   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     str								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[str]								= ["""tokenizers"""]







				def __init__(				self :       int   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Dict								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       Tuple   ,  **_lowerCamelCase :       Tuple							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       int							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Tuple							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     int								= ["""tokenizers"""]







				def __init__(				self :       int   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[str]								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       Optional[Any]   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       List[Any]   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       int   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Dict							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       List[str]   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[int]								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       int   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       List[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       str   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     str								= ["""tokenizers"""]







				def __init__(				self :       Dict   ,  *_lowerCamelCase :       List[Any]   ,  **_lowerCamelCase :       Optional[int]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       Tuple   ,  **_lowerCamelCase :       Tuple							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       List[str]   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       int							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Optional[Any]								= ["""tokenizers"""]







				def __init__(				self :       Tuple   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       int							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     str								= ["""tokenizers"""]







				def __init__(				self :       Any   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       int							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[Any]								= ["""tokenizers"""]







				def __init__(				self :       List[str]   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[str]								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       Optional[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       Optional[Any]   ,  *_lowerCamelCase :       Union[str, Any]   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     List[Any]								= ["""tokenizers"""]







				def __init__(				self :       Tuple   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       List[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     str								= ["""tokenizers"""]







				def __init__(				self :       List[Any]   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       List[str]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       Union[str, Any]   ,  *_lowerCamelCase :       Dict   ,  **_lowerCamelCase :       Any							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Any								= ["""tokenizers"""]







				def __init__(				self :       Optional[int]   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       Union[str, Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Tuple								= ["""tokenizers"""]







				def __init__(				self :       Optional[int]   ,  *_lowerCamelCase :       Any   ,  **_lowerCamelCase :       int							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     Union[str, Any]								= ["""tokenizers"""]







				def __init__(				self :       List[Any]   ,  *_lowerCamelCase :       Optional[int]   ,  **_lowerCamelCase :       List[Any]							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)

class 							lowercase   (     metaclass=_SCREAMING_SNAKE_CASE):
				__lowerCAmelCase     :     int								= ["""tokenizers"""]







				def __init__(				self :       str   ,  *_lowerCamelCase :       List[str]   ,  **_lowerCamelCase :       str							):



					"""simple docstring"""

					requires_backends(self   ,  ['''tokenizers''']							)









"""simple docstring"""







import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin






class  __A							(			unittest.TestCase,       _SCREAMING_SNAKE_CASE     ):






 """simple docstring"""




 def  SCREAMING_SNAKE_CASE				(						self		)   ->	str:
     a											=load_tool('''document-question-answering'''		)
     self.tool.setup()
     a											=load_tool('''document-question-answering'''					,       remote=__A		)


 def  SCREAMING_SNAKE_CASE				(						self		)   ->	Optional[Any]:
     a											=load_dataset('''hf-internal-testing/example-documents'''					,       split='''test'''		)
     a											=dataset[0]['''image''']

     a											=self.tool(__A					,       '''When is the coffee break?'''		)
     self.assertEqual(__A					,       '''11-14 to 11:39 a.m.'''		)


 def  SCREAMING_SNAKE_CASE				(						self		)   ->	Optional[int]:
     a											=load_dataset('''hf-internal-testing/example-documents'''					,       split='''test'''		)
     a											=dataset[0]['''image''']

     a											=self.remote_tool(__A					,       '''When is the coffee break?'''		)
     self.assertEqual(__A					,       '''11-14 to 11:39 a.m.'''		)


 def  SCREAMING_SNAKE_CASE				(						self		)   ->	Union[str, Any]:
     a											=load_dataset('''hf-internal-testing/example-documents'''					,       split='''test'''		)
     a											=dataset[0]['''image''']

     self.tool(document=__A					,       question='''When is the coffee break?'''		)





 def  SCREAMING_SNAKE_CASE				(						self		)   ->	Optional[int]:
     a											=load_dataset('''hf-internal-testing/example-documents'''					,       split='''test'''		)
     a											=dataset[0]['''image''']

     a											=self.remote_tool(document=__A					,       question='''When is the coffee break?'''		)
     self.assertEqual(__A					,       '''11-14 to 11:39 a.m.'''		)