\return The count of objects having this language as the initial/main one.
559745
function objectInitialCount()
    {
        $db = eZDB::instance();

        $languageID = $this->ID;
        $count = $db->arrayQuery( "SELECT COUNT(*) AS count FROM ezcontentobject WHERE initial_language_id = '$languageID'" );
        $count = $count[0]['count'];

        return $count;
    }
150230
public function count($mode = COUNT_NORMAL)
    {
        if($mode == COUNT_RECURSIVE)
        {
            $count = 0;
            $data  = $this->__options;
            foreach ($data as $key => $value)
            {
                if(is_array($value) || $value instanceof ObjectConfig)
                {
                    if ($value instanceof ObjectConfigInterface) {
                        $count += $value->count($mode);
                    } else {
                        $count += count($value);
                    }
                }
            }
        }
        else $count = count($this->__options);

        return $count;
    }
844950
def _count(self, cmd, collation=None, session=None):
        """"""
        def _cmd(session, server, sock_info, slave_ok):
            res = self._command(
                sock_info,
                cmd,
                slave_ok,
                allowable_errors=["ns missing"],
                codec_options=self.__write_response_codec_options,
                read_concern=self.read_concern,
                collation=collation,
                session=session)
            if res.get("errmsg", "") == "ns missing":
                return 0
            return int(res["n"])

        return self.__database.client._retryable_read(
            _cmd, self._read_preference_for(session), session)
46476
def count(self):
        
        return self.mapPartitions(lambda i: [sum(1 for _ in i)]).reduce(operator.add)
1374676
final public function count()
    {
        if(!isset($this->_count))
        {
            $context = $this->getContext();
            $context->count = null;

            if ($this->invokeCommand('before.count', $context) !== false)
            {
                $context->count = $this->_actionCount($context);
                $this->invokeCommand('after.count', $context);
            }

            $this->_count = KObjectConfig::unbox($context->count);
        }

        return $this->_count;
    }
644679
def comment_count(obj):
    
    model_object = type(obj).objects.get(id=obj.id)
    return model_object.comments.all().count()
68606
def get_main_language():
        
        try:
            main_language = TransLanguage.objects.filter(main_language=True).get()
            return main_language.code
        except TransLanguage.DoesNotExist:
            return TM_DEFAULT_LANGUAGE_CODE
1259215
public function count()
	{
		switch ($this->Mode)
		{
			case self::MODE_ERROR:
				return 0;
				break;
			case self::MODE_SINGLE:
				return 1;
				break;
			case self::MODE_MULTIPLE:
				return count($this->Data);
				break;
		}
		return 0;
	}
984191
def language_obj
      @language_obj ||= begin
        lookup = self.language_code || self.language_str
        LanguageList::LanguageInfo.find( lookup.dup ) if lookup
      end
    end
368225
@Override
	public int countAll() {
		Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
				FINDER_ARGS_EMPTY, this);

		if (count == null) {
			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(_SQL_COUNT_CPDEFINITIONLOCALIZATION);

				count = (Long)q.uniqueResult();

				finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
					count);
			}
			catch (Exception e) {
				finderCache.removeResult(FINDER_PATH_COUNT_ALL,
					FINDER_ARGS_EMPTY);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
237135
def get_count(self, prefix=''):
        """"""
        return sum([self.counters[key]
                    for key in self.messages if key.startswith(prefix)])
404150
def main(self):
        

        for m in self.methods:

            if m.name in ['Main', 'main']:
                return m

        if len(self.methods):
            return self.methods[0]

        return None
562709
public static <T> Number count(T[] self, @ClosureParams(FirstParam.Component.class) Closure closure) {
        return count((Iterable)Arrays.asList(self), closure);
    }
101666
def object_result(self):
        
        num_obj_results = len(self._object_results)

        if num_obj_results < 1:
            return None
        elif num_obj_results < 2:
            return self._object_results[0]
        else:
            raise ValueError("There is more than one result; use 'object_results'")
673274
def np_counts(self):
    
    counts = defaultdict(int)
    for phrase in self.noun_phrases:
        counts[phrase] += 1
    return counts
9005
def native_obj(self):
        """"""
        if self.__native is None:
            self.__native = self._get_object()

        return self.__native
611505
def count_children(obj, type=None):
    """"""
    if type is None:
        return len(obj)
    else:
        # there doesn't appear to be any hdf5 function for getting this
        # information without inspecting each child, which makes this somewhat
        # slow
        return sum(1 for x in obj if obj.get(x, getclass=True) is type)