<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_inert_ratio_prnc(cont):
 """Compute principal inertia ratio of a contour The principal inertia ratio is rotation-invariant, which makes it applicable to reservoir measurements where e.g. cells are not aligned with the channel. Parameters cont: ndarray or list of ndarrays of shape (N,2) A 2D array that holds the contour of an event (in pixels) e.g. obtained using `mm.contour` where `mm` is an instance of `RTDCBase`. The first and second columns of `cont` correspond to the x- and y-coordinates of the contour. Returns ------- inert_ratio_prnc: float or ndarray of size N The principal inertia ratio of the contour """

    if isinstance(cont, np.ndarray):
        # If cont is an array, it is not a list of contours,
        # because contours can have different lengths.
        cont = [cont]
        ret_list = False
    else:
        ret_list = True

    length = len(cont)

    inert_ratio_prnc = np.zeros(length, dtype=float) * np.nan

    for ii in range(length):
        moments = cont_moments_cv(cont[ii])
        if moments is not None:
            # orientation of the contour
            orient = 0.5 * np.arctan2(2 * moments['mu11'],
                                      moments['mu02'] - moments['mu20'])
            # require floating point array (only copy if necessary)
            cc = np.array(cont[ii], dtype=float, copy=False)
            # rotate contour
            rho = np.sqrt(cc[:, 0]**2 + cc[:, 1]**2)
            phi = np.arctan2(cc[:, 1], cc[:, 0]) + orient + np.pi / 2
            cc[:, 0] = rho * np.cos(phi)
            cc[:, 1] = rho * np.sin(phi)
            # compute inertia ratio of rotated contour
            mprnc = cont_moments_cv(cc)
            inert_ratio_prnc[ii] = np.sqrt(mprnc["mu20"] / mprnc["mu02"])

    if not ret_list:
        inert_ratio_prnc = inert_ratio_prnc[0]

    return inert_ratio_prnc