def fetch_issues(self):
        try:
            iterator = self.repo.iter_issues
        except __HOLE__:
            iterator = self.repo.issues
        for issue in iterator(state='all'):
            # is this a pull request ?
            if getattr(issue, 'pull_request', None):
                msg = 'Skipping pull request %s: %s' % (issue.id, issue.title)
                logger.debug(msg)
                continue
            msg = 'Skipping pull request %s: %s' % (issue.id, issue.title)
            logger.debug(msg)
            issue_data = {'source_id': issue.id,
                          'priority_id': 1  # set default priority to be safe
                          }
            if getattr(issue, 'title', None):
                issue_data['subject'] = issue.title
            if getattr(issue, 'body', None):
                try:
                    issue_data['description'] = issue.body_text
                except:
                    issue_data['description'] = issue.body
            if getattr(issue, 'tracker', None):
                # not available on github
                pass
            if getattr(issue, 'state', None):
                # the default redmine statuses start with a capital letter
                issue_data['status_name'] = issue.state.title()
            if getattr(issue, 'priority', None):
                # not available on github
                pass
            if getattr(issue, 'done_ratio', None):
                # not available on github
                pass
            if getattr(issue, 'story_points', None):
                # not available on github
                pass
            if getattr(issue, 'milestone', None):
                issue_data['fixed_version_id'] = issue.milestone.number
                issue_data['version_name'] = issue.milestone.title
            if getattr(issue, 'assignee', None):
                issue_data['assigned_to_id'] = issue.assignee.id
                login = issue.assignee.login
                issue_data['assigned_to_login'] = login
            yield issue_data
dataset/ETHPy150Open redhat-cip/software-factory/tools/sfmigration/sfmigration/issues/github.py/GithubImporter.fetch_issues