<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_ratio(df, label="", with_multiplicity=False):
 """ Filter to include only the Ratio values with optional specified label, excluding other Intensity measurements, but retaining all other columns. """

    label += ".*__\d" if with_multiplicity else ""

    dft = df.filter(regex="^(?!Ratio).*$")
    dfr = df.filter(regex='^(.*Ratio.*%s)$' % label)

    return pd.concat([dft,dfr], axis=1)