





"""simple docstring"""





from __future__ import annotations


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						list							,						SCREAMING_SNAKE_CASE					:						list      ) ->    Dict:







      '''simple docstring'''




      lowerCAmelCase  						=	[None] * (len(SCREAMING_SNAKE_CASE      ) + len(SCREAMING_SNAKE_CASE      ))

      lowerCAmelCase  						=	0  # pointer to current index for left Half
      lowerCAmelCase  						=	0  # pointer to current index for the right Half
      lowerCAmelCase  						=	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]:
                  lowerCAmelCase  						=	left_half[pointera]
                  pointera += 1
                  index += 1
            else:
                  lowerCAmelCase  						=	right_half[pointera]
                  pointera += 1
                  index += 1
      while pointera < len(SCREAMING_SNAKE_CASE      ):
            lowerCAmelCase  						=	left_half[pointera]
            pointera += 1
            index += 1

      while pointera < len(SCREAMING_SNAKE_CASE      ):
            lowerCAmelCase  						=	right_half[pointera]
            pointera += 1
            index += 1

      return sorted_array


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						list      ) ->    List[str]:







      '''simple docstring'''




      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
      lowerCAmelCase  						=	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
      lowerCAmelCase  						=	array[:middle]
      lowerCAmelCase  						=	array[middle:]

      return merge(merge_sort(SCREAMING_SNAKE_CASE      )							,						merge_sort(SCREAMING_SNAKE_CASE      )      )


if __name__ == "__main__":
       import doctest

       doctest.testmod()













"""simple docstring"""





from scipy.constants import g


def       UpperCAmelCase__							(  SCREAMING_SNAKE_CASE					:						float							,						SCREAMING_SNAKE_CASE					:						float      ):







      '''simple docstring'''




      if mass < 0:
            # handling of negative values of mass
            raise ValueError("""The mass of a body cannot be negative"""      )
      if height < 0:
            # handling of negative values of height
            raise ValueError("""The height above the ground cannot be negative"""      )
      return mass * g * height


if __name__ == "__main__":
       from doctest import testmod

       testmod(name="potential_energy")






