List users in specified environments
500646
def list_users(self, envs=[], query="/users/"):
        
        juicer.utils.Log.log_debug(
                "List Users In: %s", ", ".join(envs))
        for env in envs:
            juicer.utils.Log.log_info("%s:" % (env))
            _r = self.connectors[env].get(query)
            if _r.status_code == Constants.PULP_GET_OK:
                for user in juicer.utils.load_json_str(_r.content):
                    roles = user['roles']
                    if roles:
                        user_roles = ', '.join(roles)
                    else:
                        user_roles = "None"
                    juicer.utils.Log.log_info("\t%s - %s" % (user['login'], user_roles))
            else:
                _r.raise_for_status()
        return True
367514
def getUsers(context, roles, allow_empty=True):
    
    mtool = getToolByName(context, 'portal_membership')
    pairs = allow_empty and [['', '']] or []
    users = mtool.searchForMembers(roles=roles)
    for user in users:
        uid = user.getId()
        fullname = user.getProperty('fullname')
        if not fullname:
            fullname = uid
        pairs.append((uid, fullname))
    pairs.sort(lambda x, y: cmp(x[1], y[1]))
    return DisplayList(pairs)
214914
public function listAction() {
        $this->writeln("Here is a list of the available environments:");
        foreach(ConfigService::getAllEnvironments() as $env) {
            $this->writeln(" - ".$env);
        }
    }
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))
1070460
def list_members(context, request):
    """"""
    members = context.members()
    return {
        'users': [{
            'username': m.identifier,
            'userid': m.userid,
            'roles': context.get_member_roles(m.userid),
            'links': [rellink(m, request)]
        } for m in members]
    }
721157
def index(credentials=None):
        """"""
        user, oauth_access_token = parsecredentials(credentials)
        if not settings.ADMINS or user not in settings.ADMINS:
            return flask.make_response('You shall not pass!!! You are not an administrator!',403)

        usersprojects = {}
        totalsize = {}
        for f in glob.glob(settings.ROOT + "projects/*"):
            if os.path.isdir(f):
                u = os.path.basename(f)
                usersprojects[u], totalsize[u] = getprojects(u)
                usersprojects[u].sort()

        return withheaders(flask.make_response(flask.render_template('admin.html',
                version=VERSION,
                system_id=settings.SYSTEM_ID,
                system_name=settings.SYSTEM_NAME,
                system_description=settings.SYSTEM_DESCRIPTION,
                system_author=settings.SYSTEM_AUTHOR,
                system_version=settings.SYSTEM_VERSION,
                system_email=settings.SYSTEM_EMAIL,
                user=user,
                url=getrooturl(),
                usersprojects = sorted(usersprojects.items()),
                totalsize=totalsize,
                allow_origin=settings.ALLOW_ORIGIN,
                oauth_access_token=oauth_encrypt(oauth_access_token)
        )), "text/html; charset=UTF-8", {'allow_origin':settings.ALLOW_ORIGIN})
870866
def GetConfiguredUsers(self):
    
    if os.path.exists(self.google_users_file):
      users = open(self.google_users_file).readlines()
    else:
      users = []
    return [user.strip() for user in users]
1113771
def list_users(self, pattern=None):
        
        request_url = "{}/api/0/users".format(self.instance)
        params = None
        if pattern:
            params = {'pattern': pattern}
        return_value = self._call_api(request_url, params=params)
        return return_value['users']
55585
def _site_users():
    
    userlist = sudo("cat /etc/passwd | awk '/site/'").split('\n')
    siteuserlist = [user.split(':')[0] for user in userlist if 'site_' in user]
    return siteuserlist
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
1287536
def get_users_in_project(self, projectname):
        
        cmd = ["list", "assoc", "where", "account=%s" % projectname]
        results = self._read_output(cmd)

        user_list = []
        for result in results:
            if result["User"] != "":
                user_list.append(result["User"])
        return user_list
1279470
def list_users(self):
        
        lines = output_lines(self.exec_rabbitmqctl_list('users'))
        return [_parse_rabbitmq_user(line) for line in lines]
805152
def db_list(user=None, host=None, port=None, maintenance_db=None,
            password=None, runas=None):
    '''
    
    '''

    ret = {}

    query = (
        'SELECT datname as "Name", pga.rolname as "Owner", '
        'pg_encoding_to_char(encoding) as "Encoding", '
        'datcollate as "Collate", datctype as "Ctype", '
        'datacl as "Access privileges", spcname as "Tablespace" '
        'FROM pg_database pgd, pg_roles pga, pg_tablespace pgts '
        'WHERE pga.oid = pgd.datdba AND pgts.oid = pgd.dattablespace'
    )

    rows = psql_query(query, runas=runas, host=host, user=user,
                      port=port, maintenance_db=maintenance_db,
                      password=password)

    for row in rows:
        ret[row['Name']] = row
        ret[row['Name']].pop('Name')

    return ret
585294
def list_users(profile="splunk"):
    '''
    
    '''

    config = __salt__['config.option'](profile)
    key = "splunk.users.{0}".format(
        config.get('host')
    )

    if key not in __context__:
        _populate_cache(profile)

    return __context__[key]
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
1220681
def users_list(self, *args):
        """"""
        if len(self._users) == 0:
            self.log('No users connected')
        else:
            self.log(self._users, pretty=True)
762962
def user_list(self, params=None):
        """"""

        uri = 'openstack/users'
        if params:
            uri += '?%s' % urllib.urlencode(params)

        resp, body = self.get(uri)
        self.expected_success(200, resp.status)
        body = json.loads(body)
        return rest_client.ResponseBody(resp, body)