Avoid extraneous whitespace in the following situations:

    - More than one space around an assignment (or other) operator to
      align it with another.
181583
def whitespace_around_operator(logical_line):
    
    line = logical_line
    for operator in operators:
        found = line.find('  ' + operator)
        if found > -1:
            return found, "E221 multiple spaces before operator"
        found = line.find(operator + '  ')
        if found > -1:
            return found, "E222 multiple spaces after operator"
        found = line.find('\t' + operator)
        if found > -1:
            return found, "E223 tab before operator"
        found = line.find(operator + '\t')
        if found > -1:
            return found, "E224 tab after operator"
245523
function needsSpace(a, b) {
  var aa = a.slice(-1);
  var bb = b.charAt(0);

  if (bb === '.' && /\w/.test(b.charAt(1)) && aa !== '\n') {
    return true;
  }

  if (utils.isEndingChar(bb)) {
    return false;
  }

  if (aa === '`' && !/\s/.test(a.charAt(a.length - 2))) {
    return true;
  }

  if (/[*_]/.test(aa) && /\w/.test(bb)) {
    return true;
  }

  if (utils.isOpeningChar(aa)) {
    return false;
  }

  if (utils.isTightSeparator(aa) || utils.isTightSeparator(bb)) {
    return false;
  }

  if ((utils.isLooseSeparator(aa) || utils.isLooseSeparator(bb)) && !/\s/.test(aa)) {
    return true;
  }

  if (/\s/.test(aa) && utils.isStartingChar(bb)) {
    return false;
  }

  if (utils.isWrappingChar(aa) && utils.isStartingChar(bb)) {
    return true;
  }

  if (utils.isEndingChar(aa) && !/<br>$/.test(a) && !/\s/.test(bb) && !utils.isEndingChar(bb)) {
    return true;
  }

  if ((utils.isStartingChar(bb) || utils.isWrappingChar(bb) || utils.isWrappingChar(aa)) && !utils.isStartingChar(aa)) {
    return true;
  }

  if (utils.isWordChar(aa) && utils.isWordChar(bb)) {
    return true;
  }

  if (/\W/.test(bb) && !utils.isStartingChar(bb) && !utils.isOpeningChar(bb) && !utils.isEndingChar(bb) && !utils.isSpecialChar(bb) && !utils.isSeparator(bb) && !utils.isStartingChar(aa)) {
    return true;
  }

  return false;
}
695415
function strip_whitespace (s) {
      if (options.strip_whitespace) {
        return s.replace(/\s*\n/g,"\n").replace(/(\r?\n){2,}/g,"\n\n");
      }
      return s;
    }
264797
function skipWhitespace() {
    while (i < input.length) {
      if (isWhitespace(input[i])) {
        i++;
        parser.pos_++;
        continue;
      }
      break;
    }
  }
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
699641
function trimToNearestSpace (str) {
  const trimThreshold = 15
  if (str.length < trimThreshold) return str
  const acceptableStretch = 3
  let trimmed = ''
  for (const word of str.split(' ')) {
    const combined = trimmed + ' ' + word
    if (combined.length > trimThreshold + acceptableStretch) {
      const previousSpaceAvailable = trimmed.length > trimThreshold - acceptableStretch && trimmed.length <= trimThreshold
      const resolved = previousSpaceAvailable ? trimmed : combined.slice(0, trimThreshold + 1)
      trimmed = resolved
      break
    }
    trimmed = combined
  }
  trimmed = trimmed.trim() // drop excess spaces
  return trimmed + '…'
}
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;
	}
570529
protected function skipWhitespace() {
        while ($this->currentPosition < $this->codeLength
            && in_array($this->code{$this->currentPosition}, $this->whitespaces)
        ) {
            ++$this->currentPosition;
        }
    }
