def __fetch_pull_requests(self, from_date, to_date):
raw_pulls = self.client.pulls(from_date=from_date)<EOL>for raw_pull in raw_pulls:<EOL><INDENT>pull = json.loads(raw_pull)<EOL>if str_to_datetime(pull['<STR_LIT>']) > to_date:<EOL><INDENT>return<EOL><DEDENT>self.__init_extra_pull_fields(pull)<EOL>for field in TARGET_PULL_FIELDS:<EOL><INDENT>if not pull[field]:<EOL><INDENT>continue<EOL><DEDENT>if field == '<STR_LIT:user>':<EOL><INDENT>pull[field + '<STR_LIT>'] = self.__get_user(pull[field]['<STR_LIT>'])<EOL><DEDENT>elif field == '<STR_LIT>':<EOL><INDENT>pull[field + '<STR_LIT>'] = self.__get_user(pull[field]['<STR_LIT>'])<EOL><DEDENT>elif field == '<STR_LIT>':<EOL><INDENT>pull[field + '<STR_LIT>'] = self.__get_pull_review_comments(pull['<STR_LIT>'])<EOL><DEDENT>elif field == '<STR_LIT>':<EOL><INDENT>pull[field + '<STR_LIT>'] = self.__get_pull_requested_reviewers(pull['<STR_LIT>'])<EOL><DEDENT>elif field == '<STR_LIT>':<EOL><INDENT>pull[field + '<STR_LIT>'] = self.__get_pull_commits(pull['<STR_LIT>'])<EOL><DEDENT><DEDENT>yield pull<EOL><DEDENT>
Fetch the pull requests