def METHOD_NAME(val):
    if isinstance(val, datetime.datetime):  # pragma: no cover
        return val.isoformat()
    elif isinstance(val, Time):  # pragma: no cover
        return str(val)
    return val