<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_pv(header):
 """ Parses the PV array from an astropy FITS header. Args: header: astropy.io.fits.header.Header The header containing the PV values. Returns: cd: 2d array (list(list(float)) Note that N depends on the order of the fit. For example, an order 3 fit goes up to PV?_10. """

    order_fit = parse_order_fit(header)

    def parse_with_base(i):
        key_base = "PV%d_" % i

        pvi_x = [header[key_base + "0"]]

        def parse_range(lower, upper):
            for j in range(lower, upper + 1):
                pvi_x.append(header[key_base + str(j)])

        if order_fit >= 1:
            parse_range(1, 3)

        if order_fit >= 2:
            parse_range(4, 6)

        if order_fit >= 3:
            parse_range(7, 10)

        return pvi_x

    return [parse_with_base(1), parse_with_base(2)]