def _time_to_json(value):
 if isinstance(value, datetime.time):
  value = value.isoformat()
 return value

def _time_to_json ( value ) : if isinstance ( value , datetime . time ) : value = value . isoformat ( ) return value
coerce value to an json-compatible representation .