def parse_time_unit(time_unit):
    if isinstance(time_unit, (int, float)):
        return time_unit
    elif (isinstance(time_unit, str) and (time_unit in time_units)):
        return time_units[time_unit]
    elif isinstance(time_unit, str):
        raise ValueError('Invalid time_unit reference!')
    else:
        raise TypeError('Invalid type for time_unit')
def parse_time_unit(time_unit):
    if isinstance(time_unit, (int, float)):
        return time_unit
    elif (isinstance(time_unit, str) and (time_unit in time_units)):
        return time_units[time_unit]
    elif isinstance(time_unit, str):
        raise ValueError('Invalid time_unit reference!')
    else:
        raise TypeError('Invalid type for time_unit')