def unpack(value):
    """Return a three tuple of data, code, and headers"""
    if not isinstance(value, tuple):
        return value, 200, {}
    value_len = len(value)
    if value_len == 2:
        return value[0], value[1], {}
    elif value_len == 3:
        return value[0], value[1], value[2]
    else:
        return value, 200, {}