Calculates how close of a match the
given value is against a search token.

@param {mixed} value
@param {object} token
@return {number}
324171
function(value, token) {
			var score, pos;

			if (!value) return 0;
			value = String(value || '');
			pos = value.search(token.regex);
			if (pos === -1) return 0;
			score = token.string.length / value.length;
			if (pos === 0) score += 0.5;
			return score;
		}
193756
def get_group_value(self, token, match):
        """"""
        try:
            value = match.group('{}_{}'.format(token.name, self.group))
        except IndexError:
            value = ''
        return self.func(value) if callable(self.func) else value
935867
function findTokenIndex(tokens, offset) {
  var min = 0;
  var max = tokens.length - 1;

  while (min <= max) {
    var ptr = (min + max) / 2 | 0;
    var token = tokens[ptr];
    if (token.end <= offset) {
      min = ptr + 1;
    } else if (token.start > offset) {
      max = ptr - 1;
    } else {
      return ptr;
    }
  }

  return ptr;
}
42535
function checkIsHttpToken(val) {
  if (typeof val !== 'string' || val.length === 0)
    return false;
  if (!isValidTokenChar(val.charCodeAt(0)))
    return false;
  const len = val.length;
  if (len > 1) {
    if (!isValidTokenChar(val.charCodeAt(1)))
      return false;
    if (len > 2) {
      if (!isValidTokenChar(val.charCodeAt(2)))
        return false;
      if (len > 3) {
        if (!isValidTokenChar(val.charCodeAt(3)))
          return false;
        for (var i = 4; i < len; i++) {
          if (!isValidTokenChar(val.charCodeAt(i)))
            return false;
        }
      }
    }
  }
  return true;
}
91802
function(match, value, len, step) {
				var num = '' + value;
				if (doubled(match, step)) {
					while (num.length < len) {
						num = '0' + num;
					}
				}
				return num;
			}
679101
static Object getValueFromToken(String pToken) {
        return
                ("true".equals(pToken)) ?
                        Boolean.TRUE :
                        Boolean.FALSE;
    }
753208
function checkSpacingAfter(token) {
            const nextToken = sourceCode.getTokenAfter(token);

            if (nextToken &&
                OPEN_PAREN.test(token.value) &&
                astUtils.isTokenOnSameLine(token, nextToken) &&
                sourceCode.isSpaceBetweenTokens(token, nextToken) !== always
            ) {
                context.report({
                    loc: {
                        line: token.loc.end.line,
                        column: token.loc.end.column - 2
                    },
                    messageId: `${prefix}After`,
                    fix(fixer) {
                        if (always) {
                            return fixer.insertTextAfter(token, " ");
                        }
                        return fixer.removeRange([
                            token.range[1],
                            nextToken.range[0]
                        ]);
                    }
                });
            }
        }
1221917
function checkUri(i) {
  const start = i;

  if (i >= tokensLength || tokens[i++].value !== 'url' ||
      i >= tokensLength || tokens[i].type !== TokenType.LeftParenthesis)
    return 0;

  return tokens[i].right - start + 1;
}
166522
function checkCondition(i) {
  const start = i;
  let l;
  let _i;
  let s;

  if (i >= tokensLength) return 0;

  if (l = checkAtkeyword(i)) i += l;
  else return 0;

  if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0;

  while (i < tokensLength) {
    if (l = checkBlock(i)) break;

    s = checkSC(i);
    _i = i + s;

    if (l = _checkCondition(_i)) i += l + s;
    else break;
  }

  return i - start;
}
525262
@VisibleForTesting
  boolean contains(TokenRange range, Token token, boolean isStart) {
    if (range.isEmpty()) {
      return false;
    }
    if (range.getEnd().equals(minToken)) {
      if (range.getStart().equals(minToken)) { // ]min, min] = full ring, contains everything
        return true;
      } else if (token.equals(minToken)) {
        return !isStart;
      } else {
        return isStart
            ? token.compareTo(range.getStart()) >= 0
            : token.compareTo(range.getStart()) > 0;
      }
    } else {
      boolean isAfterStart =
          isStart ? token.compareTo(range.getStart()) >= 0 : token.compareTo(range.getStart()) > 0;
      boolean isBeforeEnd =
          isStart ? token.compareTo(range.getEnd()) < 0 : token.compareTo(range.getEnd()) <= 0;
      return range.isWrappedAround()
          ? isAfterStart || isBeforeEnd //  ####]----]####
          : isAfterStart && isBeforeEnd; // ----]####]----
    }
  }
358926
function matchKeyword(keyword) {
        var token = lookahead();
        return token.type === Token.Keyword && token.value === keyword;
    }
74910
public static function check_token($value = null)
	{
		$value = $value ?: \Input::param(static::$csrf_token_key, \Input::json(static::$csrf_token_key, 'fail'));

		// always reset token once it's been checked and still the same
		if (static::fetch_token() == static::$csrf_old_token and ! empty($value))
		{
			static::set_token(true);
		}

		return $value === static::$csrf_old_token;
	}
1088029
private Token match(Token.Kind kind) {
		checkNotEof();
		Token token = tokens.get(index++);
		if (token.kind != kind) {
			syntaxError("expecting \"" + kind + "\" here", token);
		}
		return token;
	}
1266496
function processIfValues(css, result, rule, decl, queries) {
  var query = null;
  var re = /(.*)\s+(?:\?if|\?)\s+media\s+(.*)/;
  var re2 = /\s/g;
  var hash = null;

  // Check if we're working with comments.
  var match = decl.value ? decl.value.match(re) : decl.text.match(re);
  // console.log(match)
  if(match && match[1] && match[2]) {
    if(decl.value)
      decl.value = match[1];
    else
      decl.text = match[1];
    hash = match[2].replace(re2, '');

    if(!queries[hash]) {
      queries[hash] = {
        arg: match[2],
        sel: rule.selector,
        props: []
      }
    }
    queries[hash].props.push({name: decl.prop, value: match[1], query: match[2], hash: hash, decl: decl});
  }
  else
    decl.warn(result, 'Appears to be a malformed `?if media` query -> ' + decl);
}
1247384
function step2$1(token) {
                var r1 = getR1(token);

                if (!r1) {
                    return token;
                }

                if (r1.match(/(d|v)t$/)) {
                    return token.slice(0, -1);
                }

                return token;
            }
1107743
function (str, token) {
            var total = 0, i;
            while ((i = str.indexOf(token, i) + 1)) {
                total++;
            }
            return total;
        }
1274642
function checkInclude(i) {
  let l;

  if (i >= tokensLength) return 0;

  if (l = checkInclude1(i)) tokens[i].include_type = 1;
  else if (l = checkInclude2(i)) tokens[i].include_type = 2;

  return l;
}