




import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


class 							__SCREAMING_SNAKE_CASE				(						unittest.TestCase  ,	SCREAMING_SNAKE_CASE_    ):

					def       lowercase_				(							self   ):







						'''simple docstring'''




						lowerCamelCase_				:						Union[str, Any]				  =				load_tool('document-question-answering'   )
						self.tool.setup()
						lowerCamelCase_				:						Optional[Any]				  =				load_tool('document-question-answering'					,			remote=UpperCamelCase__   )

					def       lowercase_				(							self   ):







						'''simple docstring'''




						lowerCamelCase_				:						Any				  =				load_dataset('hf-internal-testing/example-documents'					,			split='test'   )
						lowerCamelCase_				:						str				  =				dataset[0]['''image''']

						lowerCamelCase_				:						Optional[Any]				  =				self.tool(UpperCamelCase__					,			'When is the coffee break?'   )
						self.assertEqual(UpperCamelCase__					,			'11-14 to 11:39 a.m.'   )

					def       lowercase_				(							self   ):







						'''simple docstring'''




						lowerCamelCase_				:						str				  =				load_dataset('hf-internal-testing/example-documents'					,			split='test'   )
						lowerCamelCase_				:						Optional[Any]				  =				dataset[0]['''image''']

						lowerCamelCase_				:						Union[str, Any]				  =				self.remote_tool(UpperCamelCase__					,			'When is the coffee break?'   )
						self.assertEqual(UpperCamelCase__					,			'11-14 to 11:39 a.m.'   )

					def       lowercase_				(							self   ):







						'''simple docstring'''




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

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





					def       lowercase_				(							self   ):







						'''simple docstring'''




						lowerCamelCase_				:						List[Any]				  =				load_dataset('hf-internal-testing/example-documents'					,			split='test'   )
						lowerCamelCase_				:						Optional[Any]				  =				dataset[0]['''image''']

						lowerCamelCase_				:						Union[str, Any]				  =				self.remote_tool(document=UpperCamelCase__					,			question='When is the coffee break?'   )
						self.assertEqual(UpperCamelCase__					,			'11-14 to 11:39 a.m.'   )


def 					SCREAMING_SNAKE_CASE  (   __UpperCamelCase			:    Dict				,    __UpperCamelCase			:    Dict							)			->							List[Any]:

				"""simple docstring"""







				if len(str(__UpperCamelCase							)							) == 1 or len(str(__UpperCamelCase							)							) == 1:
								return a * b

				A__	:						List[str]								=				max(len(str(__UpperCamelCase							)							)				,    len(str(__UpperCamelCase							)							)							)
				A__	:						Any								=				ma // 2

				A__							,				A__	:						Union[str, Any]								=				divmod(__UpperCamelCase				,    10**ma							)
				A__							,				A__	:						Tuple								=				divmod(__UpperCamelCase				,    10**ma							)

				A__	:						Optional[int]								=				karatsuba(__UpperCamelCase				,    __UpperCamelCase							)
				A__	:						Tuple								=				karatsuba((aa + aa)				,    (ba + ba)							)
				A__	:						Optional[int]								=				karatsuba(__UpperCamelCase				,    __UpperCamelCase							)

				return (z * 10 ** (2 * ma)) + ((y - z - x) * 10 ** (ma)) + (x)

def 					SCREAMING_SNAKE_CASE  (   )			->							Dict:

				"""simple docstring"""







				print(karatsuba(1_54_63				,    2_34_89							)							)


if __name__ == "__main__":
					main()