List all registered rule IDs,
optionally only up to a given `maxId`
@param {String} maxId - optional, list only rules that are less than the specified max Rule ID
@param {Function} callback( error, rules )
@return {Request}
352826
function( maxId, callback ) {

    if( typeof maxId === 'function' ) {
      callback = maxId
      maxId = null
    }

    var self = this
    var id = maxId ? '/' + maxId : ''

    return this.client._clientRequest({
      url: '/alerts/rest/v1/json/list' + id,
    }, function( error, data ) {
      callback.call( self.client, error, data )
    })

  }
1041900
function _parseRule(rule) {
    var parameters = [];

    // The format for specifying validation rules and parameters follows an
    // easy {rule}:{parameters} formatting convention. For instance the
    // rule "Max:3" states that the value may only be three letters.
    if (rule.indexOf(':')) {
      var ruleInfo  = rule.split(':');
      parameters = _parseParameters(ruleInfo[0], ruleInfo[1]);
    }

    return { parameters: parameters, rule: ruleInfo[0]};
  }
1277532
public static function getPageLimitRuleForDefaultAndMaxSizes(int $defaultSize, int $maxSize): RuleInterface
    {
        assert($maxSize > 1 && $defaultSize <= $maxSize);

        // if not given (`null` as an input) then default value otherwise input should be integer 1 <= value <= max
        return r::ifX(
            r::IS_NULL_CALLABLE,
            r::value($defaultSize),
            r::stringToInt(r::between(1, $maxSize))
        );
    }
813444
function (callback, id) {
        if (idValidate(callback, id)) {
          var host = apiGraphs
          var endpoint = '/products/' + id + '/recommended.json'
          runMethod(callback, endpoint, host)
        }
      }
431052
function list(callback, limit, offset) {
  if(!util.isFunction(callback)) {
    throw new Error('callback must be a function');
  }

  var resource = this.coinjar.personal.api_endpoint + '/v1/transactions.json',
    query = {};

  if(limit) { query.limit = limit; }
  if(offset) { query.offset = offset; }

  request.get(resource)
    .auth(this.coinjar.personal.auth_token)
    .query(query)
    .end(function (response) {
      if(isResponseError(response, callback)) { return; }
      return callback(null, response.body.transactions);
    });
}
233674
public function setCallback($callback = null)
    {
        if (null !== $callback) {
            // partially taken from http://www.geekality.net/2011/08/03/valid-javascript-identifier/
            // partially taken from https://github.com/willdurand/JsonpCallbackValidator
            //      JsonpCallbackValidator is released under the MIT License. See https://github.com/willdurand/JsonpCallbackValidator/blob/v1.1.0/LICENSE for details.
            //      (c) William Durand <william.durand1@gmail.com>
            $pattern = '/^[$_\p{L}][$_\p{L}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{200C}\x{200D}]*(?:\[(?:"(?:\\\.|[^"\\\])*"|\'(?:\\\.|[^\'\\\])*\'|\d+)\])*?$/u';
            $reserved = [
                'break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while',
                'debugger', 'function', 'this', 'with', 'default', 'if', 'throw', 'delete', 'in', 'try', 'class', 'enum', 'extends', 'super',  'const', 'export',
                'import', 'implements', 'let', 'private', 'public', 'yield', 'interface', 'package', 'protected', 'static', 'null', 'true', 'false',
            ];
            $parts = explode('.', $callback);
            foreach ($parts as $part) {
                if (!preg_match($pattern, $part) || \in_array($part, $reserved, true)) {
                    throw new \InvalidArgumentException('The callback name is not valid.');
                }
            }
        }

        $this->callback = $callback;

        return $this->update();
    }
1089854
function getCustomSourceId(arr, callback) {
    if (!arr || !arr.forEach) throw '"arr" parameter is mandatory and it must be an array.';
    if (!callback) throw '"callback" parameter is mandatory.';

    if (sourceId) return callback(sourceId);

    screenCallback = callback;
    window.postMessage({
        'get-custom-sourceId': arr
    }, '*');
}
395705
function(key, callback) {
      api.search({
        key: key,
        limit: this.conf.CONST.SEARCH_LIMIT
      }, callback);
    }
347995
def waf_rule_id(self, lookup, default=None):
    
    # list_rules returns at most 100 rules per request
    list_limit = 100
    rules = EFAwsResolver.__CLIENTS["waf"].list_rules(Limit=list_limit)
    while True:
      for rule in rules["Rules"]:
        if rule["Name"] == lookup:
          return rule["RuleId"]
      if rules.has_key("NextMarker"):
        rules = EFAwsResolver.__CLIENTS["waf"].list_rules(Limit=list_limit, NextMarker=rules["NextMarker"])
      else:
        return default
1371252
function requestId(options){

    options = extend({}, DEFAULTS);

    return function requestIdMiddleware(req, res, next){

        let id = _getId(req, options);
        let attributeName = options.attributeName;

        // console.log('requestid', id);

        /*
         * Want to expose the genrated
         * id in the request and response
         */
        req[attributeName] = id;

        if(res.req) res.req[attributeName] = id;

        /*
         * We send a header with the required
         * id...
         */
        if(options.resHeader) {
            res.set(options.resHeader, id);
        }

        next();
    }
}
218535
function minmaxValidator(value, testValue, validityName, limit, compareFunction) {
                if (!angular.isUndefined(testValue) && limit) {
                    if (!ngModelCtrl.$isEmpty(value) && compareFunction) {
                        return testValue;
                    } else {
                        return value;
                    }
                }
                else {
                    if (!limit) {
                        ngModelCtrl.$setValidity(validityName, !compareFunction);
                    }
                    return value;
                }
            }
881561
public RuleEnvelope getRule(String ruleId) throws ApiException {
        ApiResponse<RuleEnvelope> resp = getRuleWithHttpInfo(ruleId);
        return resp.getData();
    }
1173452
function ensureID(options, prop, callback) {
  if(options[prop]) {
    return callback();
  }

  options.guid(function(err, id) {
    if(err) {
      return callback(err);
    }
    options[prop] = id;
    callback();
  });
}
366321
function list(pageSize, callback) {
    var limit = 100;
    if (!isFunction(pageSize)) {
      limit = pageSize;
    }else {
      callback = pageSize;
    }
    commons.get(format('/%s/apps?limit=%s', deis.version, limit), callback);
  }
1033213
public static Function<? super ReactiveSeq<Long>, ? extends ReactiveSeq<Long>> limitLongs(long maxSize){

        return a->a.longs(i->i,s->s.limit(maxSize));
    }
682063
function getEnabledRules(allRules) {
    return Object.keys(allRules).reduce((map, id) => {
        if (allRules[id] === "error") {
            map[id] = 2
        }
        return map
    }, {})
}
1106897
function () {
			var max = -1;

			$('div[id^="mediumInsert-"]').each(function () {
				var id = parseInt($(this).attr('id').split('-')[1], 10);
				if (id > max) {
					max = id;
				}
			});

			return max;
		}