def _decode_datetime(obj):
    """Decode a msgpack'ed datetime."""

    if '__datetime__' in obj:
        obj = datetime.datetime.strptime(obj['as_str'].decode(), "%Y%m%dT%H:%M:%S.%f")
    return obj
Decode a msgpack'ed datetime.