Whitespace: matches white spaces, example: ' ', '\t'
333908
function WS(min_len, max_len) {
        if (typeof min_len === "undefined") { min_len = 1; }
        if (typeof max_len === "undefined") { max_len = Number.MAX_VALUE; }
        return _make_alias('WS', paka.P.WS, REPEAT(IN([' ', '\t', '\n', '\n'].join('')), min_len, max_len));
    }
673208
def whitespace_around_comma(logical_line):
    
    """
    line = logical_line
    for m in WHITESPACE_AFTER_COMMA_REGEX.finditer(line):
        found = m.start() + 1
        if '\t' in m.group():
            yield found, "E242 tab after '%s'" % m.group()[0]
        else:
            yield found, "E241 multiple spaces after '%s'" % m.group()[0]
602275
def adjust_whitespace(text):
    """"""

    state = [False, False]
    (backslashed, triplequoted) = (0, 1)

    def in_multi_line(line):
        start_state = (state[backslashed] or state[triplequoted])

        if re.search(r"\\$", line):
            state[backslashed] = True
        else:
            state[backslashed] = False

        def match(reg, t):
            m = re.match(reg, t)
            if m:
                return m, t[len(m.group(0)):]
            else:
                return None, t

        while line:
            if state[triplequoted]:
                m, line = match(r"%s" % state[triplequoted], line)
                if m:
                    state[triplequoted] = False
                else:
                    m, line = match(r".*?(?=%s|$)" % state[triplequoted], line)
            else:
                m, line = match(r'#', line)
                if m:
                    return start_state

                m, line = match(r"\"\"\"|\'\'\'", line)
                if m:
                    state[triplequoted] = m.group(0)
                    continue

                m, line = match(r".*?(?=\"\"\"|\'\'\'|#|$)", line)

        return start_state

    def _indent_line(line, stripspace=''):
        return re.sub(r"^%s" % stripspace, '', line)

    lines = []
    stripspace = None

    for line in re.split(r'\r?\n', text):
        if in_multi_line(line):
            lines.append(line)
        else:
            line = line.expandtabs()
            if stripspace is None and re.search(r"^[ \t]*[^# \t]", line):
                stripspace = re.match(r"^([ \t]*)", line).group(1)
            lines.append(_indent_line(line, stripspace))
    return "\n".join(lines)
804223
function (body, value, constant) {

            // we want to match "define('CONST', 'blah');" with any whitespace and any quote type
            // note that heredoc and now doc are NOT covered

            // Quote matching possiblities
            // JS doesn't support look backs, not sure if there is a more elegant solution (maybe with capture groups?)
            var envRegexSLSR = new RegExp("(define\\s*\\(\\s*[']" + constant + "[']\\s*,\\s*['])[^']*([']\\s*\\)\\s*;)"),
                envRegexSLDR = new RegExp("(define\\s*\\(\\s*[']" + constant + "[']\\s*,\\s*[\"])[^\"]*([\"]\\s*\\)\\s*;)"),
                envRegexDLDR = new RegExp("(define\\s*\\(\\s*[\"]" + constant + "[\"]\\s*,\\s*[\"])[^\"]*([\"]\\s*\\)\\s*;)"),
                envRegexDLSR = new RegExp("(define\\s*\\(\\s*[\"]" + constant + "[\"]\\s*,\\s*['])[^']*([']\\s*\\)\\s*;)"),
                envRegexSLNR = new RegExp("(define\\s*\\(\\s*[']" + constant + "[']\\s*,\\s*)[^\\s]+(\\s*\\)\\s*;)"),
                envRegexDLNR = new RegExp("(define\\s*\\(\\s*[\"]" + constant + "[\"]\\s*,\\s*)[^\\s]+(\\s*\\)\\s*;)"),
                lines = body.replace(/\r\n/g, '\n').split(/\n/),
                output = [];

            lines.forEach(function (oneLine) {
                // If a regex matches, that's it, we stop

                var theEnv =    envRegexSLSR.exec(oneLine) ||
                                envRegexSLDR.exec(oneLine) ||
                                envRegexDLDR.exec(oneLine) ||
                                envRegexDLSR.exec(oneLine) ||
                                envRegexSLNR.exec(oneLine) ||
                                envRegexDLNR.exec(oneLine);


                if (theEnv) {
                    oneLine = updateLine(oneLine, theEnv, value);
                }

                output.push(oneLine);

            });

            return output.join('\n');
        }
463155
function(str) {
    return trim(str).replace(/([\r\n\s　])+/g, function(match, whitespace) {
      return whitespace === '　' ? whitespace : ' ';
    });
  }
994301
def missing_whitespace(logical_line):
    
    """
    line = logical_line
    for index in range(len(line) - 1):
        char = line[index]
        if char in ',;:' and line[index + 1] not in WHITESPACE:
            before = line[:index]
            if char == ':' and before.count('[') > before.count(']') and \
                    before.rfind('{') < before.rfind('['):
                continue  # Slice syntax, no space required
            if char == ',' and line[index + 1] == ')':
                continue  # Allow tuple with only one element: (3,)
            yield index, "E231 missing whitespace after '%s'" % char
