Adds the commands needed for the count function.

@param MultiExec $multi   A MultiExec instance
@param string    $subject A unique identifier, for example a session id or an IP
@param int       $bucket  Bucket
@param int       $count   Count
979128
private function addMultiExecCount(MultiExec $multi, $subject, $bucket, $count)
    {
        // Get the counts from the previous `$count` buckets
        $multi->hget($subject, $bucket);
        while ($count--) {
            $multi->hget($subject, (--$bucket + $this->bucketCount) % $this->bucketCount);
        }
    }
572
public function count($alias = null)
    {
        if ($this->controller && $this->controller->hasMethod('count')) {
            return $this->controller->count($this, $alias);
        }
        throw $this->exception('The controller doesn\'t support count', 'NotImplemented')
            ->addMoreInfo('controller', $this->controller ? $this->controller->short_name : 'none');
    }
992935
public function count($name, QueryObjectInterface $queryObject, DisplayCriteriaInterface $displayCriteria = null)
    {
        $count = $this->doCount($queryObject, $displayCriteria);
        $this->data[$name] = $count;

        return $count;
    }
578317
final public function limit(int $offsetOrCount, int $count = null)
    {
        if ($count === null) {
            $this->limit['offset'] = 0;
            $this->limit['count']  = $offsetOrCount;
        } else {
            $this->limit['offset'] = $offsetOrCount;
            $this->limit['count']  = $count;
        }

        return $this;
    }
265523
public function multi(string $name = null, string $mail = null, string $ip = null)
    {
        return $this->makeRequest('multi', compact('name', 'mail', 'ip'));
    }
741022
public function aroundGetSelectCountSql(
        \Magento\Catalog\Model\ResourceModel\Product\Collection $subject,
        \Closure $proceed
    ) {
        /** @var \Magento\Framework\DB\Select $result */
        $result = $proceed();
        $result->reset(\Zend_Db_Select::GROUP);
        return $result;
    }
864613
public void addTriple(final String subject, final String predicate, final String object) {
        addQuad(subject, predicate, object, "@default");
    }
770852
private function subExec($instances, $retryCount = 0, $retryWait = 0)
    {
        $curlMultiInstance = curl_multi_init();

        foreach ($instances as $name => $curlInstance) {
            curl_multi_add_handle($curlMultiInstance, $curlInstance->getHandle());
        }

        do {
            curl_multi_exec($curlMultiInstance, $stillRunning);
            curl_multi_select($curlMultiInstance);
        } while ($stillRunning);

        for ($retry = 1; $retry <= $retryCount; $retry++) {
            $retryRequired = false;

            foreach ($instances as $curlInstance) {
                if (!$curlInstance->isSuccessful()) {
                    $retryRequired = true;
                    break;
                }
            }

            if (!$retryRequired) {
                break;
            }

            sleep($retryWait);

            $this->retryFailed($instances);
        }

        foreach ($instances as $curlInstance) {
            $curlInstance->setContent(curl_multi_getcontent($curlInstance->getHandle()));
        }

        curl_multi_close($curlMultiInstance);
    }
1246818
public final void mCOUNT() throws RecognitionException {
		try {
			int _type = COUNT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// hql.g:17:7: ( 'count' )
			// hql.g:17:9: 'count'
			{
			match("count"); if (state.failed) return;

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
647605
public function update(\SplSubject $subject)
    {
        if ($subject->getAction() === 'ctrlRouterLink_exec_execRoute') {
            $this->obtainCtrlRouterInfos($subject);
            
            if (
                $this->ctrlRouterInfos->isFound === true &&
                $this->ctrlRouterInfos->forWho === $this->execRouteSystemName
            ) {
                $this->run();
            }
        }
    }
960266
public void addSubject(String[] subject) {
		XmpArray array = new XmpArray(XmpArray.UNORDERED);
		for (int i = 0; i < subject.length; i++) {
			array.add(subject[i]);
		}
		setProperty(SUBJECT, array);
	}
854895
public function addSelectCountFromPairedObject(EntityRepository $repository, $field_name, $count_by_field): self
    {
        $this->sql_select_fields[] = [
            'table' => false,
            'field' => '(SELECT COUNT(*) FROM `'. $repository->getDbTableName() .'` WHERE `'. $repository->getDbTableName() .'`.`'. $count_by_field .'` = `'. $this->getDbTableName() .'`.`id`) AS `'. $field_name .'`',
            'as'    => false,
            'type'  => 'string'
        ];

        return $this;
    }
500858
protected final function add_response($count, $label = null, $required = false) {
        if ($label === null) {
            $label = get_string('response', 'lesson');
        }
        $this->_form->addElement('editor', 'response_editor['.$count.']', $label,
                 array('rows' => '4', 'columns' => '80'),
                 array('noclean' => true, 'maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $this->_customdata['maxbytes']));
        $this->_form->setType('response_editor['.$count.']', PARAM_RAW);
        $this->_form->setDefault('response_editor['.$count.']', array('text' => '', 'format' => FORMAT_HTML));

        if ($required) {
            $this->_form->addRule('response_editor['.$count.']', get_string('required'), 'required', null, 'client');
        }
    }
262419
public function update(SplSubject $subject)
    {
        if ($subject instanceof Model) {
            $this->data = \array_merge($this->data, $subject->get());
        }
    }
257879
public function spop($key, $count = null) {
        $params = [$key];
        if ($count) {
            $params[] = $count;
        }
        return $this->returnCommand(['SPOP'], $key, $params);
    }
83486
public function relationCount(&$result, $relations, $aggregate = 'sum', $field = '*')
    {
        foreach ($relations as $key => $relation) {
            $closure = null;

            if ($relation instanceof \Closure) {
                $closure  = $relation;
                $relation = $key;
            } elseif (is_string($key)) {
                $name     = $relation;
                $relation = $key;
            }

            $relation = Db::parseName($relation, 1, false);
            $count    = $this->$relation()->relationCount($result, $closure, $aggregate, $field);

            if (!isset($name)) {
                $name = Db::parseName($relation) . '_' . $aggregate;
            }

            $result->setAttr($name, $count);
        }
    }
1079889
public function lrem($key, $count, $value) {
        return $this->returnCommand(['LREM'], $key, [$key, $count, $value]);
    }