Returns an array of information for filtered users
963124
function users_info($username=NULL, $fields=NULL, $groups_filtering = '')
	{
		$entries = array();
		$entries['count'] = 0; // To be compatible with the old data organisation (counter at the beginning)
		$i = 0;
		if ($result = $this->one_user_info(TRUE, $username, $fields, FALSE, $groups_filtering)) {
			do {
				$entries[$i] = $result;
				$i++;
			} while ($result = $this->one_user_info());
		}
		$entries['count'] = $i; // and not count($entries) because of the ['count'] argument
        return ($entries);
    }
1194892
def list_users(verbose=True, hashes=False):
    '''
    
    '''
    users = {} if verbose else []

    if verbose:
        # parse detailed user data
        res = __salt__['cmd.run_all'](
            'pdbedit --list --verbose {hashes}'.format(hashes="--smbpasswd-style" if hashes else ""),
        )

        if res['retcode'] > 0:
            log.error(res['stderr'] if 'stderr' in res else res['stdout'])
            return users

        user_data = {}
        for user in res['stdout'].splitlines():
            if user.startswith('-'):
                if 'unix username' in user_data:
                    users[user_data['unix username']] = user_data
                user_data = {}
            elif ':' in user:
                label = user[:user.index(':')].strip().lower()
                data = user[(user.index(':')+1):].strip()
                user_data[label] = data

        if user_data:
            users[user_data['unix username']] = user_data
    else:
        # list users
        res = __salt__['cmd.run_all']('pdbedit --list')

        if res['retcode'] > 0:
            return {'Error': res['stderr'] if 'stderr' in res else res['stdout']}

        for user in res['stdout'].splitlines():
            if ':' not in user:
                continue
            user_data = user.split(':')
            if len(user_data) >= 3:
                users.append(user_data[0])

    return users
327202
function GetDetailedUsersArray()
  {
      $users_array = array();
      $result = $this->GetNextUserArray(TRUE);
      if (isset($result['user'])) {
          $users_array[$result['user']] = $result;
      }
      do {
          if ($result = $this->GetNextUserArray()) {
              if (isset($result['user'])) {
                  $users_array[$result['user']] = $result;
              }
          }
      } while (FALSE !== $result);
      return $users_array;
  }
1094816
def get_user_roles(user):
    """"""
    if user:
        groups = user.groups.all()   # Important! all() query may be cached on User with prefetch_related.
        roles = (RolesManager.retrieve_role(group.name) for group in groups if group.name in RolesManager.get_roles_names())
        return sorted(roles, key=lambda r: r.get_name() )
    else:
        return []
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]
599729
def get_personal_info(user):
    """"""
    # change this to not use other_phones
    num_phones = len(user.phones.all() or [])
    num_emails = len(user.emails.all() or [])
    num_websites = len(user.websites.all() or [])

    personal_info = {}

    for i in range(num_phones):
        personal_info["phone_{}".format(i)] = user.phones.all()[i]

    for i in range(num_emails):
        personal_info["email_{}".format(i)] = user.emails.all()[i]

    for i in range(num_websites):
        personal_info["website_{}".format(i)] = user.websites.all()[i]

    num_fields = {"phones": num_phones, "emails": num_emails, "websites": num_websites}

    return personal_info, num_fields
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")
843328
def filter_by_user(self, user):
        """"""

        return self.filter(Q(users=user) | Q(groups__in=user.groups.all()))
540726
def users(self):
        
        return sa.orm.relationship(
            "User",
            secondary="users_resources_permissions",
            passive_deletes=True,
            passive_updates=True,
        )
623551
def get_course_registered_users(self, course, with_admins=True):
        

        l = [entry['students'] for entry in list(self._database.aggregations.aggregate([
            {"$match": {"courseid": course.get_id()}},
            {"$unwind": "$students"},
            {"$project": {"_id": 0, "students": 1}}
        ]))]
        if with_admins:
            return list(set(l + course.get_staff()))
        else:
            return l
1342931
def _get_user_groups(session, user_id, filter):
        
        return session.fetch_items('groups.get', Group.from_json, count=1000, user_id=user_id, filter=filter, extended=1, fields=",".join(Group.GROUP_FIELDS))
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)
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]
    }
188370
private function getUsersPermissions()
    {
        return [
            [
                'name'        => 'Users - List all users',
                'description' => 'Allow to list all users.',
                'slug'        => UsersPolicy::PERMISSION_LIST,
            ],
            [
                'name'        => 'Users - View a user',
                'description' => 'Allow to view a user\'s details.',
                'slug'        => UsersPolicy::PERMISSION_SHOW,
            ],
            [
                'name'        => 'Users - Add/Create a user',
                'description' => 'Allow to create a new user.',
                'slug'        => UsersPolicy::PERMISSION_CREATE,
            ],
            [
                'name'        => 'Users - Edit/Update a user',
                'description' => 'Allow to update a user.',
                'slug'        => UsersPolicy::PERMISSION_UPDATE,
            ],
            [
                'name'        => 'Users - Delete a user',
                'description' => 'Allow to delete a user.',
                'slug'        => UsersPolicy::PERMISSION_DELETE,
            ],
        ];
    }
59675
def get_by_user(cls, user_id, with_deleted=False):
        """"""
        query = cls.query.filter_by(
            id_user=user_id
        )
        if not with_deleted:
            query = query.filter(cls.deleted_at.is_(None))

        return query.order_by(db.asc(Community.title))
1173460
def filtered_entries
      return [] unless exists?

      @filtered_entries ||=
        Dir.chdir(directory) do
          entry_filter.filter(entries).reject do |f|
            path = collection_dir(f)
            File.directory?(path) || entry_filter.symlink?(f)
          end
        end
    end
352685
def get(self, user_ids=None, usernames=None, status=None):
        
        return self.connection.get('user/array',
                                   user_ids=user_ids,
                                   usernames=usernames,
                                   status=status)