def get_typed_tag_value(v):
    """Uses some simple rules to extract simple typed values from strings.
        Specifically:
           true and t (any case) return True (boolean)
           false and f (any case) return False (boolean)
           simple integers (possibly signed) are returned as ints
           simple floats (possibly signed) are returned as floats
                (supports '.' and ',' as floating-point separator,
                 subject to locale)
           Everything else is returned as a string, with matched
                enclosing quotes stripped.
    """
    if v.lower() in (u'true', u't'):
        return True
    elif v.lower() in (u'false', u'f'):
        return False
    elif re.match(INTEGER_RE, v):
        return int(v)
    elif re.match(DECIMAL_RE, v) or re.match(DECIMAL_RE2, v):
        try:
            r = float(v)
        except __HOLE__:
            return toStr(v)
        return r
    elif len(v) > 1 and v[0] == v[-1] and v[0] in (u'"\''):
        return v[1:-1]
    elif len(v) > 1 and ((v[0] == u'[' and v[-1] == ']') or 
                         (v[0] == u'{' and v[-1] == '}')):
         return cline.CScanSplit(v[1:-1], ' \t,', quotes='"\'').words
    else:
        return toStr(v)
dataset/ETHPy150Open njr0/fish/fish/fishlib.py/get_typed_tag_value