





import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin





class 	lowerCAmelCase__(       unittest.TestCase     ,   __lowercase			):






       '''simple docstring'''


       def 			UpperCamelCase_	(					self							)	->   Tuple:
            _SCREAMING_SNAKE_CASE				:		Optional[int]  			=							load_tool("document-question-answering"							)
            self.tool.setup()
            _SCREAMING_SNAKE_CASE				:		Dict  			=							load_tool("document-question-answering"			,  remote=__lowerCamelCase							)




       def 			UpperCamelCase_	(					self							)	->   Any:
            _SCREAMING_SNAKE_CASE				:		List[Any]  			=							load_dataset("hf-internal-testing/example-documents"			,  split="test"							)
            _SCREAMING_SNAKE_CASE				:		Optional[int]  			=							dataset[0]["image"]

            _SCREAMING_SNAKE_CASE				:		Tuple  			=							self.tool(__lowerCamelCase			,  "When is the coffee break?"							)
            self.assertEqual(__lowerCamelCase			,  "11-14 to 11:39 a.m."							)




       def 			UpperCamelCase_	(					self							)	->   Any:
            _SCREAMING_SNAKE_CASE				:		Optional[int]  			=							load_dataset("hf-internal-testing/example-documents"			,  split="test"							)
            _SCREAMING_SNAKE_CASE				:		List[Any]  			=							dataset[0]["image"]

            _SCREAMING_SNAKE_CASE				:		Tuple  			=							self.remote_tool(__lowerCamelCase			,  "When is the coffee break?"							)
            self.assertEqual(__lowerCamelCase			,  "11-14 to 11:39 a.m."							)




       def 			UpperCamelCase_	(					self							)	->   Dict:
            _SCREAMING_SNAKE_CASE				:		Optional[Any]  			=							load_dataset("hf-internal-testing/example-documents"			,  split="test"							)
            _SCREAMING_SNAKE_CASE				:		List[Any]  			=							dataset[0]["image"]

            self.tool(document=__lowerCamelCase			,  question="When is the coffee break?"							)







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

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






import sys

sys.set_int_max_str_digits(0)  # type: ignore






def 			lowerCamelCase__	(__lowerCamelCase		):
     _SCREAMING_SNAKE_CASE				:		int  			=							[0] * 11
     _SCREAMING_SNAKE_CASE				:		Optional[Any]  			=							[0] * 11

     # mark last 9 numbers
     for _ in range(9		):
          _SCREAMING_SNAKE_CASE				:		Optional[Any]  			=							1
          _SCREAMING_SNAKE_CASE				:		str  			=							number // 10
     # flag
     _SCREAMING_SNAKE_CASE				:		int  			=							True

     # check last 9 numbers for pandigitality

     for x in range(9		):
          if not check_last[x + 1]:
               _SCREAMING_SNAKE_CASE				:		Any  			=							False
     if not f:
          return f

     # mark first 9 numbers
     _SCREAMING_SNAKE_CASE				:		str  			=							int(str(__lowerCamelCase		)[:9]		)

     for _ in range(9		):
          _SCREAMING_SNAKE_CASE				:		str  			=							1
          _SCREAMING_SNAKE_CASE				:		List[Any]  			=							number // 10

     # check first 9 numbers for pandigitality

     for x in range(9		):
          if not check_front[x + 1]:
               _SCREAMING_SNAKE_CASE				:		Any  			=							False
     return f






def 			lowerCamelCase__	(__lowerCamelCase		):
     _SCREAMING_SNAKE_CASE				:		List[str]  			=							[0] * 11

     # mark last 9 numbers
     for _ in range(9		):
          _SCREAMING_SNAKE_CASE				:		Dict  			=							1
          _SCREAMING_SNAKE_CASE				:		List[str]  			=							number // 10
     # flag
     _SCREAMING_SNAKE_CASE				:		List[Any]  			=							True

     # check last 9 numbers for pandigitality

     for x in range(9		):
          if not check_last[x + 1]:
               _SCREAMING_SNAKE_CASE				:		str  			=							False
     return f






def 			lowerCamelCase__	():
     _SCREAMING_SNAKE_CASE				:		Dict  			=							1
     _SCREAMING_SNAKE_CASE				:		Union[str, Any]  			=							1
     _SCREAMING_SNAKE_CASE				:		List[str]  			=							2
     # temporary Fibonacci numbers

     _SCREAMING_SNAKE_CASE				:		Any  			=							1
     _SCREAMING_SNAKE_CASE				:		List[str]  			=							1
     _SCREAMING_SNAKE_CASE				:		str  			=							2
     # temporary Fibonacci numbers mod 1e9

     # mod m=1e9, done for fast optimisation
     _SCREAMING_SNAKE_CASE				:		Optional[Any]  			=							[0] * 1000000
     _SCREAMING_SNAKE_CASE				:		Optional[int]  			=							1000000000

     for x in range(1000000		):
          _SCREAMING_SNAKE_CASE				:		Union[str, Any]  			=							(aa + ba) % m
          _SCREAMING_SNAKE_CASE				:		int  			=							ba % m
          _SCREAMING_SNAKE_CASE				:		List[str]  			=							ca % m
          if checka(__lowerCamelCase		):
               _SCREAMING_SNAKE_CASE				:		List[Any]  			=							1

     for x in range(1000000		):
          _SCREAMING_SNAKE_CASE				:		Any  			=							a + b
          _SCREAMING_SNAKE_CASE				:		Dict  			=							b
          _SCREAMING_SNAKE_CASE				:		int  			=							c
          # perform check only if in tocheck
          if tocheck[x + 3] and check(__lowerCamelCase		):
               return x + 3  # first 2 already done
     return -1


if __name__ == "__main__":
       print(f"{solution() = }")