Apply any user-specified limits on source selection
            Limits based on fluxes.
771300
def apply_flux_limits(self):
        
        if not self._apply_flux_limits:
            return

        # only if limits are set should they be applied
        if ((self.maxflux is None and self.minflux is None) or
            self.fluxunits is None):
            return

        print("\n     Applying flux limits...")
        print("         minflux = {}".format(self.minflux))
        print("         maxflux = {}".format(self.maxflux))
        print("         fluxunits = '{:s}'".format(self.fluxunits))
        print("         nbright = {}".format(self.nbright))

        # start by checking to see whether fluxes were read in to use for
        # applying the limits
        if not self.flux_col:
            print("    WARNING: Catalog did not contain fluxes for use in trimming...")
            return

        if self.xypos is not None and self.radec is not None:
            if len(self.xypos) < len(self.radec):
                src_cat = self.radec
            else:
                src_cat = self.xypos
        else:
            src_cat = self.radec if self.xypos is None else self.xypos

        if src_cat is None:
            raise RuntimeError("No catalogs available for filtering")

        if len(src_cat) < 3:
            print("    WARNING: No fluxes read in for catalog for use in trimming...")
            return

        fluxes = copy.deepcopy(src_cat[2])

        # apply limits equally to all .radec and .xypos entries
        # Start by clipping by any specified flux range
        if self.fluxunits == 'mag':
            if self.minflux is None:
                flux_mask = fluxes >= self.maxflux
            elif self.maxflux is None:
                flux_mask = fluxes <= self.minflux
            else:
                flux_mask = (fluxes <= self.minflux) & (fluxes >= self.maxflux)
        else:
            if self.minflux is None:
                flux_mask = fluxes <= self.maxflux
            elif self.maxflux is None:
                flux_mask = fluxes >= self.minflux
            else:
                flux_mask = (fluxes >= self.minflux) & (fluxes <= self.maxflux)

        if self.radec is None:
            all_radec = None
        else:
            all_radec = [rd[flux_mask].copy() for rd in self.radec]

        if self.xypos is None:
            all_xypos = None
        else:
            all_xypos = [xy[flux_mask].copy() for xy in self.xypos]

        nrem = flux_mask.size - np.count_nonzero(flux_mask)
        print("     Removed {:d} sources based on flux limits.".format(nrem))

        if self.nbright is not None:
            print("Selecting catalog based on {} brightest sources".format(self.nbright))
            fluxes = fluxes[flux_mask]

            # find indices of brightest sources
            idx = np.argsort(fluxes)
            if self.fluxunits == 'mag':
                idx = idx[:self.nbright]
            else:
                idx = (idx[::-1])[:self.nbright]

            # pick out only the brightest 'nbright' sources
            if all_radec is not None:
                all_radec = [rd[idx] for rd in all_radec]
            if all_xypos is not None:
                all_xypos = [xy[idx] for xy in all_xypos]

        self.radec = all_radec
        self.xypos = all_xypos

        if len(self.radec[0]) == 0:
            print("Trimming of catalog resulted in NO valid sources! ")
            raise ValueError
540725
def load_limits(self, config=None):
        """"""
        # For each plugins, call the load_limits method
        for p in self._plugins:
            self._plugins[p].load_limits(config)
276743
protected function configureOutputLimit()
    {
        if ($this->request->input('only')) {
            $only = explode(',', $this->request->input('only'));

            $validator = app('validator')->make(
                ['only' => $only],
                ['only' => 'array|in:data,meta']
            );

            if ($validator->failed()) {
                $this->respondWithError("Invalid value for `only`.");
            } else {
                $this->only = array_flip(array_diff(['data', 'meta'], $only));
            }
        }
    }
250616
def apply_bbox(sf,ax):
    
    limits = sf.bbox
    xlim = limits[0],limits[2]
    ylim = limits[1],limits[3]
    ax.set_xlim(xlim)
    ax.set_ylim(ylim)
918919
def limits(self,variable):
        """"""
        (vmin,vmax), = self.SELECT('min(%(variable)s), max(%(variable)s)' % vars())
        return vmin,vmax
115559
synchronized void setLimits(int txnsPerSec, int maxOutstanding) {
        m_autoTune = false;
        /*
         * If the rate limit is some reasonably low value then go through the effort
         * of rate limiting
         */
        if (txnsPerSec < Integer.MAX_VALUE / 2) {
            m_doesAnyTuning = true;
        }
        m_targetTxnsPerSecond = txnsPerSec;
        m_maxOutstandingTxns = maxOutstanding;
        m_outstandingTxnsSemaphore.drainPermits();
        m_outstandingTxnsSemaphore.release(maxOutstanding);
    }
1009419
function setEnabledSources(config) {
    for (let source in config) {
        setSourceEnabled(source, config[source]);
    }
    haveSourcesBeenSelected = true;
}
270468
protected static List<CmsResource> limitCollectorResult(
        CmsContentInfoBean contentInfoBean,
        List<CmsResource> collectorResult) {

        List<CmsResource> result = null;
        int pageCount = -1;

        if (contentInfoBean.getPageSize() > 0) {

            pageCount = collectorResult.size() / contentInfoBean.getPageSize();
            if ((collectorResult.size() % contentInfoBean.getPageSize()) != 0) {
                pageCount++;
            }

            contentInfoBean.setPageCount(pageCount);

            int startIndex = (contentInfoBean.getPageIndex() - 1) * contentInfoBean.getPageSize();
            int endIndex = contentInfoBean.getPageIndex() * contentInfoBean.getPageSize();
            if (endIndex > collectorResult.size()) {
                endIndex = collectorResult.size();
            }

            result = collectorResult.subList(startIndex, endIndex);
        } else {

            result = collectorResult;
            if (collectorResult.size() > 0) {
                contentInfoBean.setPageCount(1);
            }
        }

        return result;
    }
