






def   a      (						lowerCamelCase_    ):






				'''simple docstring'''
				if len(lowerCamelCase_    ) > 1:
								lowercase__       			=      len(lowerCamelCase_    ) // 2  # Finds the middle of the array
								lowercase__       			=      arr[
								    :middle_length
								]  # Creates an array of the elements in the first half.
								lowercase__       			=      arr[
								    middle_length:
								]  # Creates an array of the elements in the second half.
								lowercase__       			=      len(lowerCamelCase_    )
								lowercase__       			=      len(lowerCamelCase_    )
								merge(lowerCamelCase_    )  # Starts sorting the left.
								merge(lowerCamelCase_    )  # Starts sorting the right
								lowercase__       			=      0  # Left Counter
								lowercase__       			=      0  # Right Counter
								lowercase__       			=      0  # Position Counter
								while (
								    left_index < left_size and right_index < right_size
								):  # Runs until the lowers size of the left and right are sorted.
												if left_array[left_index] < right_array[right_index]:
																lowercase__       			=      left_array[left_index]
																left_index += 1
												else:
																lowercase__       			=      right_array[right_index]
																right_index += 1
												index += 1
								while (
								    left_index < left_size
								):  # Adds the left over elements in the left half of the array
												lowercase__       			=      left_array[left_index]
												left_index += 1
												index += 1
								while (
								    right_index < right_size
								):  # Adds the left over elements in the right half of the array
												lowercase__       			=      right_array[right_index]
												right_index += 1
												index += 1
				return arr


if __name__ == "__main__":
							import doctest

							doctest.testmod()












import unittest

from datasets import load_dataset

from transformers import load_tool

from .test_tools_common import ToolTesterMixin
class 				_UpperCAmelCase (	unittest.TestCase		,A__     ):

				"""simple docstring"""




				def     lowercase__       (					self						:   str  ):

								'''simple docstring'''
								lowercase__       			=      load_tool('''document-question-answering'''  )
								self.tool.setup()
								lowercase__       			=      load_tool('''document-question-answering''',  remote=lowerCamelCase  )




				def     lowercase__       (					self						:   List[Any]  ):

								'''simple docstring'''
								lowercase__       			=      load_dataset('''hf-internal-testing/example-documents''',  split='''test'''  )
								lowercase__       			=      dataset[0]['''image''']

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




				def     lowercase__       (					self						:   Optional[Any]  ):

								'''simple docstring'''
								lowercase__       			=      load_dataset('''hf-internal-testing/example-documents''',  split='''test'''  )
								lowercase__       			=      dataset[0]['''image''']

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




				def     lowercase__       (					self						:   Any  ):

								'''simple docstring'''
								lowercase__       			=      load_dataset('''hf-internal-testing/example-documents''',  split='''test'''  )
								lowercase__       			=      dataset[0]['''image''']

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




				def     lowercase__       (					self						:   Tuple  ):

								'''simple docstring'''
								lowercase__       			=      load_dataset('''hf-internal-testing/example-documents''',  split='''test'''  )
								lowercase__       			=      dataset[0]['''image''']

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




