def possibly_fix_width(text):

    if text in ['', '--']:
        return text

    # stringify the arguments
    if type(text) not in [type('string'), type(u'Unicode')]:
        text = "%r" % text

    if text[0] in "$/" or "}" == text[-1] or re.match(r'^[A-Z_\${}:-]+$', text):
        return '`%s`' % text

    return text
Heuristic to possibly mark-up text as monospaced if it looks like
dataset/ETHPy150Open jboss-openshift/application-templates/gen_template_docs.py/possibly_fix_width