def xpoll(self, query_id=None, sequence_no=None, params=None,<EOL>delete_query=True, **kwargs):  
def _delete(query_id, **kwargs):<EOL><INDENT>r = self.delete(query_id, **kwargs)<EOL>try:<EOL><INDENT>r_json = r.json()<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % e)<EOL><DEDENT>if not (<NUM_LIT:200> <= r.status_code < <NUM_LIT>):<EOL><INDENT>if '<STR_LIT>' in r_json and '<STR_LIT>' in r_json:<EOL><INDENT>raise PanCloudError('<STR_LIT>' %<EOL>(r_json['<STR_LIT>'],<EOL>r_json['<STR_LIT>']))<EOL><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % (r.status_code,<EOL>r.reason))<EOL><DEDENT><DEDENT>if r.status_code == <NUM_LIT:200>:<EOL><INDENT>return<EOL><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' %<EOL>r.status_code)<EOL><DEDENT><DEDENT>while True:<EOL><INDENT>r = self.poll(query_id, sequence_no, params, **kwargs)<EOL>try:<EOL><INDENT>r_json = r.json()<EOL><DEDENT>except ValueError as e:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % e)<EOL><DEDENT>if not (<NUM_LIT:200> <= r.status_code < <NUM_LIT>):<EOL><INDENT>if '<STR_LIT>' in r_json and '<STR_LIT>' in r_json:<EOL><INDENT>raise PanCloudError('<STR_LIT>' %<EOL>(r_json['<STR_LIT>'],<EOL>r_json['<STR_LIT>']))<EOL><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % (r.status_code,<EOL>r.reason))<EOL><DEDENT><DEDENT>if '<STR_LIT>' not in r_json:<EOL><INDENT>self._debug(r_json)<EOL>raise PanCloudError('<STR_LIT>')<EOL><DEDENT>self._debug(r_json['<STR_LIT>'])<EOL>if r_json['<STR_LIT>'] in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>try:<EOL><INDENT>hits = r_json['<STR_LIT:result>']['<STR_LIT>']['<STR_LIT>']['<STR_LIT>']<EOL><DEDENT>except KeyError as e:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % e)<EOL><DEDENT>self._debug('<STR_LIT>', len(hits))<EOL>for x in hits:<EOL><INDENT>yield x<EOL><DEDENT>if r_json['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>if delete_query:<EOL><INDENT>_delete(query_id, **kwargs)<EOL><DEDENT>return<EOL><DEDENT>if sequence_no is not None:<EOL><INDENT>sequence_no += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>sequence_no = <NUM_LIT:1><EOL><DEDENT><DEDENT>elif r_json['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>e = '<STR_LIT:%s>' % r_json['<STR_LIT>']<EOL>try:<EOL><INDENT>e += '<STR_LIT>' % r_json['<STR_LIT:result>']['<STR_LIT>']['<STR_LIT:error>']<EOL><DEDENT>except KeyError:<EOL><INDENT>self._debug(r_json)<EOL><DEDENT>raise PanCloudError(e)<EOL><DEDENT>elif r_json['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>if params is not None and '<STR_LIT>' in params:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>time.sleep(<NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise PanCloudError('<STR_LIT>' % r_json['<STR_LIT>'])<EOL><DEDENT><DEDENT>
Retrieve individual logs iteratively in a non-greedy manner.

        Generator function to return individual log entries from poll
        API request.

        Args:
            params (dict): Payload/request dictionary.
            query_id (str): Specifies the ID of the query job.
            sequence_no (int): Specifies the sequenceNo.
            delete_query (bool): True for delete, False otherwise.
            **kwargs: Supported :meth:`~pancloud.httpclient.HTTPClient.request` parameters.

        Yields:
            dictionary with single log entry.