166461
def __expand_limits(ax, limits, which='x'):
    ''''''

    if which == 'x':
        getter, setter = ax.get_xlim, ax.set_xlim
    elif which == 'y':
        getter, setter = ax.get_ylim, ax.set_ylim
    else:
        raise ValueError('invalid axis: {}'.format(which))

    old_lims = getter()
    new_lims = list(limits)

    # infinite limits occur on new axis objects with no data
    if np.isfinite(old_lims[0]):
        new_lims[0] = min(old_lims[0], limits[0])

    if np.isfinite(old_lims[1]):
        new_lims[1] = max(old_lims[1], limits[1])

    setter(new_lims)
1282305
private void onLimit(StringBuilder builder) {
        if (Integer.MAX_VALUE != maxResult) {
            builder.append(CQLTranslator.LIMIT);
            builder.append(isSingleResult ? 1 : this.maxResult);
        }
    }
644468
def filter(self, sources):
        
        for src in sources:
            if hasattr(src, 'indices'):   # already filtered
                yield src
                continue
            box = self.integration_distance.get_affected_box(src)
            indices = self.sitecol.within_bbox(box)
            if len(indices):
                src.indices = indices
                yield src
892226
def set_limits(self, min_: typing.Optional[float] = None, max_: typing.Optional[float] = None):
        
        self._min, self._max = min_, max_
352443
private void updateLimits(List<S> solutionList) {
    for (int obj = 0; obj < numberOfObjectives; obj++) {
      gridLowerLimits[obj] = Double.MAX_VALUE;
      gridUpperLimits[obj] = Double.MIN_VALUE;
    }

    //Find the max and min limits of objetives into the population
    for (int ind = 0; ind < solutionList.size(); ind++) {
      Solution<?> tmpIndividual = solutionList.get(ind);
      for (int obj = 0; obj < numberOfObjectives; obj++) {
        if (tmpIndividual.getObjective(obj) < gridLowerLimits[obj]) {
          gridLowerLimits[obj] = tmpIndividual.getObjective(obj);
        }
        if (tmpIndividual.getObjective(obj) > gridUpperLimits[obj]) {
          gridUpperLimits[obj] = tmpIndividual.getObjective(obj);
        }
      }
    }
  }
1206727
def check_limits(user_rule):
    

    def wrapper(*args, **kwargs):
        """The body of the decorator """
        global _state
        _state["cnt_elements"] += 1
        _state["depth"] += 1
        matrix = _state["ctx"].get_matrix()
        # TODO: add check of transparency = 0
        if _state["depth"] >= MAX_DEPTH:
            logger.info("stop recursion by reaching max depth {}".format(MAX_DEPTH))
        else:
            min_size_scaled = SIZE_MIN_FEATURE / min(WIDTH, HEIGHT)
            current_scale = max([abs(matrix[i]) for i in range(2)])
            if (current_scale < min_size_scaled):
                logger.info("stop recursion by reaching min feature size")
                # TODO: check feature size with respect to current ink size
            else:
                if _state["cnt_elements"] > MAX_ELEMENTS:
                    logger.info("stop recursion by reaching max elements")
                else:
                    user_rule(*args, **kwargs)
        _state["depth"] -= 1
    return wrapper
108520
def add_rate_limit(self, limiter):
        
        if limiter not in self.rate_limiters:
            self.subscribe('capacity', limiter.on_capacity)
            self.rate_limiters.append(limiter)
1043329
public void limitItems(int limit) {
        buildNumbers = copyLastElements(buildNumbers, limit);

        passedFeatures = copyLastElements(passedFeatures, limit);
        failedFeatures = copyLastElements(failedFeatures, limit);
        totalFeatures = copyLastElements(totalFeatures, limit);

        passedScenarios = copyLastElements(passedScenarios, limit);
        failedScenarios = copyLastElements(failedScenarios, limit);
        totalScenarios = copyLastElements(totalScenarios, limit);

        passedSteps = copyLastElements(passedSteps, limit);
        failedSteps = copyLastElements(failedSteps, limit);
        skippedSteps = copyLastElements(skippedSteps, limit);
        pendingSteps = copyLastElements(pendingSteps, limit);
        undefinedSteps = copyLastElements(undefinedSteps, limit);
        totalSteps = copyLastElements(totalSteps, limit);

        durations = copyLastElements(durations, limit);
    }
991563
public void setLimits(int softLimit, int hardLimit) {
    if ((softLimit > 0 && hardLimit > softLimit) || (softLimit == 0 && hardLimit == 0)) {
      this.softLimit = softLimit;
      this.hardLimit = hardLimit;
      garbageCollect();
    } else {
      throw new IllegalArgumentException();
    }
  }