def __fetch_items(self, path, page=<NUM_LIT:1>):
fetch_data = True<EOL>parsed_crates = <NUM_LIT:0><EOL>total_crates = <NUM_LIT:0><EOL>while fetch_data:<EOL><INDENT>logger.debug("<STR_LIT>", page)<EOL>try:<EOL><INDENT>payload = {'<STR_LIT>': '<STR_LIT>', '<STR_LIT>': page}<EOL>raw_content = self.fetch(path, payload=payload)<EOL>content = json.loads(raw_content)<EOL>parsed_crates += len(content['<STR_LIT>'])<EOL>if not total_crates:<EOL><INDENT>total_crates = content['<STR_LIT>']['<STR_LIT>']<EOL><DEDENT><DEDENT>except requests.exceptions.HTTPError as e:<EOL><INDENT>logger.error("<STR_LIT>", e.response.text)<EOL>raise e<EOL><DEDENT>yield raw_content<EOL>page += <NUM_LIT:1><EOL>if parsed_crates >= total_crates:<EOL><INDENT>fetch_data = False<EOL><DEDENT><DEDENT>
Return the items from Crates.io API using pagination