def _clean_alignment(row, decomp):
    """
    Cleaning function for a pd.DataFrame to return the number
    of components used in the decomposition.
    Parameters
    ----------
    alignment : pd.Series
        A pd.Series object denoting the used alignment stimuli.
        Must contain the substring provided in `decomp`
    decomp : str
        Must be a str in ['pca', 'srm']
    """
    try:
        decomp_n_comps, stim = row['alignment'].split(sep=' of ')
        n_comps = decomp_n_comps[len(decomp):]
    except ValueError:  # Too many values to unpack
        n_comps, stim = 'Full', row['alignment']

    return {'n_comps': n_comps, 'stim': stim}