Filter which evaluates to True when the characters before the cursor are
    whitespace, or we are at the start of te line.
484917
def whitespace_before_cursor_on_line():
    
    b = get_app().current_buffer
    before_cursor = b.document.current_line_before_cursor

    return bool(not before_cursor or before_cursor[-1].isspace())
467075
def whitespace_around_keywords(logical_line):
    
    """
    for match in KEYWORD_REGEX.finditer(logical_line):
        before, after = match.groups()

        if '\t' in before:
            yield match.start(1), "E274 tab before keyword"
        elif len(before) > 1:
            yield match.start(1), "E272 multiple spaces before keyword"

        if '\t' in after:
            yield match.start(2), "E273 tab after keyword"
        elif len(after) > 1:
            yield match.start(2), "E271 multiple spaces after keyword"
138283
def detect_spaces_at_bol(text, is_bol)
      lspace = nil
      if text.empty?
        lspace = "" if is_bol
      elsif text[-1] == ?\n
        lspace = ""
      else
        rindex = text.rindex(?\n)
        if rindex
          s = text[rindex+1..-1]
          if s =~ /\A[ \t]*\z/
            lspace = s
            #text = text[0..rindex]
            text[rindex+1..-1] = ''
          end
        else
          if is_bol && text =~ /\A[ \t]*\z/
            #lspace = text
            #text = nil
            lspace = text.dup
            text[0..-1] = ''
          end
        end
      end
      return lspace
    end
1166309
def pre_filter(self):
        
        if self._name in self.PRE_FILTER_FIELDS:
            if not self._value:
                return '"not=${}"'.format(self.PRE_FILTER_FIELDS[self._name])
            else:
                val = self._value
                if self._exact:
                    val = val.copy().pop()
                return r'"string.contains_i=${},\"{}\""'.format(
                       self.PRE_FILTER_FIELDS[self._name], val.replace('"', r'\\\"'))
        return ''
564329
def ignorespace(self):
        '''
        
        '''

        while True:

            self.ignore(whitespace)

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

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

            break
343318
def pre_filter(self):
        
        inner = self._inner.pre_filter()
        if inner:
            if inner.startswith('"not=$') and inner.endswith('"') and '\\' not in inner:
                return inner[6:-1]  # double negation, return inner command
            elif inner.startswith('"'):
                inner = '"$' + inner[1:]
            else:
                inner = '$' + inner
            return 'not=' + inner
        else:
            return ''
178974
private static int skipWhite(char[] part, int startPos) {
    for (int i = startPos; i < part.length; i++) {
      if (!Character.isWhitespace(part[i])) {
        return i;
      }
    }
    return part.length;
  }
636695
function isWhitespace( $tpl, &$text, $startPosition )
    {
        return ( $text[$startPosition] === ' '
                 or $text[$startPosition] === "\n"
                 or $text[$startPosition] === "\t"
                 or $text[$startPosition] === "\r" );
    }
995378
def spaces_before_first_char(s)
		case s.md_type
		when :ulist
			i=0;
			# skip whitespace if present
			while s[i,1] =~ /\s/; i+=1 end
			# skip indicator (+, -, *)
			i+=1
			# skip optional whitespace
			while s[i,1] =~ /\s/; i+=1 end
			return i
		when :olist
			i=0;
			# skip whitespace
			while s[i,1] =~ /\s/; i+=1 end
			# skip digits
			while s[i,1] =~ /\d/; i+=1 end
			# skip dot
			i+=1
			# skip whitespace
			while s[i,1] =~ /\s/; i+=1 end
			return i
		else
			tell_user "BUG (my bad): '#{s}' is not a list"
			0
		end
	end
125818
def fix_whitespace(line, offset, replacement):
    """"""
    # Replace escaped newlines too
    left = line[:offset].rstrip('\n\r \t\\')
    right = line[offset:].lstrip('\n\r \t\\')
    if right.startswith('#'):
        return line
    else:
        return left + replacement + right
1232599
private static int skipWhitespace(String input, int pos) {
        for (; pos < input.length(); pos++) {
            char c = input.charAt(pos);
            if (c != ' ' && c != '\t') {
                break;
            }
        }
        return pos;
    }
1208907
function filterBetaCharacters (characters) {
  /* istanbul ignore next */
  if (!characters) {
    return null
  }

  return characters.filter(x => !x.flags || !x.flags.includes('Beta'))
}
187572
function checkForIrregularWhitespace(node) {
            const sourceLines = sourceCode.lines;

            sourceLines.forEach((sourceLine, lineIndex) => {
                const lineNumber = lineIndex + 1;
                let match;

                while ((match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null) {
                    const location = {
                        line: lineNumber,
                        column: match.index
                    };

                    errors.push({ node, message: "Irregular whitespace not allowed.", loc: location });
                }
            });
        }
1306853
private int skipWhitespace(final int position) {
		int index = sql.length();
		for (int i = position; i < index; ++i) {
			char c = sql.charAt(i);
			if (!Character.isWhitespace(c)) {
				return i;
			}
		}
		return index;
	}
1080201
def _trim_whitespace(self, char):  # For loading text assets only
        

        psum = lambda x: sum(sum(x, []))
        if psum(char) > 0:
            is_empty = True
            while is_empty:  # From front
                row = char[0:8]
                is_empty = psum(row) == 0
                if is_empty:
                    del char[0:8]
            is_empty = True
            while is_empty:  # From back
                row = char[-8:]
                is_empty = psum(row) == 0
                if is_empty:
                    del char[-8:]
        return char
876925
def leading_whitespace(self, inputstring):
        """"""
        count = 0
        for i, c in enumerate(inputstring):
            if c == " ":
                count += 1
            elif c == "\t":
                count += tabworth - (i % tabworth)
            else:
                break
            if self.indchar is None:
                self.indchar = c
            elif c != self.indchar:
                self.strict_err_or_warn("found mixing of tabs and spaces", inputstring, i)
        return count
507382
private static int skipPatternWhiteSpace(String text, int pos) {
        while (pos < text.length()) {
            int c = UTF16.charAt(text, pos);
            if (!PatternProps.isWhiteSpace(c)) {
                break;
            }
            pos += UTF16.getCharCount(c);
        }
        return pos;
    }