Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

src/p/y/pylearn2-HEAD/pylearn2/utils/tests/test_string_utils.py   pylearn2(Download)
from pylearn2.utils.string_utils import find_number
from pylearn2.utils.string_utils import preprocess
from pylearn2.utils.string_utils import tokenize_by_number
from pylearn2.utils.string_utils import number_aware_alphabetical_key
 
def test_tokenize_0():
    s = ' 123 klsdgh 56.7?98.2---\%-1e3'
    true_tokens = [' ',123,' klsdgh ',56.7,'?',98.2,'---\%',-1e3]
    tokens = tokenize_by_number(s)
    assert token_lists_nearly_match(tokens, true_tokens)