




'''simple docstring'''
from __future__ import annotations





def  lowerCamelCase(       SCREAMING_SNAKE_CASE_					,SCREAMING_SNAKE_CASE_    )		->		list:
			A_       		=   [None] * (len(SCREAMING_SNAKE_CASE_    ) + len(SCREAMING_SNAKE_CASE_    ))

			A_       		=   0  # pointer to current index for left Half
			A_       		=   0  # pointer to current index for the right Half
			A_       		=   0  # pointer to current index for the sorted array Half

			while pointera < len(SCREAMING_SNAKE_CASE_    ) and pointera < len(SCREAMING_SNAKE_CASE_    ):
						if left_half[pointera] < right_half[pointera]:
									A_       		=   left_half[pointera]
									pointera += 1
									index += 1
						else:
									A_       		=   right_half[pointera]
									pointera += 1
									index += 1
			while pointera < len(SCREAMING_SNAKE_CASE_    ):
						A_       		=   left_half[pointera]
						pointera += 1
						index += 1

			while pointera < len(SCREAMING_SNAKE_CASE_    ):
						A_       		=   right_half[pointera]
						pointera += 1
						index += 1

			return sorted_array





def  lowerCamelCase(       SCREAMING_SNAKE_CASE_    )		->		list:
			if len(SCREAMING_SNAKE_CASE_    ) <= 1:
						return array
			# the actual formula to calculate the middle element = left + (right - left) // 2
			# this avoids integer overflow in case of large N
			A_       		=   0 + (len(SCREAMING_SNAKE_CASE_    ) - 0) // 2

			# Split the array into halves till the array length becomes equal to One
			# merge the arrays of single length returned by mergeSort function and
			# pass them into the merge arrays function which merges the array
			A_       		=   array[:middle]
			A_       		=   array[middle:]

			return merge(merge_sort(SCREAMING_SNAKE_CASE_    )					,merge_sort(SCREAMING_SNAKE_CASE_    )    )


if __name__ == "__main__":
							import doctest

							doctest.testmod()










'''simple docstring'''
from unittest.mock import patch

import datasets
from datasets import Dataset





def  lowerCamelCase(       )		->		Any:
			A_       		=   Dataset.from_dict({'col_1': [3, 2, 0, 1]}    )

			with patch('tqdm.auto.tqdm'    ) as mock_tqdm:
						datasets.disable_progress_bar()
						dset.map(lambda SCREAMING_SNAKE_CASE_    : {"col_2": x["col_1"] + 1}    )
						mock_tqdm.assert_not_called()

						mock_tqdm.reset_mock()

						datasets.enable_progress_bar()
						dset.map(lambda SCREAMING_SNAKE_CASE_    : {"col_2": x["col_1"] + 1}    )
						mock_tqdm.assert_called()




