Returns the active users (at most 3) who are associated to the given SCM account. This method can be used
to detect user conflicts.
181743
public List<UserDoc> getAtMostThreeActiveUsersForScmAccount(String scmAccount, String organizationUuid) {
    List<UserDoc> result = new ArrayList<>();
    if (!StringUtils.isEmpty(scmAccount)) {
      SearchRequestBuilder request = esClient.prepareSearch(UserIndexDefinition.TYPE_USER)
        .setQuery(boolQuery().must(matchAllQuery()).filter(
          boolQuery()
            .must(termQuery(FIELD_ACTIVE, true))
            .must(termQuery(FIELD_ORGANIZATION_UUIDS, organizationUuid))
            .should(termQuery(FIELD_LOGIN, scmAccount))
            .should(matchQuery(SORTABLE_ANALYZER.subField(FIELD_EMAIL), scmAccount))
            .should(matchQuery(SORTABLE_ANALYZER.subField(FIELD_SCM_ACCOUNTS), scmAccount))))
        .setSize(3);
      for (SearchHit hit : request.get().getHits().getHits()) {
        result.add(new UserDoc(hit.getSourceAsMap()));
      }
    }
    return result;
  }
913550
def get_users(self, fetch=True):
        """"""
        return Users(self.resource.users, self.client, populate=fetch)
1001636
def get_user_tenants(user, group):
    """"""
    if user.is_active and user.is_authenticated():
        if user.is_superuser or is_group_manager(user, group.pk):
            return Tenant.objects.filter(group=group)
        else:
            return Tenant.objects.filter(group=group, tenantrole__user=user).distinct()
    else:
        return Tenant.objects.none()
445975
def existing_users(context):
    
    members = IWorkspace(context).members
    info = []
    for userid, details in members.items():
        user = api.user.get(userid)
        if user is None:
            continue
        user = user.getUser()
        title = user.getProperty('fullname') or user.getId() or userid
        # XXX tbd, we don't know what a persons description is, yet
        description = _(u'Here we could have a nice status of this person')
        classes = description and 'has-description' or 'has-no-description'
        portal = api.portal.get()
        portrait = '%s/portal_memberdata/portraits/%s' % \
                   (portal.absolute_url(), userid)
        info.append(
            dict(
                id=userid,
                title=title,
                description=description,
                portrait=portrait,
                cls=classes,
                member=True,
                admin='Admins' in details['groups'],
            )
        )

    return info
1248869
def get_active_threads_involving_all_participants(self, *participant_ids):
        

        query = Thread.objects.\
            exclude(participation__date_left__lte=now()).\
            annotate(count_participants=Count('participants')).\
            filter(count_participants=len(participant_ids))

        for participant_id in participant_ids:
            query = query.filter(participants__id=participant_id)

        return query.distinct()
152103
public List<CmsUser> getVisibleUser() {

        if (!m_fullyLoaded) {
            return m_users;
        }
        if (size() == m_users.size()) {
            return m_users;
        }
        List<CmsUser> directs = new ArrayList<CmsUser>();
        for (CmsUser user : m_users) {
            if (!m_indirects.contains(user)) {
                directs.add(user);
            }
        }
        return directs;
    }
1240227
def get_users(self, filter=None, sortBy=None, sortOrder=None,
            startIndex=None, count=None):
        
        self.assert_has_permission('scim.read')

        params = {}
        if filter:
            params['filter'] = filter

        if sortBy:
            params['sortBy'] = sortBy

        if sortOrder:
            params['sortOrder'] = sortOrder

        if startIndex:
            params['startIndex'] = startIndex

        if count:
            params['count'] = count

        return self._get(self.uri + '/Users', params=params)
4497
def has_in_members(self, member):
        
        assert isinstance(member, github.NamedUser.NamedUser), member
        status, headers, data = self._requester.requestJson(
            "GET",
            self.url + "/members/" + member._identity
        )
        return status == 204
901538
public List<RaftMemberContext> getActiveMemberStates(Comparator<RaftMemberContext> comparator) {
    List<RaftMemberContext> activeMembers = new ArrayList<>(getActiveMemberStates());
    activeMembers.sort(comparator);
    return activeMembers;
  }
1119936
def check_membership(self, groups):
        '''  '''
        if not groups or groups == ['']:
            return True
        if self.request.user.is_superuser:
            return True
        user_groups = self.request.user.groups.values_list("name", flat=True)
        return set(groups).intersection(set(user_groups))
1076758
def user_in_all_groups(user, groups):
    """"""
    return user_is_superuser(user) or all(user_in_group(user, group) for group in groups)
644144
def get_subaccounts(self):
        """"""
        method = 'GET'
        endpoint = '/rest/v1/users/{}/list-subaccounts'.format(
            self.client.sauce_username)
        return self.client.request(method, endpoint)
976801
def list_users(self):
        
        lines = output_lines(self.exec_psql('\\du'))
        return [line.split('|') for line in lines]
727263
@Override
    public boolean isAccountActive(String account) throws AccountCredentialsNotFoundException {
        AccountInfo info = this.accountRepo.findBySubdomain(account);
        if (info == null) {
            throw new AccountCredentialsNotFoundException("no account found where accountId =  " + account);
        }
        return info.getStatus().equals(AccountStatus.ACTIVE);
    }
392353
public java.util.List<User> getUsers() {
        if (users == null) {
            users = new com.amazonaws.internal.SdkInternalList<User>();
        }
        return users;
    }
1142480
def members(self):
        
        if self._members is None:
            self._members = MemberList(
                self._version,
                service_sid=self._solution['service_sid'],
                channel_sid=self._solution['sid'],
            )
        return self._members
480099
def get_users_for_assigned_to():
    
    User = get_user_model()
    return User.objects.filter(is_active=True, is_staff=True)