def smartypants(value):
try:<EOL><INDENT>from smartypants import smartyPants<EOL><DEDENT>except ImportError:<EOL><INDENT>if settings.DEBUG:<EOL><INDENT>raise TemplateSyntaxError("<STR_LIT>")<EOL><DEDENT>return value<EOL><DEDENT>else:<EOL><INDENT>return smartyPants(value)<EOL><DEDENT>
Applies SmartyPants to a piece of text, applying typographic
niceties.

Requires the Python SmartyPants library to be installed; see
http://web.chad.org/projects/smartypants.py/