def istext(text):
    from genshi.core import Markup
    return isinstance(text, basestring) and not isinstance(text, Markup)
`True` for text (`unicode` and `str`), but `False` for `Markup`.
dataset/ETHPy150Open edgewall/trac/trac/util/presentation.py/istext