<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def utf8(s):
 """ Coerce an object to bytes if it is Unicode. """

    if isinstance(s, mitogen.core.UnicodeType):
        s = s.encode('utf-8')
    return s