'Return all words/tokens from the documents (with duplicates).
:param documents: a list of (words, label) tuples.
:param labeled: if `True`, assume that each document is represented by a
(words, label) tuple: (list(str), str). If `False`, each document is
considered as being a simple list of strings: list(str).
:rtype: list(str)
:return: A list of all words/tokens in `documents`.'

def all_words(self, documents, labeled=None):

    all_words = []
    if (labeled is None):
        labeled = (documents and isinstance(documents[0], tuple))
    if (labeled == True):
        for (words, sentiment) in documents:
            all_words.extend(words)
    elif (labeled == False):
        for words in documents:
            all_words.extend(words)
    return all_words
