

def 				__a							(       __A						):
    if len(A__						) > 1:
        SCREAMING_SNAKE_CASE__         =    len(A__						) // 2  # Finds the middle of the array
        SCREAMING_SNAKE_CASE__         =    arr[
            :middle_length
        ]  # Creates an array of the elements in the first half.
        SCREAMING_SNAKE_CASE__         =    arr[
            middle_length:
        ]  # Creates an array of the elements in the second half.
        SCREAMING_SNAKE_CASE__         =    len(A__						)
        SCREAMING_SNAKE_CASE__         =    len(A__						)
        merge(A__						)  # Starts sorting the left.
        merge(A__						)  # Starts sorting the right
        SCREAMING_SNAKE_CASE__         =    0  # Left Counter
        SCREAMING_SNAKE_CASE__         =    0  # Right Counter
        SCREAMING_SNAKE_CASE__         =    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]:
                SCREAMING_SNAKE_CASE__         =    left_array[left_index]
                left_index += 1
            else:
                SCREAMING_SNAKE_CASE__         =    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
            SCREAMING_SNAKE_CASE__         =    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
            SCREAMING_SNAKE_CASE__         =    right_array[right_index]
            right_index += 1
            index += 1
    return arr


if __name__ == "__main__":
  import doctest

  doctest.testmod()



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowerCAmelCase__	:  int						=  {
    '''configuration_deta''': ['''DETA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DetaConfig'''],
}

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowerCAmelCase__	:  Union[str, Any]						=  ['''DetaImageProcessor''']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowerCAmelCase__	:  Optional[int]						=  [
				    '''DETA_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''DetaForObjectDetection''',
				    '''DetaModel''',
				    '''DetaPreTrainedModel''',
				]


if TYPE_CHECKING:
				from .configuration_deta import DETA_PRETRAINED_CONFIG_ARCHIVE_MAP, DetaConfig

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .image_processing_deta import DetaImageProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_deta import (
								    DETA_PRETRAINED_MODEL_ARCHIVE_LIST,
								    DetaForObjectDetection,
								    DetaModel,
								    DetaPreTrainedModel,
								)

else:
				import sys

				lowerCAmelCase__	:  int						=  _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)


