def fetch_items(self, path, payload):
page = <NUM_LIT:0>  <EOL>last_page = None  <EOL>url_next = urijoin(self.base_url, GitLabClient.PROJECTS, self.owner + '<STR_LIT>' + self.repository, path)<EOL>logger.debug("<STR_LIT>" + url_next)<EOL>response = self.fetch(url_next, payload=payload)<EOL>items = response.text<EOL>page += <NUM_LIT:1><EOL>if '<STR_LIT>' in response.links:<EOL><INDENT>last_url = response.links['<STR_LIT>']['<STR_LIT:url>']<EOL>last_page = last_url.split('<STR_LIT>')[<NUM_LIT:1>].split('<STR_LIT:&>')[<NUM_LIT:0>]<EOL>last_page = int(last_page)<EOL>logger.debug("<STR_LIT>" % (page, last_page))<EOL><DEDENT>while items:<EOL><INDENT>yield items<EOL>items = None<EOL>if '<STR_LIT>' in response.links:<EOL><INDENT>url_next = response.links['<STR_LIT>']['<STR_LIT:url>']  <EOL>response = self.fetch(url_next, payload=payload)<EOL>page += <NUM_LIT:1><EOL>items = response.text<EOL>logger.debug("<STR_LIT>" % (page, last_page))<EOL><DEDENT><DEDENT>
Return the items from GitLab API using links pagination