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

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

        def start(tokens=('',)):
    n = the_order()
    tokens = tokens[-n:]
    lt = len(tokens)
    if lt == n:
        return tokens
    candidates = [state
                  for state in ngrams.iterkeys()
                  if state[:lt] == tokens]
    assert candidates
    return random.choice(candidates)
        


src/l/a/languagetoys-HEAD/verse.py   languagetoys(Download)
def start():
    return babble.start(start_state)
 
def print_verse(verse):
    print
        antirhymes = [linerhymes[j] for j in antirhymescheme[i]]
        if i == 1:  # XXX hacky
            state_i = babble.start(state_i)
            m = match_words(tuple(t for t in state_i if t != '<S>'),
                            meters[i])