def _pretty_lu(lu):

    lukeys = lu.keys()
    outstr = ""
    outstr += "lexical unit ({0.ID}): {0.name}\n\n".format(lu)
    if 'definition' in lukeys:
        outstr += "[definition]\n"
        outstr += _pretty_longstring(lu.definition,'  ')
    if 'frame' in lukeys:
        outstr += "\n[frame] {0}({1})\n".format(lu.frame.name,lu.frame.ID)
    if 'incorporatedFE' in lukeys:
        outstr += "\n[incorporatedFE] {0}\n".format(lu.incorporatedFE)
    if 'POS' in lukeys:
        outstr += "\n[POS] {0}\n".format(lu.POS)
    if 'status' in lukeys:
        outstr += "\n[status] {0}\n".format(lu.status)
    if 'totalAnnotated' in lukeys:
        outstr += "\n[totalAnnotated] {0} annotated examples\n".format(lu.totalAnnotated)
    if 'lexemes' in lukeys:
        outstr += "\n[lexemes] {0}\n".format(' '.join('{0}/{1}'.format(lex.name,lex.POS) for lex in lu.lexemes))
    if 'semTypes' in lukeys:
        outstr += "\n[semTypes] {0} semantic types\n".format(len(lu.semTypes))
        outstr += "  "*(len(lu.semTypes)>0) + ", ".join('{0}({1})'.format(x.name, x.ID) for x in lu.semTypes) + '\n'*(len(lu.semTypes)>0)
    if 'subCorpus' in lukeys:
        subc = [x.name for x in lu.subCorpus]
        outstr += "\n[subCorpus] {0} subcorpora\n".format(len(lu.subCorpus))
        for line in textwrap.fill(", ".join(sorted(subc)), 60).split('\n'):
            outstr += "  {0}\n".format(line)

    return outstr
Helper function for pretty-printing a lexical unit.
dataset/ETHPy150Open nltk/nltk/nltk/corpus/reader/framenet.py/_pretty_lu