def unpack(response, default_code=HTTPStatus.OK):
    '\n    Unpack a Flask standard response.\n\n    Flask response can be:\n    - a single value\n    - a 2-tuple ``(value, code)``\n    - a 3-tuple ``(value, code, headers)``\n\n    .. warning::\n\n        When using this function, you must ensure that the tuple is not the response data.\n        To do so, prefer returning list instead of tuple for listings.\n\n    :param response: A Flask style response\n    :param int default_code: The HTTP code to use as default if none is provided\n    :return: a 3-tuple ``(data, code, headers)``\n    :rtype: tuple\n    :raise ValueError: if the response does not have one of the expected format\n    '
    if (not isinstance(response, tuple)):
        return (response, default_code, {})
    elif (len(response) == 1):
        return (response[0], default_code, {})
    elif (len(response) == 2):
        (data, code) = response
        return (data, code, {})
    elif (len(response) == 3):
        (data, code, headers) = response
        return (data, (code or default_code), headers)
    else:
        raise ValueError('Too many response values')
Unpack a Flask standard response.

Flask response can be:
- a single value
- a 2-tuple ``(value, code)``
- a 3-tuple ``(value, code, headers)``

.. warning::

    When using this function, you must ensure that the tuple is not the response data.
    To do so, prefer returning list instead of tuple for listings.

:param response: A Flask style response
:param int default_code: The HTTP code to use as default if none is provided
:return: a 3-tuple ``(data, code, headers)``
:rtype: tuple
:raise ValueError: if the response does not have one of the expected format
def unpack(response, default_code=HTTPStatus.OK):
    '\n    Unpack a Flask standard response.\n\n    Flask response can be:\n    - a single value\n    - a 2-tuple ``(value, code)``\n    - a 3-tuple ``(value, code, headers)``\n\n    .. warning::\n\n        When using this function, you must ensure that the tuple is not the response data.\n        To do so, prefer returning list instead of tuple for listings.\n\n    :param response: A Flask style response\n    :param int default_code: The HTTP code to use as default if none is provided\n    :return: a 3-tuple ``(data, code, headers)``\n    :rtype: tuple\n    :raise ValueError: if the response does not have one of the expected format\n    '
    if (not isinstance(response, tuple)):
        return (response, default_code, {})
    elif (len(response) == 1):
        return (response[0], default_code, {})
    elif (len(response) == 2):
        (data, code) = response
        return (data, code, {})
    elif (len(response) == 3):
        (data, code, headers) = response
        return (data, (code or default_code), headers)
    else:
        raise ValueError('Too many response values')