371969
function whitespaceEndPos( $tpl, &$text, $currentPosition, $textLength )
    {
        if ( $currentPosition >= $textLength )
            return $currentPosition;
        while( $currentPosition < $textLength and
               ( $text[$currentPosition] === ' '
                 or $text[$currentPosition] === "\n"
                 or $text[$currentPosition] === "\t"
                 or $text[$currentPosition] === "\r" ) )
        {
            ++$currentPosition;
        }
        return $currentPosition;
    }
1112962
def whitespace_tokenize(text):
    """"""
    text = text.strip()
    if not text:
        return []
    tokens = text.split()
    return tokens
861712
static function processWhitespaceNewlines($text) {

		// remove excess spaces around tabs
		$text = preg_replace("/ *\t */im", "\t", $text);

		// remove leading whitespace
		$text = ltrim($text);

		// remove leading spaces on each line
		$text = preg_replace("/\n[ \t]*/im", "\n", $text);

		// convert non-breaking spaces to regular spaces to prevent output issues,
		// do it here so they do NOT get removed with other leading spaces, as they
		// are sometimes used for indentation
		$text = static::renderText($text);

		// remove trailing whitespace
		$text = rtrim($text);

		// remove trailing spaces on each line
		$text = preg_replace("/[ \t]*\n/im", "\n", $text);

		// unarmor pre blocks
		$text = static::fixNewLines($text);

		// remove unnecessary empty lines
		$text = preg_replace("/\n\n\n*/im", "\n\n", $text);

		return $text;
	}
390942
def CheckCommandSpaces(filename, linenumber, clean_lines, errors):
    
    line = clean_lines.lines[linenumber]
    match = ContainsCommand(line)
    if match and len(match.group(2)):
        errors(filename, linenumber, 'whitespace/extra',
                "Extra spaces between '%s' and its ()"%(match.group(1)))
    if match:
        spaces_after_open = len(_RE_COMMAND_START_SPACES.match(line).group(1))
        initial_spaces = GetInitialSpaces(line)
        initial_linenumber = linenumber
        end = None
        while True:
            line = clean_lines.lines[linenumber]
            end = _RE_COMMAND_END_SPACES.search(line)
            if end:
                break
            linenumber += 1
            if linenumber >= len(clean_lines.lines):
                break
        if linenumber == len(clean_lines.lines) and not end:
            errors(filename, initial_linenumber, 'syntax',
                    'Unable to find the end of this command')
        if end:
            spaces_before_end = len(end.group(1))
            initial_spaces = GetInitialSpaces(line)
            if initial_linenumber != linenumber and spaces_before_end >= initial_spaces:
                spaces_before_end -= initial_spaces

            if spaces_after_open != spaces_before_end:
                errors(filename, initial_linenumber, 'whitespace/mismatch',
                        'Mismatching spaces inside () after command')
229364
function toSpaceCase (string) {
  return clean(string).replace(/[\W_]+(.|$)/g, function (matches, match) {
    return match ? ' ' + match : '';
  });
}
564329
def ignorespace(self):
        '''
        
        '''

        while True:

            self.ignore(whitespace)

            if self.nextstr('//'):
                self.noms(until='\n')
                continue

            if self.nextstr('/*'):
                self.expect('*/')
                continue

            break
400195
def strip_spaces(value, sep=None, join=True):
    """"""
    value = value.strip()
    value = [v.strip() for v in value.split(sep)]
    join_sep = sep or ' '
    return join_sep.join(value) if join else value
1181300
def get_whitespace(txt):
    

    # if the entire parameter is whitespace
    rall = re.search(r'^([\s])+$', txt)
    if rall:
        tmp = txt.split('\n', 1)
        if len(tmp) == 2:
            return (tmp[0], '\n' + tmp[1])  # left, right
        else:
            return ('', tmp[0])  # left, right
    left = ''
    # find whitespace to the left of the parameter
    rlm = re.search(r'^([\s])+', txt)
    if rlm:
        left = rlm.group(0)
    right = ''
    # find whitespace to the right of the parameter
    rrm = re.search(r'([\s])+$', txt)
    if rrm:
        right = rrm.group(0)
    return (left, right)
588552
function space(json) {
  var match = json.match(/^(?:(\t+)|( +))"/m)
  return match ? (match[1] ? '\t' : match[2].length) : ''
}
1140902
def _skip_whitespace(self):
        """"""
        i = 0
        while self._cur_token['type'] is TT.ws and not self._finished:
            self._increment()
            i += 1

        return i
494143
def com_google_fonts_check_whitespace_widths(ttFont):
  """"""
  from fontbakery.utils import get_glyph_name

  space_name = get_glyph_name(ttFont, 0x0020)
  nbsp_name = get_glyph_name(ttFont, 0x00A0)

  space_width = ttFont['hmtx'][space_name][0]
  nbsp_width = ttFont['hmtx'][nbsp_name][0]

  if space_width > 0 and space_width == nbsp_width:
    yield PASS, "Whitespace and non-breaking space have the same width."
  else:
    yield FAIL, ("Whitespace and non-breaking space have differing width:"
                 " Whitespace ({}) is {} font units wide, non-breaking space"
                 " ({}) is {} font units wide. Both should be positive and the"
                 " same.").format(space_name, space_width, nbsp_name,
                                  nbsp_width)