Returns a list of contacts for an issue

        Args:
            issue (:obj:`RequiredTagsIssue`): Issue record

        Returns:
            `list` of `dict`
491938
def get_contacts(self, issue):
        
        # If the resources has been deleted, just return an empty list, to trigger issue deletion without notification
        if not issue.resource:
            return []

        account_contacts = issue.resource.account.contacts
        try:
            resource_owners = issue.resource.get_owner_emails()
            # Double check get_owner_emails for it's return value
            if type(resource_owners) is list:
                for resource_owner in resource_owners:
                    account_contacts.append({'type': 'email', 'value': resource_owner})
        except AttributeError:
            pass
        return account_contacts
1329897
def sender(self, issues):
        

        for issue in issues:
            state = self.get_state(issue.state)
            if issue.number:
                try:
                    gh_issue = self.repo.get_issue(issue.number)
                    original_state = gh_issue.state
                    if original_state == state:
                        action = 'Updated'
                    elif original_state == 'closed':
                        action = 'Reopened'
                    else:
                        action = 'Closed'

                    gh_issue.edit(title=issue.title,
                                  body=issue.body,
                                  labels=issue.labels,
                                  milestone=self.get_milestone(issue.milestone),
                                  assignee=self.get_assignee(issue.assignee),
                                  state=self.get_state(issue.state)
                                  )
                    print('{} #{}: {}'.format(action, gh_issue.number, gh_issue.title))
                except GithubException:
                    print('Not found #{}: {} (ignored)'.format(issue.number, issue.title))
                    continue
            else:
                gh_issue = self.repo.create_issue(title=issue.title,
                                                  body=issue.body,
                                                  labels=issue.labels,
                                                  milestone=self.get_milestone(issue.milestone),
                                                  assignee=self.get_assignee(issue.assignee))
                print('Created #{}: {}'.format(gh_issue.number, gh_issue.title))
148877
def sort_labeled_issues(issues)
      sorted_issues = []
      issues.each do |issue|
        label_names = issue["labels"].collect { |l| l["name"] }

        # Add PRs in the order of the @sections array. This will either be the
        # default sections followed by any --add-sections sections in
        # user-defined order, or --configure-sections in user-defined order.
        # Ignore the order of the issue labels from github which cannot be
        # controled by the user.
        @sections.each do |section|
          unless (section.labels & label_names).empty?
            section.issues << issue
            sorted_issues << issue
            break
          end
        end
      end
      issues - sorted_issues
    end
1081753
def _populate_issues_from_affected_trace_frames(self, graph: TraceGraph) -> None:
        

        initial_trace_frames = [
            trace_frame
            for trace_frame in graph._trace_frames.values()
            if self._is_filename_prefixed_with(
                graph.get_text(trace_frame.filename_id), self._affected_files
            )
        ]

        self._populate_issues_from_affected_conditions(
            initial_trace_frames,
            graph,
            lambda trace_frame_id: (
                graph._trace_frame_issue_instance_assoc[trace_frame_id]
            ),
            lambda trace_frame: (
                [
                    graph._trace_frames[trace_frame_id]
                    for trace_frame_id in graph._trace_frames_rev_map[
                        (trace_frame.caller_id.local_id, trace_frame.caller_port)
                    ]
                    if graph._trace_frames[trace_frame_id].kind == trace_frame.kind
                ]
            ),
            lambda instance_id: (self._get_leaf_names(graph, instance_id)),
            lambda trace_frame_id: (
                self._get_leaf_names_from_pairs(
                    graph, graph._trace_frame_leaf_assoc[trace_frame_id]
                )
            ),
            lambda instance, trace_frame: (
                self.add_issue_instance_trace_frame_assoc(instance, trace_frame)
            ),
            lambda trace_frame_id: (
                self._add_trace_frame(graph, graph._trace_frames[trace_frame_id])
            ),
            lambda initial_trace_frame_ids: (
                self._populate_trace(graph, initial_trace_frame_ids)
            ),
        )
108153
def extract_mail(issues):
    
    contacts = set()
    for idx, issue in enumerate(issues):
        printmp('Fetching issue #%s' % idx)
        for comment in issue.comments():
            comm = comment.as_dict()
            emails = list(email[0] for email in re.findall(MAIL_REGEX, comm['body'])
                if not email[0].startswith('//') and not email[0].endswith('github.com') and
                '@' in email[0])
            contacts |= set(emails)
    return contacts
1340028
def get_contacts(self, ids=None, **kwargs):
        
        params = {}
        if ids:
            ids = self._return_comma_list(ids)
            params['cn'] = {'id': ids}

        for key, value in kwargs.items():
            if key in ['a', 'ma']:
                params[key] = {'n': value}
            else:
                params[key] = value

        contacts = self.request_list('GetContacts', params)

        return [zobjects.Contact.from_dict(i) for i in contacts]
1289558
@Override
	public List<Issue> listAllIssues() {
		return getRestOperations().exchange(buildUri("/issues?per_page=25"), HttpMethod.GET, null, issueListTypeRef).getBody();
	}
1157540
def problem(self):
        
        if self.api and self.problem_id:
            return self.api._get_problem(self.problem_id)
