Returns a list of primary contributors, with primary being
        defined as those contributors that have the highest role
        assigned(in terms of priority).
19269
def get_primary_contributors(self, permitted=False):
        
        primary_credits = []
        credits = self.credits.exclude(
            credit_option=None, credit_option__role_priority=None
        ).order_by('credit_option__role_priority')
        if credits.exists():
            primary_priority = credits[0].credit_option.role_priority
            for credit in credits:
                if credit.credit_option.role_priority == primary_priority:
                    primary_credits.append(credit)

        contributors = []
        for credit in primary_credits:
            contributor = credit.contributor
            if (permitted == False) or \
                ((permitted == True) and contributor.is_permitted):
                contributors.append(contributor)

        return contributors
1173632
def all_contributors(soup, detail="brief"):
    ""
    contrib_tags = raw_parser.contributors(soup)
    contributors = format_authors(soup, contrib_tags, detail)
    return contributors
1007997
def primary_keys(self):
        """"""
        res = []
        for column in self.column_definitions:
            if 'primary_key' in column.keys():
                tmp = column.get('primary_key', None)
                res.append(column['name']) if tmp else False
        return res
549502
public Priority[] getPriorities() {
        List<Priority> actualPriorities = new ArrayList<Priority>();
        for (String priority : getAvailablePriorities()) {
            if (provider.getNumberOfAnnotations(priority) > 0) {
                actualPriorities.add(Priority.fromString(priority));
            }
        }
        return actualPriorities.toArray(new Priority[actualPriorities.size()]);
    }
966382
def primary_stat
      @primary_stat ||= manifest.stats.filter(primary: true).with_context([self]).map { |name, value| [name, value] }.first&.last
    end
109642
def get_contributors(self):
        """"""
        return User.objects.filter(
            freelanceprofile__is_freelance=True
        ).filter(
            contributions__content__published__gte=self.start,
            contributions__content__published__lt=self.end
        ).distinct()
913326
def contributors(options = {})
      raise ArgumentError, 'You must provide a :cid option' if options[:cid].nil? || options[:cid].empty?
      options.merge!({:method => 'candContrib'})
      self.class.get("/", :query => options)
    end
873135
private Principal selectedPrincipal() {
        if (browseByColumn.getSelectedItem().getTitle().equals(Console.CONSTANTS.common_label_users())) {
            return userColumn.getSelectedItem();
        } else if (browseByColumn.getSelectedItem().getTitle().equals(Console.CONSTANTS.common_label_groups())) {
            return groupColumn.getSelectedItem();
        }
        return null;
    }
1026138
def _primary_input(self, index):
        '''
        
        '''
        primary_input = z.ZcashByteData()
        primary_input += self.tx_joinsplits[index].anchor
        primary_input += self.tx_joinsplits[index].nullifiers
        primary_input += self.tx_joinsplits[index].commitments
        primary_input += self.tx_joinsplits[index].vpub_old
        primary_input += self.tx_joinsplits[index].vpub_new
        primary_input += self.hsigs[index]
        primary_input += self.tx_joinsplits[index].vmacs
        return primary_input.to_bytes()
407795
def list_users(self, user=None):
    '''
    ''' 
    from expfactory.database.models import Participant
    participants = Participant.query.all()
    users = []
    for user in participants:
        users.append(self.print_user(user))
    return users
24449
def user_roles(self):
        
        # We do here some lazy loading.
        if not self._user_roles:
            self._user_roles = UserRoleManager(self)
        return self._user_roles
817593
def priorities(self):
        
        r_json = self._get_json('priority')
        priorities = [Priority(
            self._options, self._session, raw_priority_json) for raw_priority_json in r_json]
        return priorities
221397
def build_contributors(authors, contrib_type, competing_interests=None):
    

    contributors = []

    for author in authors:
        contributor = None
        author_contrib_type = contrib_type

        surname = author.get("surname")
        given_name = author.get("given-names")
        collab = author.get("collab")

        # Small hack for on-behalf-of type when building authors
        #  use on-behalf-of as the contrib_type
        if author.get("type") and author.get("type") == "on-behalf-of":
            collab = author.get("on-behalf-of")
            author_contrib_type = "on-behalf-of"

        if surname or collab:
            contributor = ea.Contributor(author_contrib_type, surname, given_name, collab)

        utils.set_attr_if_value(contributor, 'suffix', author.get('suffix'))

        contributor.group_author_key = author.get("group-author-key")
        contributor.orcid = author.get("orcid")
        contributor.corresp = bool(author.get("corresp"))
        if author.get("equal-contrib") == "yes":
            contributor.equal_contrib = True

        # Add contributor affiliations
        for aff in author.get("affiliations", []):
            affiliation = ea.Affiliation()
            affiliation.text = utils.text_from_affiliation_elements(
                aff.get("dept"),
                aff.get("institution"),
                aff.get("city"),
                aff.get("country"))
            # fall back if no other fields are set take the text content
            if affiliation.text == '':
                affiliation.text = aff.get("text")
            contributor.set_affiliation(affiliation)

        # competing interests / conflicts
        if (competing_interests and author.get("references")
            and "competing-interest" in author.get("references")):
            for ref_id in author["references"]["competing-interest"]:
                for competing_interest in competing_interests:
                    if competing_interest.get("text") and competing_interest.get("id") == ref_id:
                        clean_text = utils.remove_tag('p', competing_interest.get("text"))
                        contributor.set_conflict(clean_text)

        # Finally add the contributor to the list
        if contributor:
            contributors.append(contributor)

    return contributors
1033990
def participants(self):
        
        if self._participants is None:
            self._participants = ParticipantList(self._version, room_sid=self._solution['sid'], )
        return self._participants
612782
def get_contributors(gh, repo_id):
    """"""
    try:
        # FIXME: Use `github3.Repository.contributors` to get this information
        contrib_url = gh.repository_with_id(repo_id).contributors_url

        r = requests.get(contrib_url)
        if r.status_code == 200:
            contributors = r.json()

            def get_author(contributor):
                r = requests.get(contributor['url'])
                if r.status_code == 200:
                    data = r.json()
                    return dict(
                        name=(data['name'] if 'name' in data and data['name']
                              else data['login']),
                        affiliation=data.get('company') or '',
                    )

            # Sort according to number of contributions
            contributors.sort(key=itemgetter('contributions'))
            contributors = [get_author(x) for x in reversed(contributors)
                            if x['type'] == 'User']
            contributors = filter(lambda x: x is not None, contributors)

            return contributors
    except Exception:
        return None
603416
public List<CandidateAnswer> getTopNCandidateAnswer(int topN) {
        List<CandidateAnswer> topNcandidateAnswers = new ArrayList<>();
        List<CandidateAnswer> allCandidateAnswers = getAllCandidateAnswer();
        if (topN > allCandidateAnswers.size()) {
            topN = allCandidateAnswers.size();
        }
        for (int i = 0; i < topN; i++) {
            topNcandidateAnswers.add(allCandidateAnswers.get(i));
        }
        return topNcandidateAnswers;
    }
1238299
def get_contributors(self, anon=github.GithubObject.NotSet):
        
        url_parameters = dict()
        if anon is not github.GithubObject.NotSet:
            url_parameters["anon"] = anon

        return github.PaginatedList.PaginatedList(
            github.NamedUser.NamedUser,
            self._requester,
            self.url + "/contributors",
            url_parameters
        )