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

        contributors = []
        for credit in primary_credits:
            contributor = credit.contributor
            if contributor.is_permitted:
                contributors.append(contributor)

        return contributors
934883
def master_primary_name(self) -> Optional[str]:
        

        master_primary_name = self.master_replica.primaryName
        if master_primary_name:
            return self.master_replica.getNodeName(master_primary_name)
        return None
696094
def is_primary(self):
        
        return bool(next(iter(self.selfsig._signature.subpackets['h_PrimaryUserID']), False))
1207147
def members_entries(self, all_are_optional: bool=False) -> List[Tuple[str, str]]:
        
        rval = []
        if self._members:
            for member in self._members:
                rval += member.members_entries(all_are_optional)
        elif self._choices:
            for choice in self._choices:
                rval += self._context.reference(choice).members_entries(True)
        else:
            return []
        return rval
1033990
def participants(self):
        
        if self._participants is None:
            self._participants = ParticipantList(self._version, room_sid=self._solution['sid'], )
        return self._participants
1230388
def get_secondary_count(context, default=0):
    
    if not is_ar(context):
        return default

    primary = context.getPrimaryAnalysisRequest()

    if not primary:
        return default

    return len(primary.getSecondaryAnalysisRequests())
557424
def given(self):
        """"""
        if self._primary.value[0] and self._primary.value[2]:
            return self._primary.value[0] + ' ' + self._primary.value[2]
        return self._primary.value[0] or self._primary.value[2]
897905
def primary_measures(self):
        
        from ambry.valuetype.core import ROLE

        for c in self.columns:

            if not c.parent and c.role == ROLE.MEASURE:
                    yield c
1299789
def make_primary(self, user, identity):
        
        return UserIdentityRequest(self).put(self.endpoint.make_primary, user, identity)
1173632
def all_contributors(soup, detail="brief"):
    ""
    contrib_tags = raw_parser.contributors(soup)
    contributors = format_authors(soup, contrib_tags, detail)
    return contributors
450457
protected List<CmsPrincipal> getPrincipals(boolean includeOtherOus) throws CmsException {

        String ou = getCms().getRequestContext().getCurrentUser().getOuFqn();
        Set<CmsPrincipal> principals = new HashSet<CmsPrincipal>();
        boolean realOnly = Boolean.valueOf(getParamRealonly()).booleanValue();
        if (isShowingUsers()) {
            // include special principals
            if (!realOnly) {
                if (OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER)) {
                    CmsUser user = new CmsUser(
                        CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID,
                        key(Messages.GUI_LABEL_OVERWRITEALL_0),
                        "",
                        "",
                        "",
                        "",
                        0,
                        0,
                        0,
                        null);
                    user.setDescription(key(Messages.GUI_DESCRIPTION_OVERWRITEALL_0));
                    principals.add(user);
                }
                CmsUser user = new CmsUser(
                    CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID,
                    key(Messages.GUI_LABEL_ALLOTHERS_0),
                    "",
                    "",
                    "",
                    "",
                    0,
                    0,
                    0,
                    null);
                user.setDescription(key(Messages.GUI_DESCRIPTION_ALLOTHERS_0));
                principals.add(user);
            }
            if (includeOtherOus) {
                // add all manageable users
                principals.addAll(OpenCms.getRoleManager().getManageableUsers(getCms(), "", true));
                // add own ou users
                principals.addAll(OpenCms.getOrgUnitManager().getUsers(getCms(), ou, true));
            } else {
                // add own ou users
                principals.addAll(OpenCms.getOrgUnitManager().getUsers(getCms(), ou, false));
            }
        } else {
            // include special principals
            if (!realOnly) {
                if (OpenCms.getRoleManager().hasRole(getCms(), CmsRole.VFS_MANAGER)) {
                    principals.add(
                        new CmsGroup(
                            CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_ID,
                            null,
                            key(Messages.GUI_LABEL_OVERWRITEALL_0),
                            key(Messages.GUI_DESCRIPTION_OVERWRITEALL_0),
                            0));
                }
                principals.add(
                    new CmsGroup(
                        CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID,
                        null,
                        key(Messages.GUI_LABEL_ALLOTHERS_0),
                        key(Messages.GUI_DESCRIPTION_ALLOTHERS_0),
                        0));
            }
            if (includeOtherOus) {
                // add all manageable users
                principals.addAll(OpenCms.getRoleManager().getManageableGroups(getCms(), "", true));
                // add own ou users
                principals.addAll(OpenCms.getOrgUnitManager().getGroups(getCms(), ou, true));
            } else {
                // add own ou users
                principals.addAll(OpenCms.getOrgUnitManager().getGroups(getCms(), ou, false));
            }
        }
        List<CmsPrincipal> ret = new ArrayList<CmsPrincipal>(principals);
        if (getParamFlags() != null) {
            int flags = Integer.parseInt(getParamFlags());
            return new ArrayList<CmsPrincipal>(CmsPrincipal.filterFlag(ret, flags));
        }
        return ret;
    }
1250360
def people(self):
        
        return fields.ListField(name=HightonConstants.PEOPLE, init_class=Person).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/people',
                ).text
            )
        )
1342416
def primary_source
      return :ldap if using_ldap? && !using_db?
      return :db if using_db? && !using_ldap?

      source = @options[:primary_source]
      source = source.to_sym if source.is_a?(String)

      return source if [:ldap, :db].include?(source)

      return :ldap if using_ldap?

      :db
    end
916106
def contributions(self):
        """"""
        if self._contributions is None:
            self._contributions = self.contributor.contributions.filter(
                content__published__gte=self.start,
                content__published__lt=self.end
            )
        return self._contributions
402669
public function get_contributor($key = 0)
	{
		$contributors = $this->get_contributors();
		if (isset($contributors[$key]))
		{
			return $contributors[$key];
		}
		else
		{
			return null;
		}
	}
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;
    }
26926
def get_public_members(self):
        
        return github.PaginatedList.PaginatedList(
            github.NamedUser.NamedUser,
            self._requester,
            self.url + "/public_members",
            None
        )