<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def encode_time(o):
 """ Encodes a Python datetime.time object as an ECMA-262 compliant time string."""

    r = o.isoformat()
    if o.microsecond:
        r = r[:12]
    if r.endswith('+00:00'):
        r = r[:-6] + 'Z'
    return r