Partition the limit by a request header.
@return Chainable builder
10085
public GrpcServerLimiterBuilder partitionByHeader(Metadata.Key<String> header) {
        return partitionResolver(context -> context.getHeaders().get(header));
    }
1306274
final public function limit(int $amount = null)
    {
        $this->limitAmount = $amount === null ? null : $amount;

        return $this;
    }
582558
public function prepareLimitOffset() {
        $returnLimitOffset = Array();
        $returnLimitOffset['limit'] = (isset($this->request['itensPage']) and ! empty($this->request['itensPage'])) ? $this->request['itensPage'] : 10;
        $returnLimitOffset['offset'] = 0;
        return $returnLimitOffset;
    }
1330361
public function createMultiSchemeHeader()
    {
        $headers = [];
        foreach ($this->schemes as $name => $scheme) {
            $headers[$name] = $scheme->createResponseHeaderValue();
        }

        return new HttpHeader(
            $this->schemeHeader,
            sprintf('%s %s', implode('|', array_keys($headers)), implode('|', array_values($headers)))
        );
    }
1354359
public function getMaxOpenFilesLimit()
    {
        static $limit = null;

        if (null === $limit) {
            $process = new Process('ulimit -n');
            $process->run();

            if ($process->isSuccessful()) {
                $limit = (int) trim($process->getOutput());
            }

            unset($process);
        }

        return $limit;
    }
442295
public function setMaxLimit($c)
    {
        $c = (int) $c;
        $c and $this->maxlimit = $c;

        return $this;
    }
853623
private function withHeaders($request, $remaining, $retry = null)
  {
    $request->headers->addMany([
      'X-RateLimit-Limit' => $this->max,
      'X-RateLimit-Remaining' => ($remaining == 0 ? $remaining : $remaining - 1)
    ]);

    if ($retry !== null) {
      $request->headers->add('X-RateLimit-Reset', $retry);
    }
  }
679630
private function getLimit()
    {
        return $this->strategy->getLimit($this->adapter, $this->getNumber(), $this->perPage);
    }
1321740
public function buildStandardCheckoutRequest()
    {
        $this->addBaseParams();
        $this->addBasketParams();
        $this->addDescriptionParams();
        $this->disableSelectingDifferentAddressInPayPal();
        $this->setMaximumOrderAmount();

        if ($this->getShowCartInPayPal()) {
            $this->addBasketItemParams();
        } else {
            $this->addBasketGrandTotalParams();
        }
        $this->addAddressParams();

        return $this->getPayPalRequest();
    }
527685
public function limit($limit = NULL) {
		if ($limit !== NULL) {
			$limit = intval($limit);
		}
		$this->limit = $limit;
		return $this;
	}
691144
protected function parseRequest()
    {
        if (request()->limit) {
            if (request()->limit <= 0) {
                throw new InvalidLimitException();
            }
            else if (request()->limit > config("api.maxLimit")) {
                throw new MaxLimitException();
            }
            else {
                $this->limit = request()->limit;
            }
        }
        else {
            $this->limit = config("api.defaultLimit");
        }

        if (request()->offset) {
            $this->offset = request()->offset;
        }
        else {
            $this->offset = 0;
        }

        $this->extractFields();
        $this->extractFilters();
        $this->extractOrdering();
        $this->loadTableName();

        $this->attributes = request()->all();

        return $this;
    }
1197060
public ServletLimiterBuilder partitionByParameter(String name) {
        return partitionResolver(request -> Optional.ofNullable(request.getParameter(name)).orElse(null));
    }
678593
protected function pushLimit()
    {
        if( null !== $this->limit ) {
            if( null !== $this->offset ) {
                $this->parts[] = 'LIMIT ?, ?';
                $this->params[] = $this->offset;
                $this->params[] = $this->limit;
            } else {
                $this->parts[] = 'LIMIT ?';
                $this->params[] = $this->limit;
            }
        }
    }
429746
public function build(): GrantPermissionsRequest
	{
		$instance = new GrantPermissionsRequest();
		if ($this->origin === null) {
			throw new BuilderException('Property [origin] is required.');
		}
		$instance->origin = $this->origin;
		if ($this->permissions === null) {
			throw new BuilderException('Property [permissions] is required.');
		}
		$instance->permissions = $this->permissions;
		$instance->browserContextId = $this->browserContextId;
		return $instance;
	}
526392
public function limit($limit = null)
    {
        if (!func_num_args()) {
            return $this->_limit;
        }
        $this->_limit = $limit;
        return $this;
    }
572576
public function limit($limit = null)
    {
        if ($limit) {
            if ($limit < 0) {
                $this->items = array_slice($this->items, $limit, abs($limit));
            }
            else {
                $this->items = array_slice($this->items, 0, $limit);
            }
        }

        return $this;
    }
1336797
public function uploaded($limit = 20, $offset = 0)
	{
		return (new Disk\Resource\Collection(function($parameters) {
			$response = $this->send((new Request($this->uri->withPath($this->uri->getPath().'resources/last-uploaded')
				->withQuery(http_build_query($parameters, null, '&')), 'GET')));

			if ($response->getStatusCode() == 200)
			{
				$response = json_decode($response->getBody(), true);

				if (isset($response['items']))
				{
					return array_map(function($item) {
						return new Disk\Resource\Closed($item, $this, $this->uri);
					}, $response['items']);
				}
			}

			return [];
		}))
			->setLimit($limit, $offset);
	}