Get an iterable of all final words in all stanzas
776656
def get_wordlist(stanzas):
    
    return sorted(list(set().union(*[stanza.words for stanza in stanzas])))
1130284
def readBatchTupleQuotes(self, symbols, start, end):
        '''
        
        '''
        if end is None:
            end=sys.maxint

        ret={}
        session=self.getReadSession()()
        try:
            symbolChunks=splitListEqually(symbols, 100)
            for chunk in symbolChunks:
                rows=session.query(Quote.symbol, Quote.time, Quote.close, Quote.volume,
                                     Quote.low, Quote.high).filter(and_(Quote.symbol.in_(chunk),
                                                                              Quote.time >= int(start),
                                                                              Quote.time < int(end)))

                for row in rows:
                    if row.time not in ret:
                        ret[row.time]={}

                    ret[row.time][row.symbol]=self.__sqlToTupleQuote(row)
        finally:
            self.getReadSession().remove()

        return ret
1093153
def parse_a_stanza(self):
		""""""
		# 's' line -- score, 1 field
		line = self.fetch_line(report=" in a-stanza")
		fields = line.split()
		assert (fields[0] == "s"), "s line expected in a-stanza (line %d, \"%s\")" \
								 % (self.lineNumber,line)
		try:    score = int(fields[1])
		except: score = float(fields[1])

		# 'b' line -- begin positions in seqs, 2 fields
		line = self.fetch_line(report=" in a-stanza")
		fields = line.split()
		assert (fields[0] == "b"), "b line expected in a-stanza (line %d, \"%s\")" \
								 % (self.lineNumber,line)
		beg1 = int(fields[1]) - 1
		beg2 = int(fields[2]) - 1

		# 'e' line -- end positions in seqs, 2 fields
		line = self.fetch_line(report=" in a-stanza")
		fields = line.split()
		assert (fields[0] == "e"), "e line expected in a-stanza (line %d, \"%s\")" \
								 % (self.lineNumber,line)
		len1 = int(fields[1]) - beg1
		len2 = int(fields[2]) - beg2

		# 'l' lines
		pieces = []
		while (True):
			line = self.fetch_line(report=" in a-stanza")
			fields = line.split()
			if (fields[0] != "l"):
				break
			start1  = int(fields[1]) - 1
			start2  = int(fields[2]) - 1
			length  = int(fields[3]) - start1
			length2 = int(fields[4]) - start2
			try:    pctId = int(fields[5])
			except: pctId = float(fields[5])
			assert (length2 == length), "length mismatch in a-stanza"
			pieces.append((start1+self.seq1_start,start2+self.seq2_start,length,pctId))
		assert (line == "}"), "improper a-stanza terminator (line %d, \"%s\")" \
							% (self.lineNumber,line)
		return (score,pieces)
703954
def phrases_map(data):
  """"""
  (entry, text_fn) = data
  text = text_fn()
  filename = entry.filename

  logging.debug("Got %s", filename)
  for s in split_into_sentences(text):
    words = split_into_words(s.lower())
    if len(words) < PHRASE_LENGTH:
      yield (":".join(words), filename)
      continue
    for i in range(0, len(words) - PHRASE_LENGTH):
      yield (":".join(words[i:i+PHRASE_LENGTH]), filename)
22396
private void getLastToken(StreamTokenizer tokenizer, boolean endOfFileOk) throws IOException, ParseException {
        if ((tokenizer.nextToken() != StreamTokenizer.TT_EOL) && ((tokenizer.ttype != StreamTokenizer.TT_EOF) || !endOfFileOk)) {
            throw new ParseException("end of line expected", tokenizer.lineno());
        }
    }
79069
function processKeywords() {
    var nodes = []
    var lastIndex
    var keyword
    var node
    var submatch

    if (!top.keywords) {
      return addText(modeBuffer, nodes)
    }

    lastIndex = 0

    top.lexemesRe.lastIndex = 0

    keyword = top.lexemesRe.exec(modeBuffer)

    while (keyword) {
      addText(modeBuffer.substring(lastIndex, keyword.index), nodes)

      submatch = keywordMatch(top, keyword)

      if (submatch) {
        relevance += submatch[1]

        node = build(submatch[0], [])

        nodes.push(node)

        addText(keyword[0], node.children)
      } else {
        addText(keyword[0], nodes)
      }

      lastIndex = top.lexemesRe.lastIndex
      keyword = top.lexemesRe.exec(modeBuffer)
    }

    addText(modeBuffer.substr(lastIndex), nodes)

    return nodes
  }
767432
def _dict_to_stanza(key, stanza):
    '''
    
    '''
    ret = ''
    for skey in stanza:
        if stanza[skey] is True:
            stanza[skey] = ''
        ret += '    {0} {1}\n'.format(skey, stanza[skey])
    return '{0} {{\n{1}}}'.format(key, ret)
604151
def lex(self, text):
        """"""
        for match in self.regex.finditer(text):
            name = match.lastgroup
            yield (name, match.group(name))
151412
def find_all(self, string, callback):
		
		for index, output in self.iter(string):
			callback(index, output)
876465
def completer_tokenize(cls, value, min_length=3):
        ''''''
        tokens = list(itertools.chain(*[
            [m for m in n.split("'") if len(m) > min_length]
            for n in value.split(' ')
        ]))
        return list(set([value] + tokens + [' '.join(tokens)]))
135687
def complete_use(self, text, *_):
        
        return [t + " " for t in REGIONS if t.startswith(text)]
137257
def completedefault(self, text, line, begidx, endidx):
        """"""
        if self.argparser_completer and any((line.startswith(x) for x in self.argparse_names())):
            self.argparser_completer.rl_complete(line, 0)
            return [x[begidx:] for x in self.argparser_completer._rl_matches]
        else:
            return []
251286
def searchlast(self,n=10):
        """"""            
        solutions = deque([], n)
        for solution in self:
            solutions.append(solution)
        return solutions
363838
def all_phrase_translations(phrase):
    '''
    
    '''
    if not trees:
        init()
    phrase = phrase.split(string.whitespace)
    for word in phrase:
        for x in range(len(word)):
            for translation in _words_at_the_beginning(
                    word[x+1:],
                    trees['simplified'][word[x]],
                    prefix=word[x]):
                yield translation
1105680
def iteritems(self, multi=False):
        """"""
        for key, values in dict.iteritems(self):
            if multi:
                for value in values:
                    yield key, value
            else:
                yield key, values[0]
523509
def butlast(iterable):
    
    iterable = iter(iterable)
    try:
        first = next(iterable)
    except StopIteration:
        return
    for second in iterable:
        yield first
        first = second
930432
def get_all(self):
        # type: () -> typing.Iterable[typing.Tuple[str, str]]
        
        for name, values in six.iteritems(self._as_list):
            for value in values:
                yield (name, value)