def parse(s):
    """
    """
    if not isinstance(s, basestring):
        raise Exception("Expected a string, got %r" % s)
    if ':' in s:
        return Duration(s)
    # if '/' in s:
    #     return Fraction(s)
    if s.endswith('%'):
        return Percentage(s)
    return parse_decimal(s)
dataset/ETHPy150Open lsaffre/lino/lino/utils/quantities.py/parse/original