List all locally known users
338152
def list_users(ctx, search, uuid, active):
    """"""

    users = ctx.obj['db'].objectmodels['user']

    for found_user in users.find():
        if not search or (search and search in found_user.name):
            # TODO: Not 2.x compatible
            print(found_user.name, end=' ' if active or uuid else '\n')
            if uuid:
                print(found_user.uuid, end=' ' if active else '\n')
            if active:
                print(found_user.active)

    log("Done")
1199304
def list_nodes(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The list_nodes function must be called with -f or --function.'
        )

    ret = {}
    items = query(action='ve')

    for item in items:
        name = item.attrib['name']
        node = show_instance(name, call='action')

        ret[name] = {
            'id': node['id'],
            'image': node['platform']['template-info']['name'],
            'state': node['state'],
        }
        if 'private-ip' in node['network']:
            ret[name]['private_ips'] = [node['network']['private-ip']]
        if 'public-ip' in node['network']:
            ret[name]['public_ips'] = [node['network']['public-ip']]

    return ret
685959
def user_list(**connection_args):
    '''
    
    '''
    dbc = _connect(**connection_args)
    if dbc is None:
        return []
    cur = dbc.cursor(MySQLdb.cursors.DictCursor)
    try:
        qry = 'SELECT User,Host FROM mysql.user'
        _execute(cur, qry)
    except MySQLdb.OperationalError as exc:
        err = 'MySQL Error {0}: {1}'.format(*exc.args)
        __context__['mysql.error'] = err
        log.error(err)
        return []
    results = cur.fetchall()
    log.debug(results)
    return results
506034
def list_silo_users
      r = execute(make_xml('MultiTenantUserListingRequest'), '1.2')
      arr = []
      if r.success
        r.res.elements.each('MultiTenantUserListingResponse/MultiTenantUserSummaries/MultiTenantUserSummary') do |user|
          arr << MultiTenantUserSummary.parse(user)
        end
      end
      arr
    end
92802
def fetchAllUsers(self, rawResults = False) :
        """"""
        r = self.connection.session.get(self.URL)
        if r.status_code == 200 :
            data = r.json()
            if rawResults :
                return data["result"]
            else :
                res = []
                for resu in data["result"] :
                    u = User(self, resu)
                    res.append(u)
                return res
        else :
            raise ConnectionError("Unable to get user list", r.url, r.status_code)
1337360
def marvcli_user_list():
    """"""
    app = create_app()
    for name in db.session.query(User.name).order_by(User.name):
        click.echo(name[0])
643815
function dm_user_list( $count = 20, $cursor = 0)
	{
		$params = array();
		$params['count'] = $count;
		$params['cursor'] = $cursor;
		return $this->oauth->get( 'direct_messages/user_list', $params );
	}
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']
1220681
def users_list(self, *args):
        """"""
        if len(self._users) == 0:
            self.log('No users connected')
        else:
            self.log(self._users, pretty=True)
951109
def _load_users(self):
        """"""
        r = sql.abstractRequetesSQL.get_users()()
        self.users = {d["id"]: dict(d) for d in r}
641742
def get_all_users(resource_root, view=None):
  
  return call(resource_root.get, USERS_PATH, ApiUser, True,
      params=view and dict(view=view) or None)
933470
def user_list(profile=None, **connection_args):
    '''
    
    '''
    kstone = auth(profile, **connection_args)
    ret = {}
    for user in kstone.users.list():
        ret[user.name] = dict((value, getattr(user, value, None)) for value in dir(user)
                              if not value.startswith('_') and
                              isinstance(getattr(user, value, None), (six.string_types, dict, bool)))
        tenant_id = getattr(user, 'tenantId', None)
        if tenant_id:
            ret[user.name]['tenant_id'] = tenant_id
    return ret
794041
def _get_local_users(self, disabled=None):
        '''
        
        '''
        users = dict()
        path = '/etc/passwd'
        with salt.utils.files.fopen(path, 'r') as fp_:
            for line in fp_:
                line = line.strip()
                if ':' not in line:
                    continue
                name, password, uid, gid, gecos, directory, shell = line.split(':')
                active = not (password == '*' or password.startswith('!'))
                if (disabled is False and active) or (disabled is True and not active) or disabled is None:
                    users[name] = {
                        'uid': uid,
                        'git': gid,
                        'info': gecos,
                        'home': directory,
                        'shell': shell,
                        'disabled': not active
                    }

        return users
1272643
def construct_user_list(raw_users=None):
        """"""
        users = Users(oktypes=User)
        for user_dict in raw_users:
            public_keys = None
            if user_dict.get('public_keys'):
                public_keys = [PublicKey(b64encoded=x, raw=None)
                               for x in user_dict.get('public_keys')]
            users.append(User(name=user_dict.get('name'),
                              passwd=user_dict.get('passwd'),
                              uid=user_dict.get('uid'),
                              gid=user_dict.get('gid'),
                              home_dir=user_dict.get('home_dir'),
                              gecos=user_dict.get('gecos'),
                              shell=user_dict.get('shell'),
                              public_keys=public_keys,
                              sudoers_entry=user_dict.get('sudoers_entry')))
        return 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
885685
def list_friends(self, delegate, user=None, params={}, extra_args=None, page_delegate=None):
        """"""
        if user:
            url = '/statuses/friends/' + user + '.xml'
        else:
            url = '/statuses/friends.xml'

        return self.__get_maybe_paging(url, delegate, params, txml.PagedUserList, extra_args, page_delegate)
1314633
def users_list(self, permission_set=None, role=None, **kwargs):
        ""
        api_path = "/api/v2/users.json"
        api_query = {}
        if "query" in kwargs.keys():
            api_query.update(kwargs["query"])
            del kwargs["query"]
        if permission_set:
            api_query.update({
                "permission_set": permission_set,
            })
        if role:
            api_query.update({
                "role": role,
            })
        return self.call(api_path, query=api_query, **kwargs)