<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_timespan_value(s):
 """Parse a string that contains a time span, optionally with a unit like s. @return the number of seconds encoded by the string """

    number, unit = split_number_and_unit(s)
    if not unit or unit == "s":
        return number
    elif unit == "min":
        return number * 60
    elif unit == "h":
        return number * 60 * 60
    elif unit == "d":
        return number * 24 * 60 * 60
    else:
        raise ValueError('unknown unit: {} (allowed are s, min, h, and d)'.format(unit))