142780
def _generate_issue(self, run, entry, callablesCount):
        """"""

        trace_frames = []

        for p in entry["preconditions"]:
            tf = self._generate_issue_precondition(run, entry, p)
            trace_frames.append(tf)

        for p in entry["postconditions"]:
            tf = self._generate_issue_postcondition(run, entry, p)
            trace_frames.append(tf)

        features = set()
        for f in entry["features"]:
            features.update(self._generate_issue_feature_contents(entry, f))

        callable = entry["callable"]
        handle = self._get_issue_handle(entry)
        # TODO: record depth in issue_sink and issue_source assoc, but this can
        # be different per instance, so should be stored with the instance.
        initial_sources = {
            self._get_shared_text(SharedTextKind.SOURCE, s)
            for (s, _) in entry["initial_sources"]
        }
        final_sinks = {
            self._get_shared_text(SharedTextKind.SINK, s)
            for (s, _) in entry["final_sinks"]
        }

        issue = Issue.Record(
            id=IssueDBID(),
            code=entry["code"],
            handle=handle,
            status=IssueStatus.UNCATEGORIZED,
            first_seen=run.date,
            run_id=run.id,
        )

        self.graph.add_issue(issue)

        fix_info = None
        fix_info_id = None
        if entry.get("fix_info") is not None:
            fix_info = IssueInstanceFixInfo.Record(
                id=DBID(), fix_info=json.dumps(entry["fix_info"])
            )
            fix_info_id = fix_info.id

        message = self._get_shared_text(SharedTextKind.MESSAGE, entry["message"])
        filename_record = self._get_shared_text(
            SharedTextKind.FILENAME, entry["filename"]
        )
        callable_record = self._get_shared_text(SharedTextKind.CALLABLE, callable)

        instance = IssueInstance.Record(
            id=DBID(),
            issue_id=issue.id,
            location=self.get_location(entry),
            filename_id=filename_record.id,
            callable_id=callable_record.id,
            run_id=run.id,
            fix_info_id=fix_info_id,
            message_id=message.id,
            rank=0,
            min_trace_length_to_sources=self._get_minimum_trace_length(
                entry["postconditions"]
            ),
            min_trace_length_to_sinks=self._get_minimum_trace_length(
                entry["preconditions"]
            ),
            callable_count=callablesCount[callable],
        )

        for sink in final_sinks:
            self.graph.add_issue_instance_shared_text_assoc(instance, sink)
        for source in initial_sources:
            self.graph.add_issue_instance_shared_text_assoc(instance, source)

        if fix_info is not None:
            self.graph.add_issue_instance_fix_info(instance, fix_info)

        for trace_frame in trace_frames:
            self.graph.add_issue_instance_trace_frame_assoc(instance, trace_frame)

        for feature in features:
            feature = self._get_shared_text(SharedTextKind.FEATURE, feature)
            self.graph.add_issue_instance_shared_text_assoc(instance, feature)

        self.graph.add_issue_instance(instance)
424430
def issue_info(self, issue_id):
        
        request_url = "{}issue/{}".format(self.create_basic_url(), issue_id)

        return_value = self._call_api(request_url)

        return return_value
158007
def get_issue(self, number):
        
        assert isinstance(number, (int, long)), number
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/issues/" + str(number)
        )
        return github.Issue.Issue(self._requester, headers, data, completed=True)
895867
def list_connections(self, status=None):
        '''  '''
        if status is None:
            status = 'ALL'
        response, status_code = self.__pod__.Connection.get_v1_connection_list(
            sessionToken=self.__session__,
            status=status
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
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}
394812
def relevent_issue(issue, after):
    """"""
    return (closed_issue(issue, after) and
            issue_completed(issue) and
            issue_section(issue))
208812
def relevant_issues(issues, after):
    """"""
    logging.info('finding relevant issues after {}...'.format(after))
    seen = set()
    for issue in issues:
        if relevent_issue(issue, after) and issue['title'] not in seen:
            seen.add(issue['title'])
            yield issue
1246905
def get_issuers(self):
        
        issuers = []

        message_issuer_nodes = OneLogin_Saml2_Utils.query(self.document, '/samlp:Response/saml:Issuer')
        if len(message_issuer_nodes) > 0:
            if len(message_issuer_nodes) == 1:
                issuers.append(OneLogin_Saml2_Utils.element_text(message_issuer_nodes[0]))
            else:
                raise OneLogin_Saml2_ValidationError(
                    'Issuer of the Response is multiple.',
                    OneLogin_Saml2_ValidationError.ISSUER_MULTIPLE_IN_RESPONSE
                )

        assertion_issuer_nodes = self.__query_assertion('/saml:Issuer')
        if len(assertion_issuer_nodes) == 1:
            issuers.append(OneLogin_Saml2_Utils.element_text(assertion_issuer_nodes[0]))
        else:
            raise OneLogin_Saml2_ValidationError(
                'Issuer of the Assertion not found or multiple.',
                OneLogin_Saml2_ValidationError.ISSUER_NOT_FOUND_IN_ASSERTION
            )

        return list(set(issuers))
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'])
            )