<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def phase_correct_zero(spec, phi):
 """ Correct the phases of a spectrum by phi radians Parameters spec : float array of complex dtype The spectrum to be corrected. phi : float Returns ------- spec : float array The phase corrected spectrum Notes ----- [Keeler2005] Keeler, J (2005). Understanding NMR Spectroscopy, 2nd edition. Wiley. Page 88. """

    c_factor = np.exp(-1j * phi)
    # If it's an array, we need to reshape it and broadcast across the
    # frequency bands in the spectrum. Otherwise, we assume it's a scalar and
    # apply it to all the dimensions of the spec array:
    if hasattr(phi, 'shape'):
        c_factor = c_factor.reshape(c_factor.shape + (1,))

    return spec * c_factor