Get a list of comment Resources.

        :param issue: the issue to get comments from
        :type issue: str
        :rtype: List[Comment]
334471
def comments(self, issue):
        
        r_json = self._get_json('issue/' + str(issue) + '/comment')

        comments = [Comment(self._options, self._session, raw_comment_json)
                    for raw_comment_json in r_json['comments']]
        return comments
338266
def get_all_comments(self):
        
        return bind_api(
            api=self,
            path='/comments',
            payload_type='comment',
            payload_list=True,
            pagination_param=['page_number', 'page_size']
        )
1221872
def issue(self, number):
        
        json = None
        if int(number) > 0:
            url = self._build_url('issues', str(number), base_url=self._api)
            json = self._json(self._get(url), 200)
        return Issue(json, self) if json else None
1131497
def get_books_by_comment(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceBinSession.get_bins_by_resource
        catalogs = self._get_provider_session('comment_book_session').get_books_by_comment(*args, **kwargs)
        cat_list = []
        for cat in catalogs:
            cat_list.append(Book(self._provider_manager, cat, self._runtime, self._proxy))
        return BookList(cat_list)
620212
def get_comment_form(self, *args, **kwargs):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.ResourceAdminSession.get_resource_form_for_update
        # This method might be a bit sketchy. Time will tell.
        if isinstance(args[-1], list) or 'comment_record_types' in kwargs:
            return self.get_comment_form_for_create(*args, **kwargs)
        else:
            return self.get_comment_form_for_update(*args, **kwargs)
640404
def iter_comments(self, number=-1):
        
        url = self._build_url('comments', base_url=self._api)
        return self._iter(int(number), url, IssueComment)
695110
def get_all(cls):
        
        issues = db.Issue.find(
            Issue.issue_type_id == IssueType.get(cls.issue_type).issue_type_id
        )

        return {res.issue_id: cls(res) for res in issues}
1367977
def get_disease_comments(self, entry):
        
        disease_comments = []
        query = "./comment[@type='disease']"

        for disease_comment in entry.iterfind(query):
            value_dict = {'comment': disease_comment.find('./text').text}

            disease = disease_comment.find("./disease")

            if disease is not None:
                disease_dict = {'identifier': disease.get('id')}

                for element in disease:
                    key = element.tag

                    if key in ['acronym', 'description', 'name']:
                        disease_dict[key] = element.text

                    if key == 'dbReference':
                        disease_dict['ref_id'] = element.get('id')
                        disease_dict['ref_type'] = element.get('type')

                disease_obj = models.get_or_create(self.session, models.Disease, **disease_dict)
                self.session.add(disease_obj)
                self.session.flush()
                value_dict['disease_id'] = disease_obj.id

            disease_comments.append(models.DiseaseComment(**value_dict))

        return disease_comments
364556
def issue_tags(issue):
    """"""
    labels = issue.get('labels', [])
    return [label['name'].replace('tag: ', '') for label in labels if label['name'].startswith('tag: ')]
1062123
def get_datetime_issue_in_progress(self, issue):
        
        histories = issue.changelog.histories
        for history in reversed(histories):
            history_items = history.items
            for item in history_items:
                if item.field == 'status' and item.toString == "In Progress":
                    return dateutil.parser.parse(history.created)
1075747
public Collection<Issue> getIssues(IssueFilter filter) {
        filter = (filter == null) ? new IssueFilter() : filter;

        filter.team.clear();
        filter.team.add(this);
        return getInstance().get().issues(filter);
    }
372358
def add_issue_status(self, name, **attrs):
        
        return IssueStatuses(self.requester).create(self.id, name, **attrs)
1174646
def search(self, q, labels, state='open,closed', **kwargs):
        
        search_result = self.github_request.search(q=q, state=state, **kwargs)
        if search_result['total_count'] > 0:
            return list(
                map(lambda issue_dict: GithubIssue(
                    github_request=self.github_request, **issue_dict),
                    search_result['items'])
            )
313083
def _format_issue(issue):
    '''
    
    '''
    ret = {'id': issue.get('id'),
           'issue_number': issue.get('number'),
           'state': issue.get('state'),
           'title': issue.get('title'),
           'user': issue.get('user').get('login'),
           'html_url': issue.get('html_url')}

    assignee = issue.get('assignee')
    if assignee:
        assignee = assignee.get('login')

    labels = issue.get('labels')
    label_names = []
    for label in labels:
        label_names.append(label.get('name'))

    milestone = issue.get('milestone')
    if milestone:
        milestone = milestone.get('title')

    ret['assignee'] = assignee
    ret['labels'] = label_names
    ret['milestone'] = milestone

    return ret
848553
def get_comments_by_search(self, comment_query, comment_search):
        """"""
        # Implemented from azosid template for -
        # osid.resource.ResourceSearchSession.get_resources_by_search_template
        if not self._can('search'):
            raise PermissionDenied()
        return self._provider_session.get_comments_by_search(comment_query, comment_search)
334576
def get_issues():
        """"""
        issues = []
        for entry in Logger.journal:
            if entry.level >= WARNING:
                issues.append(entry)
        return issues
749289
def get_issue_by_ref(self, ref):
        
        response = self.requester.get(
            '/{endpoint}/by_ref?ref={us_ref}&project={project_id}',
            endpoint=Issue.endpoint,
            us_ref=ref,
            project_id=self.id
        )
        return Issue.parse(self.requester, response.json())