def iter_json(self, _path=None, requests_params=None, **apiparams):
        """Reliably iterate through all data as json strings"""
        requests_params = dict(requests_params or {})
        requests_params.setdefault('method', 'GET')
        requests_params.setdefault('stream', True)
        lastexc = None
        line = None
        offset = 0
        for attempt in xrange(self.MAX_RETRIES):
            self._add_resume_param(line, offset, apiparams)
            try:
                for line in self._iter_lines(_path=_path, params=apiparams,
                        **requests_params):
                    yield line
                    offset += 1
                break
            except (__HOLE__, socket.error, rexc.RequestException) as exc:
                # catch requests exceptions other than HTTPError
                if isinstance(exc, rexc.HTTPError):
                    raise
                lastexc = exc
                url = urlpathjoin(self.url, _path)
                msg = "Retrying read of %s in %ds: attempt=%d/%d error=%s"
                args = url, self.RETRY_INTERVAL, attempt, self.MAX_RETRIES, exc
                logger.debug(msg, *args)
                time.sleep(self.RETRY_INTERVAL)
        else:
            url = urlpathjoin(self.url, _path)
            logger.error("Failed %d times reading items from %s, params %s, "
                "last error was: %s", self.MAX_RETRIES, url, apiparams, lastexc)
dataset/ETHPy150Open scrapinghub/python-hubstorage/hubstorage/resourcetype.py/DownloadableResource.iter_json