'Converts resp content into an iterable as required by PEP 333
Args:
resp: Instance of falcon.Response
wsgi_file_wrapper: Reference to wsgi.file_wrapper from the
WSGI environ dict, if provided by the WSGI server. Used
when resp.stream is a file-like object (default None).
Returns:
tuple: A two-member tuple of the form (iterable, content_length).
The length is returned as ``None`` when unknown. The
iterable is determined as follows:
* If resp.body is not ``None``, returns [resp.body],
encoded as UTF-8 if it is a Unicode string.
Bytestrings are returned as-is.
* If resp.data is not ``None``, returns [resp.data]
* If resp.stream is not ``None``, returns resp.stream
iterable using wsgi.file_wrapper, if possible.
* Otherwise, returns []'

def _get_body(self, resp, wsgi_file_wrapper=None):

    body = resp.body
    if (body is not None):
        if (not isinstance(body, bytes)):
            body = body.encode('utf-8')
        return ([body], len(body))
    data = resp.data
    if (data is not None):
        return ([data], len(data))
    stream = resp.stream
    if (stream is not None):
        if hasattr(stream, 'read'):
            if (wsgi_file_wrapper is not None):
                iterable = wsgi_file_wrapper(stream, self._STREAM_BLOCK_SIZE)
            else:
                iterable = helpers.CloseableStreamIterator(stream, self._STREAM_BLOCK_SIZE)
        else:
            iterable = stream
        return (iterable, resp.stream_len)
    return ([], 0)
