<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cold_spell_days(tas, thresh='-10 degC', window=5, freq='AS-JUL'):
 r"""Cold spell days The number of days that are part of a cold spell, defined as five or more consecutive days with mean daily temperature below a threshold in °C. Parameters tas : xarrray.DataArray Mean daily temperature [℃] or [K] thresh : str Threshold temperature below which a cold spell begins [℃] or [K]. Default : '-10 degC' window : int Minimum number of days with temperature below threshold to qualify as a cold spell. freq : str, optional Resampling frequency Returns ------- xarray.DataArray Cold spell days. Notes ----- Let :math:`T_i` be the mean daily temperature on day :math:`i`, the number of cold spell days during period :math:`\phi` is given by .. math:: \sum_{i \in \phi} \prod_{j=i}^{i+5} [T_j < thresh] where :math:`[P]` is 1 if :math:`P` is true, and 0 if false. """

    t = utils.convert_units_to(thresh, tas)
    over = tas < t
    group = over.resample(time=freq)

    return group.apply(rl.windowed_run_count, window=window, dim='time')