def _encode_datetime(self, dt):
if dt.tzinfo is None:<EOL><INDENT>dt = dt.replace(tzinfo=datetime.timezone.utc)<EOL><DEDENT>dt = dt.astimezone(datetime.timezone.utc)<EOL>return dt.strftime('<STR_LIT>')<EOL>
Encode a datetime in the format '%Y-%m-%dT%H:%M:%SZ'.

        The datetime can be naieve (doesn't have timezone info) or aware
        (it does have a tzinfo attribute set). Regardless, the datetime
        is transformed into UTC.