def METHOD_NAME(l_arr):
    """Sort contours by area largest to smallest."""
    length = len(l_arr)
    if length <= 1:
        return l_arr
    else:
        pivot = l_arr.pop(int(length / 2))
        less, more = [], []
        for x in l_arr:
            if cv2.contourArea(x) >= cv2.contourArea(pivot):
                less.append(x)
            else:
                more.append(x)
        return [*METHOD_NAME(less), pivot, *METHOD_NAME(more)]