<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shelld(ndim, array):
 # Works!, use this as example for "I/O" parameters """ Sort a double precision array using the Shell Sort algorithm. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/shelld_c.html :param ndim: Dimension of the array. :type ndim: int :param array: The array to be sorted. :type array: Array of floats :return: The sorted array. :rtype: Array of floats """

    array = stypes.toDoubleVector(array)
    ndim = ctypes.c_int(ndim)
    libspice.shelld_c(ndim, ctypes.cast(array, ctypes.POINTER(ctypes.c_double)))
    return stypes.cVectorToPython(array)