def parse_value(value, base_value=0):
    """Parse a numeric value spec which is one of:

        NNN    integer
        NN.MMM float
        NN%    proportional to base_value
    """
    if not isinstance(value, str):
        return value
    if value[-1] == '%':
        value = base_value * float(value[:-1]) / 100
    elif '.' in value:
        return float(value)
    return int(value)