def number(s):
    s = s.strip()
    s = s.lower()
    # Negative number.
    if s.startswith(MINUS):
        return -number(s.replace(MINUS, "", 1))
    # Strip commas and dashes ("seventy-five").
    # Split into integral and fractional part.
    s = s.replace("&", " %s " % CONJUNCTION)
    s = s.replace(THOUSANDS, "")
    s = s.replace("-", " ")
    s = s.split(RADIX)
    # Process fractional part.
    # Extract all the leading zeros.
    if len(s) > 1:
        f = " ".join(s[1:])      # zero point zero twelve => zero twelve
        f, z = zshift(f)              # zero twelve => (1, "twelve")
        f = float(number(f))          # "twelve" => 12.0
        f /= 10**(len(str(int(f)))+z) # 10**(len("12")+1) = 1000; 12.0 / 1000 => 0.012
    else:
        f = 0
    i = n = 0
    s = s[0].split()
    for j, x in enumerate(s):
        if x in NUMERALS:
            # Map words from the dictionary of numerals: "eleven" => 11.
            i += NUMERALS[x]
        elif x in NUMERALS_VERBOSE:
            # Map words from alternate numerals: "two dozen" => 2 * 12
            i = i * NUMERALS_VERBOSE[x][0] + NUMERALS_VERBOSE[x][1]
        elif x in O: 
            # Map thousands from the dictionary of orders.
            # When a thousand is encountered, the subtotal is shifted to the total
            # and we start a new subtotal. An exception to this is when we
            # encouter two following thousands (e.g. two million vigintillion is one subtotal).
            i *= O[x]
            if j < len(s)-1 and s[j+1] in O: 
                continue
            if O[x] > 100: 
                n += i
                i = 0
        elif x == CONJUNCTION:
            pass
        else:
            # Words that are not in any dicionary may be numbers (e.g. "2.5" => 2.5).
            try: i += "." in x and float(x) or int(x)
            except:
                pass
    return n + i + f

#print number("five point two septillion")
#print number("seventy-five point two")
#print number("three thousand and one")
#print number("1.2 million point two")
#print number("nothing")

#--- NUMBER TO STRING ------------------------------------------------------------------------------
Matched access is not associated with a user.
dataset/ETHPy150Open clips/pattern/pattern/text/en/inflect_quantify.py/number--crossover with--dataset/ETHPy150Open mlavin/django-all-access/allaccess/tests/test_backends.py/AuthBackendTestCase.test_match_no_user