

@_handle_object_not_found
def fetch(self, obj, include_meta=False, chunk_size=None, size=None, extra_info=None):
    "\n        Fetches the object from storage.\n\n        If 'include_meta' is False, only the bytes representing the\n        stored object are returned.\n\n        Note: if 'chunk_size' is defined, the 'include_meta' parameter is\n        ignored.\n\n        If 'size' is specified, only the first 'size' bytes of the object will\n        be returned. If the object if smaller than 'size', the entire object is\n        returned.\n\n        When 'include_meta' is True, what is returned from this method is a\n        2-tuple:\n            Element 0: a dictionary containing metadata about the file.\n            Element 1: a stream of bytes representing the object's contents.\n\n        The 'extra_info' parameter is included for backwards compatibility. It\n        is no longer used at all, and will not be modified with swiftclient\n        info, since swiftclient is not used any more.\n        "
    uri = ('/%s/%s' % (self.uri_base, utils.get_name(obj)))
    if chunk_size:
        if (not isinstance(obj, StorageObject)):
            obj = self.get(obj)
        obj_size = obj.total_bytes
        return self._fetch_chunker(uri, chunk_size, size, obj_size)
    headers = {
        
    }
    if size:
        headers = {
            'Range': ('bytes=0-%s' % size),
        }
    (resp, resp_body) = self.api.method_get(uri, headers=headers, raw_content=True)
    if include_meta:
        (meta_resp, meta_body) = self.api.method_head(uri)
        return (meta_resp.headers, headers)
    return resp_body

dataset/ETHPy150Open rackspace/pyrax/pyrax/object_storage.py StorageObjectManager.fetch/VarMisuse@178/556 `resp_body`->`headers`