Select users by logins, including disabled users. An empty list is returned
if list of logins is empty, without any db round trips.
437812
public List<UserDto> selectByLogins(DbSession session, Collection<String> logins) {
    return executeLargeInputs(logins, mapper(session)::selectByLogins);
  }
980599
def check_guest_exist(check_index=0):
    

    def outer(f):
        @six.wraps(f)
        def inner(self, *args, **kw):
            userids = args[check_index]

            if isinstance(userids, list):
                # convert all userids to upper case
                userids = [uid.upper() for uid in userids]
                new_args = (args[:check_index] + (userids,) +
                            args[check_index + 1:])
            else:
                # convert the userid to upper case
                userids = userids.upper()
                new_args = (args[:check_index] + (userids,) +
                            args[check_index + 1:])
                userids = [userids]

            self._vmops.check_guests_exist_in_db(userids)

            return f(self, *new_args, **kw)
        return inner
    return outer
1048799
def list_users(root=None):
    '''
    
    '''
    if root is not None and __grains__['kernel'] != 'AIX':
        getpwall = functools.partial(_getpwall, root=root)
    else:
        getpwall = functools.partial(pwd.getpwall)

    return sorted([user.pw_name for user in getpwall()])
811378
def by_user_and_perm(cls, user_id, perm_name, db_session=None):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model).filter(cls.model.user_id == user_id)
        query = query.filter(cls.model.perm_name == perm_name)
        return query.first()
72901
def list_users():
    '''
    
    '''
    res = 0
    user_list = []
    dowhile = True
    try:
        while res or dowhile:
            dowhile = False
            (users, _, res) = win32net.NetUserEnum(
                None,
                0,
                win32netcon.FILTER_NORMAL_ACCOUNT,
                res,
                win32netcon.MAX_PREFERRED_LENGTH
            )
            for user in users:
                user_list.append(user['name'])
        return user_list
    except win32net.error:
        pass
1330163
def who(self, *args):
        """"""
        if len(self._users) == 0:
            self.log('No users connected')
            if len(self._clients) == 0:
                self.log('No clients connected')
                return

        Row = namedtuple("Row", ['User', 'Client', 'IP'])
        rows = []

        for user in self._users.values():
            for key, client in self._clients.items():
                if client.useruuid == user.uuid:
                    row = Row(user.account.name, key, client.ip)
                    rows.append(row)

        for key, client in self._clients.items():
            if client.useruuid is None:
                row = Row('ANON', key, client.ip)
                rows.append(row)

        self.log("\n" + std_table(rows))
976801
def list_users(self):
        
        lines = output_lines(self.exec_psql('\\du'))
        return [line.split('|') for line in lines]
789272
def list_users(self):
        
        crypt = self._decrypt_file()

        self.logger.info(crypt.stderr)
        raw_userlist = crypt.stderr.split('\n')
        userlist = list()
        for index, line in enumerate(raw_userlist):
            if 'gpg: encrypted' in line:
                m = re.search('ID (\w+)', line)
                keyid = m.group(1).strip()
                userline = raw_userlist[index+1].strip()
                userlist.append((keyid, userline))
        return userlist
391457
def get_valid_users(request):
    "
    users = [get_user(request)]
    if settings.LOCKDOWN and hasattr(request, 'user'):
        if request.user.is_authenticated:
            groups = request.user.groups.all()
            if groups:
                users = list(User.objects.filter(groups__in=groups)
                             .values_list('username', flat=True))
        else:
            # This may happen with crafted requests
            users = []
    return users
1014785
public List<UserDto> selectByUuids(DbSession session, Collection<String> uuids) {
    return executeLargeInputs(uuids, mapper(session)::selectByUuids);
  }
552014
async def get_users(self, include_disabled=False):
        
        client_facade = client.UserManagerFacade.from_connection(
            self.connection())
        response = await client_facade.UserInfo(None, include_disabled)
        return [User(self, r.result) for r in response.results]
1127734
def list(self, **filters):
        
        LOG.debug(u'Querying %s by filters=%s', self.model_class.__name__, filters)
        query = self.__queryset__()
        perm = build_permission_name(self.model_class, 'view')
        LOG.debug(u"Checking if user %s has_perm %s" % (self.user, perm))
        query_with_permission = filter(lambda o: self.user.has_perm(perm, obj=o), query)
        ids = map(lambda o: o.pk, query_with_permission)

        # FIXME: Return to query again without use database
        queryset = self.__queryset__().filter(pk__in=ids)
        related = getattr(self, 'select_related', None)
        if related:
            queryset = queryset.select_related(*related)

        return queryset
425927
@Override
    public List<User> findUsers() {
        List<User> userList;
        try {
            userList = createUsers(ldapDao.getDirectChildren(DnFactory.users()));
        } catch (NoSuchNodeException | MissingParentException e) {
            LOGGER.error("LDAP exception", e);
            throw new LdapRuntimeException(e);
        }
        return userList;
    }
851744
def _get_maps_from_user(self, user):
        
        req = Session.query(Map).select_from(join(Map, User))
        return req.filter(User.login==user).all()
417763
def data_in_db(db_data, user_data):
        
        if isinstance(user_data, list):
            if db_data in user_data:
                return True
        return False
762073
def get_users(self):
        
        output = []
        self.con.execute('SELECT userId, uid FROM archive_users;')
        results = self.con.fetchall()

        for result in results:
            # Fetch list of roles
            self.con.execute('SELECT name FROM archive_roles r INNER JOIN archive_user_roles u ON u.roleId=r.uid '
                             'WHERE u.userId = %s;', (result['uid'],))
            role_list = [row['name'] for row in self.con.fetchall()]
            output.append(mp.User(user_id=result['userId'], roles=role_list))
        return output
609224
def listIterators(self, login, tableName):
    
    self.send_listIterators(login, tableName)
    return self.recv_listIterators()