def _datetime_to_json(value):
 if isinstance(value, datetime.datetime):
  value = _datetime_to_rfc3339(value)
 return value

def _datetime_to_json ( value ) : if isinstance ( value , datetime . datetime ) : value = _datetime_to_rfc3339 ( value ) return value
coerce value to an json-compatible representation .