def unicode2utf8(arg):
if PY2 and isinstance(arg, text_type):<EOL><INDENT>return arg.encode('<STR_LIT:utf-8>')<EOL><DEDENT>return arg<EOL>
Convert strings to UTF8-encoded bytes.

    Only in Python 2. In Python 3 the args are expected as unicode.