Returns the number of present/absent members.
431642
def count(self, value=True):
        """"""
        if value not in (True, False):
            raise ValueError('can only count True or False, not %r' % (value,))
        return bin(self)[2:].count('01'[value])
286420
def host_members(self):
        '''
        '''
        host = self.host()
        if host is None:
            return
        for member, full_member in host.members_objects:
            yield full_member
1105952
def num_signups(self):
        """"""
        return EighthSignup.objects.filter(scheduled_activity__block=self, user__in=User.objects.get_students()).count()
273851
def is_member(self, m):
        """"""
        if not m:
            return False
        elif isinstance(m, basestring):
            jid = m
        else:
            jid = m['JID']

        is_member = len(filter(lambda m: m['JID'] == jid and m.get('STATUS') in ('ACTIVE', 'INVITED'), self.params['MEMBERS'])) > 0

        return is_member
603446
def members(self):
        
        res = [self]
        for c in list(self.children.values()):
            res.extend(c.members)
        return res
1316576
def get_viewable_members(self, user=None):
        
        members = []
        for member in self.members.all():
            show = False
            if member.can_view_eighth:
                show = member.can_view_eighth

            if not show and user and user.is_eighth_admin:
                show = True
            if not show and user and user.is_teacher:
                show = True
            if not show and member == user:
                show = True

            if show:
                members.append(member)

        return sorted(members, key=lambda u: (u.last_name, u.first_name))
112073
public int getUnknownCameraCount() {
		int total = 0;
		for (int i = 0; i < cameras.length; i++) {
			if( !cameras[i].known) {
				total++;
			}
		}
		return total;
	}
106729
def element_count(self):
        
        result = conf.lib.clang_getNumElements(self)
        if result < 0:
            raise Exception('Type does not have elements.')

        return result
849447
def visibleCount(self):
        
        return sum(int(not self.item(i).isHidden()) for i in range(self.count()))
1283515
def getmembers(self):
        
        self._check()
        if not self._loaded:    # if we want to obtain a list of
            self._load()        # all members, we first have to
                                # scan the whole archive.
        return self.members
248622
def numRegisteredByRole(self):
        '''
        
        '''
        role_list = list(self.availableRoles) + [None,]
        return {getattr(x,'name',None):self.numRegisteredForRole(x) for x in role_list}
1188706
def count(self):
        '''
        
        '''
        args = self.format_args
        if args is None or \
                (isinstance(args, dict) and self.count_field not in args):
            raise TypeError("count is required")
        return args[self.count_field] if isinstance(args, dict) else args
1031751
def absence_info(self):
        """"""
        # FIXME: remove recursive dep
        from ..eighth.models import EighthSignup

        return EighthSignup.objects.filter(user=self, was_absent=True, scheduled_activity__attendance_taken=True)
888556
def current(self):
        
        if not self.started:
            return None
        return count_group(self.group, cached=self.cached)
1001244
def large(self):
        
        if self._large is None:
            try:
                return self._member_count >= 250
            except AttributeError:
                return len(self._members) >= 250
        return self._large
490541
def members(self):
        
        if self._members is None:
            self._members = Feed(self.links["members"], pypump=self._pump)
        return self._members
1331186
public function get_children_count() {
        $sortedids = self::get_tree($this->id);
        $invisibleids = $this->get_not_visible_children_ids();
        return count($sortedids) - count($invisibleids);
    }