'A generator that can be assigned to a swob Response\'s app_iter which,
when iterated over, will extract and PUT the objects pulled from the
request body. Will occasionally yield whitespace while request is being
processed. When the request is completed will yield a response body
that can be parsed to determine success. See above documentation for
details.
:params req: a swob Request
:params compress_type: specifying the compression type of the tar.
Accepts \'\', \'gz\', or \'bz2\''

def handle_extract_iter(self, req, compress_type, out_content_type='text/plain'):

    resp_dict = {'Response    Status': HTTPCreated().status, 'Response    Body': '', 'Number    Files    Created': 0}
    failed_files = []
    last_yield = time()
    separator = ''
    containers_accessed = set()
    try:
        if (not out_content_type):
            raise HTTPNotAcceptable(request=req)
        if out_content_type.endswith('/xml'):
            (yield '<?xml    version="1.0"    encoding="UTF-8"?>\n')
        if ((req.content_length is None) and (req.headers.get('transfer-encoding', '').lower() != 'chunked')):
            raise HTTPLengthRequired(request=req)
        try:
            (vrs, account, extract_base) = req.split_path(2, 3, True)
        except ValueError:
            raise HTTPNotFound(request=req)
        extract_base = (extract_base or '')
        extract_base = extract_base.rstrip('/')
        tar = tarfile.open(mode=('r|' + compress_type), fileobj=req.body_file)
        failed_response_type = HTTPBadRequest
        req.environ['eventlet.minimum_write_chunk_size'] = 0
        containers_created = 0
        while True:
            if ((last_yield + self.yield_frequency) < time()):
                separator = '\r\n\r\n'
                last_yield = time()
                (yield '    ')
            tar_info = next(tar)
            if ((tar_info is None) or (len(failed_files) >= self.max_failed_extractions)):
                break
            if tar_info.isfile():
                obj_path = tar_info.name
                if obj_path.startswith('./'):
                    obj_path = obj_path[2:]
                obj_path = obj_path.lstrip('/')
                if extract_base:
                    obj_path = ((extract_base + '/') + obj_path)
                if ('/' not in obj_path):
                    continue
                destination = '/'.join(['', vrs, account, obj_path])
                container = obj_path.split('/', 1)[0]
                if (not constraints.check_utf8(destination)):
                    failed_files.append([quote(obj_path[:self.max_path_length]), HTTPPreconditionFailed().status])
                    continue
                if (tar_info.size > constraints.MAX_FILE_SIZE):
                    failed_files.append([quote(obj_path[:self.max_path_length]), HTTPRequestEntityTooLarge().status])
                    continue
                container_failure = None
                if (container not in containers_accessed):
                    cont_path = '/'.join(['', vrs, account, container])
                    try:
                        if self.create_container(req, cont_path):
                            containers_created += 1
                            if (containers_created > self.max_containers):
                                raise HTTPBadRequest(('More    than    %d    containers    to    create    from    tar.' % self.max_containers))
                    except CreateContainerError as err:
                        container_failure = [quote(cont_path[:self.max_path_length]), err.status]
                        if (err.status_int == HTTP_UNAUTHORIZED):
                            raise HTTPUnauthorized(request=req)
                    except ValueError:
                        failed_files.append([quote(obj_path[:self.max_path_length]), HTTPBadRequest().status])
                        continue
                tar_file = tar.extractfile(tar_info)
                new_env = req.environ.copy()
                new_env['REQUEST_METHOD'] = 'PUT'
                new_env['wsgi.input'] = tar_file
                new_env['PATH_INFO'] = destination
                new_env['CONTENT_LENGTH'] = tar_info.size
                new_env['swift.source'] = 'EA'
                new_env['HTTP_USER_AGENT'] = ('%s    BulkExpand' % req.environ.get('HTTP_USER_AGENT'))
                create_obj_req = Request.blank(destination, new_env)
                for (pax_key, pax_value) in tar_info.pax_headers.items():
                    header_name = pax_key_to_swift_header(pax_key)
                    if header_name:
                        create_obj_req.headers[header_name] = pax_value.encode('utf-8')
                resp = create_obj_req.get_response(self.app)
                containers_accessed.add(container)
                if resp.is_success:
                    resp_dict['Number    Files    Created'] += 1
                else:
                    if container_failure:
                        failed_files.append(container_failure)
                    if (resp.status_int == HTTP_UNAUTHORIZED):
                        failed_files.append([quote(obj_path[:self.max_path_length]), HTTPUnauthorized().status])
                        raise HTTPUnauthorized(request=req)
                    if ((resp.status_int // 100) == 5):
                        failed_response_type = HTTPBadGateway
                    failed_files.append([quote(obj_path[:self.max_path_length]), resp.status])
        if failed_files:
            resp_dict['Response    Status'] = failed_response_type().status
        elif (not resp_dict['Number    Files    Created']):
            resp_dict['Response    Status'] = HTTPBadRequest().status
            resp_dict['Response    Body'] = 'Invalid    Tar    File:    No    Valid    Files'
    except HTTPException as err:
        resp_dict['Response    Status'] = err.status
        resp_dict['Response    Body'] = err.body
    except (tarfile.TarError, zlib.error) as tar_error:
        resp_dict['Response    Status'] = HTTPBadRequest().status
        resp_dict['Response    Body'] = ('Invalid    Tar    File:    %s' % tar_error)
    except Exception:
        self.logger.exception('Error    in    extract    archive.')
        resp_dict['Response    Status'] = HTTPServerError().status
    (yield (separator + get_response_body(out_content_type, resp_dict, failed_files)))
