code: def unpack(response, default_code=HTTPStatus.OK):
      """
      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
      """
      if not isinstance(response, tuple):
          # data only
          return response, default_code, {}
      elif len(response) == 1:
          # data only as tuple
          return response[0], default_code, {}
      elif len(response) == 2:
          # data and code
          data, code = response
          return data, code, {}
      elif len(response) == 3:
          # data, code and headers
          data, code, headers = response
          return data, code or default_code, headers
      else:
          raise ValueError("Too many response values")
  
file_path: flask-restplus/flask_restplus/utils.py
imports: from __future__ import unicode_literals
  import re
  from copy import deepcopy
  from six import iteritems
  from ._http import HTTPStatus
label_desc: Use image node_id 6 for calling a global function with example usage: unpack(response, default_code) and returns: response,  default_code,  dict, response,  default_code,  dict, data,  code,  dict, data,  unknown,  headers