554724
def align(a)
      case a
      when 1
        nil
      when 2, 4, 8
        bits = a - 1
        @idx = @idx + bits & ~bits
        raise IncompleteBufferException if @idx > @buffy.bytesize
      else
        raise "Unsupported alignment #{a}"
      end
    end
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"
465486
def extra_space_exists(str1: str, str2: str) -> bool:  # noqa
    
    ls1, ls2 = len(str1), len(str2)
    if str1.isdigit():
        # 10 SM
        if str2 in ['SM', '0SM']:
            return True
        # 12 /10
        if ls2 > 2 and str2[0] == '/' and str2[1:].isdigit():
            return True
    if str2.isdigit():
        # OVC 040
        if str1 in CLOUD_LIST:
            return True
        # 12/ 10
        if ls1 > 2 and str1.endswith('/') and str1[:-1].isdigit():
            return True
        # 12/1 0
        if ls2 == 1 and ls1 > 3 and str1[:2].isdigit() and '/' in str1 and str1[3:].isdigit():
            return True
        # Q 1001
        if str1 in ['Q', 'A']:
            return True
    # 36010G20 KT
    if str2 == 'KT' and str1[-1].isdigit() \
            and (str1[:5].isdigit() or (str1.startswith('VRB') and str1[3:5].isdigit())):
        return True
    # 36010K T
    if str2 == 'T' and ls1 >= 6 \
            and (str1[:5].isdigit() or (str1.startswith('VRB') and str1[3:5].isdigit())) and str1[-1] == 'K':
        return True
    # OVC022 CB
    if str2 in CLOUD_TRANSLATIONS and str2 not in CLOUD_LIST and ls1 >= 3 and str1[:3] in CLOUD_LIST:
        return True
    # FM 122400
    if str1 in ['FM', 'TL'] and (str2.isdigit() or (str2.endswith('Z') and str2[:-1].isdigit())):
        return True
    # TX 20/10
    if str1 in ['TX', 'TN'] and str2.find('/') != -1:
        return True
    return False
147870
def _enforce_space(self, item):
        
        if isinstance(self._lines[-1],
                      (self._Space, self._LineBreak, self._Indent)):
            return

        if not self._prev_item:
            return

        item_text = unicode(item)
        prev_text = unicode(self._prev_item)

        # Prefer a space around a '.' in an import statement, and between the
        # 'import' and '('.
        if (
            (item_text == '.' and prev_text == 'from') or
            (item_text == 'import' and prev_text == '.') or
            (item_text == '(' and prev_text == 'import')
        ):
            self._lines.append(self._Space())
1282685
private void cleanContentLeadingSpaces()
    {
        if (getContent().length() > 0) {
            if (fPreviousInlineText.length() == 0
                || fPreviousInlineText
                .charAt(fPreviousInlineText.length() - 1) == ' ')
            {
                trimLeadingWhiteSpaces();
            }
        }
    }
511944
def t_whitespace_or_comment(self, s):
        '
        if '#' in s:
            # We have a comment
            matches = re.match('(\s+)(.*[\n]?)', s)
            if matches and self.is_newline:
                self.handle_indent_dedent(matches.group(1))
                s = matches.group(2)
            if s.endswith("\n"):
                self.add_token('COMMENT', s[:-1])
                self.add_token('NEWLINE', "\n")
            else:
                self.add_token('COMMENT', s)
        elif self.is_newline:
            self.handle_indent_dedent(s)
            pass
        return
610583
private int absorbWhitespace(final StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException {
        // HACK: absorb extraneous whitespace between components (KOrganizer)..
        int ntok;
        while ((ntok = nextToken(tokeniser, in, ignoreEOF)) == StreamTokenizer.TT_EOL) {
            if (log.isTraceEnabled()) {
                log.trace("Absorbing extra whitespace..");
            }
        }
        if (log.isTraceEnabled()) {
            log.trace("Aborting: absorbing extra whitespace complete");
        }
        return ntok;
    }
1082483
def _skip_spaces(string, idx):
    # type: (str, int) -> int
    
    i = idx
    for char in string[idx:]:
        if not char.isspace():
            return i
        i += 1

    return -1
1363221
public function ignoreVerticalSpace()
    {
        ignoreHorizontalSpace:
        if (! $this->isEnd() && $this->currentAscii()->isVerticalSpace()) {
            $this->next();
            goto ignoreHorizontalSpace;
        }
    }