def doc_topics(self, doc_or_docs, compact_view=False,
                   aggregate=False, print_len=10, topic_labels=None):
        if (isstr(doc_or_docs) or isint(doc_or_docs) 
            or isinstance(doc_or_docs, dict)):
            doc, label = self._res_doc_type(doc_or_docs)

            k_arr = enum_sort(self.theta[:, doc]).view(LabeledColumn)
            k_arr.col_header = 'Document: ' + label
            k_arr.subcol_headers = ['Topic', 'Prob']
            k_arr.col_len = print_len
            return k_arr

        docs, labels = zip(*[self._res_doc_type(d) for d in doc_or_docs])

        k_arr = enum_matrix(self.theta.T, indices=range(self.model.K), 
                            field_name='topic')

        th = 'Distributions over Topics'
        
        table = []
        for i in xrange(len(docs)):
            if topic_labels is None: 
                ch = 'Doc: ' + labels[i]
            else:
                ch = topic_labels[i] 
                
            col = LabeledColumn(k_arr[docs[i]], col_header=ch, col_len=print_len)
            table.append(col)

        schc = ['Doc', 'Topics']
        schf = ['Topic', 'Prob']
        return DataTable(table, th, compact_view=compact_view,
                        subcolhdr_compact=schc, subcolhdr_full=schf)
Test contrib.formtools.preview form submittal when form contains:
dataset/ETHPy150Open inpho/vsm/vsm/viewer/ldacgsviewer.py/LdaCgsViewer.doc_topics--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/formtools/tests/__init__.py/PreviewTests.test_bool_submit