Change ' to "
    Remove tabs and spaces (assume no significant whitespace inside a version string!)
960196
def simplify_line(line, keep_comma=False):  # type: (str, bool)->str
    
    if not line:
        return ""
    if "#" in line:
        parts = line.split("#")
        simplified_line = parts[0]
    else:
        simplified_line = line

    simplified_line = (
        simplified_line.replace(" ", "")
        .replace("'", '"')
        .replace("\t", "")
        .replace("\n", "")
        .replace("'''", '"')  # version strings shouldn't be split across lines normally
        .replace('"""', '"')
    )
    if not keep_comma:
        simplified_line = simplified_line.strip(" ,")
    return simplified_line
792355
def clean_tag_borders(string)
      result = string.gsub(/\s?\*{2,}.*?\*{2,}\s?/) do |match|
        preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do
          match.strip.sub('** ', '**').sub(' **', '**')
        end
      end

      result = result.gsub(/\s?\_{2,}.*?\_{2,}\s?/) do |match|
        preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do
          match.strip.sub('__ ', '__').sub(' __', '__')
        end
      end

      result = result.gsub(/\s?~{2,}.*?~{2,}\s?/) do |match|
        preserve_border_whitespaces(match, default_border: ReverseMarkdown.config.tag_border) do
          match.strip.sub('~~ ', '~~').sub(' ~~', '~~')
        end
      end

      result.gsub(/\s?\[.*?\]\s?/) do |match|
        preserve_border_whitespaces(match) do
          match.strip.sub('[ ', '[').sub(' ]', ']')
        end
      end
    end
1094317
function processSmartTabs(code, tabSize)
    {
        var lines = splitLines(code),
            tab = '\t',
            spaces = ''
            ;

        // Create a string with 1000 spaces to copy spaces from...
        // It's assumed that there would be no indentation longer than that.
        for (var i = 0; i < 50; i++)
            spaces += '                    '; // 20 spaces * 50

        // This function inserts specified amount of spaces in the string
        // where a tab is while removing that given tab.
        function insertSpaces(line, pos, count)
        {
            return line.substr(0, pos)
                + spaces.substr(0, count)
                + line.substr(pos + 1, line.length) // pos + 1 will get rid of the tab
                ;
        };

        // Go through all the lines and do the 'smart tabs' magic.
        code = eachLine(code, function(line)
        {
            if (line.indexOf(tab) == -1)
                return line;

            var pos = 0;

            while ((pos = line.indexOf(tab)) != -1)
            {
                // This is pretty much all there is to the 'smart tabs' logic.
                // Based on the position within the line and size of a tab,
                // calculate the amount of spaces we need to insert.
                var spaces = tabSize - pos % tabSize;
                line = insertSpaces(line, pos, spaces);
            }

            return line;
        });

        return code;
    }
976649
def fix_e225(self, result):
        """"""
        target = self.source[result['line'] - 1]
        offset = result['column'] - 1
        fixed = target[:offset] + ' ' + target[offset:]

        # Only proceed if non-whitespace characters match.
        # And make sure we don't break the indentation.
        if (
            fixed.replace(' ', '') == target.replace(' ', '') and
            _get_indentation(fixed) == _get_indentation(target)
        ):
            self.source[result['line'] - 1] = fixed
        else:
            return []
1362812
def delete_whitespaces(self, arg):
        
        # Deletes whitespaces after a newline
        arg = re.sub(re_newline_spc, '', arg)
        # Deletes every whitespace, tabulator, newline at the beginning of the string
        arg = re.sub(re_starting_whitespc, '', arg)
        # Deletes whitespace or tabulator if followed by whitespace or tabulator
        arg = re.sub(re_multi_spc_tab, '', arg)
        #  Deletes newline if it is followed by an other one
        arg = re.sub(re_double_newline, '', arg)
        # Deletes newlines and whitespaces at the end of the string
        arg = re.sub(re_ending_spc_newline, '', arg)
        return arg
1174286
function cleanseText( options, cb ) {
  return function( error, text ) {
    if ( !error ) {
      // clean up text
      text = util.replaceBadCharacters( text );

      if ( options.preserveLineBreaks || options.preserveOnlyMultipleLineBreaks ) {
        if ( options.preserveOnlyMultipleLineBreaks ) {
          text = text.replace( STRIP_ONLY_SINGLE_LINEBREAKS, '$1 ' ).trim();
        }
        text = text.replace( WHITELIST_PRESERVE_LINEBREAKS, ' ' );
      } else {
        text = text.replace( WHITELIST_STRIP_LINEBREAKS, ' ' );
      }

      // multiple spaces, tabs, vertical tabs, non-breaking space]
      text = text.replace( / (?! )/g, '' )
        .replace( /[ \t\v\u00A0]{2,}/g, ' ' );

      text = entities.decode( text );
    }
    cb( error, text );
  };
}
1226736
def detabify(text, options):
    
    opts = parse_options(options)
    if opts.tab_size < 1:
        return text.expandtabs(4)
    else:
        return text.expandtabs(options.tab_size)
156922
private String normalizeWhitespace(String str) {
    str = WHITESPACE_EXCEPT_SPACE_PATTERN.matcher(str).replaceAll(" ");
    str = TWO_OR_MORE_SPACES_PATTERN.matcher(str).replaceAll(" ");
    return str;
  }
644591
function normalizeSpaces(text)
{
    // IE has already done this conversion, so doing it again will remove multiple nbsp
    if (browserVersion.isIE)
    {
        return text;
    }

    // Replace multiple spaces with a single space
    // TODO - this shouldn't occur inside PRE elements
    text = text.replace(/\ +/g, " ");

    // Replace &nbsp; with a space
    var nbspPattern = new RegExp(String.fromCharCode(160), "g");
    if (browserVersion.isSafari) {
	return replaceAll(text, String.fromCharCode(160), " ");
    } else {
	return text.replace(nbspPattern, " ");
    }
}
380654
def strip_punctuation_space(value):
    ""
    def strip_punctuation(string):
        replacement_list = (
            (' .',  '.'),
            (' :',  ':'),
            ('( ',  '('),
            (' )',  ')'),
        )
        for match, replacement in replacement_list:
            string = string.replace(match, replacement)
        return string
    if value == None:
        return None
    if type(value) == list:
        return [strip_punctuation(v) for v in value]
    return strip_punctuation(value)
347998
def sanitize(val)
      # TODO: check if there are cases where whitespace is not a separator
      val = val.
        gsub(/\s*=\s*/,'='). # remove whitespaces around equal sign
        gsub(/[; ]+/, '; '). #use '; ' as a separator (or EOL)
        gsub(/;\s*$/,'') #remove trailing to keep examples below

      if val =~ /(boundary=(\S*))/i
        val = "#{$`.downcase}boundary=#{$2}#{$'.downcase}"
      else
        val.downcase!
      end

      case
      when val.chomp =~ /^\s*([\w\-]+)\/([\w\-]+)\s*;\s?(ISO[\w\-]+)$/i
        # Microsoft helper:
        # Handles 'type/subtype;ISO-8559-1'
        "#{$1}/#{$2}; charset=#{Utilities.quote_atom($3)}"
      when val.chomp =~ /^text;?$/i
        # Handles 'text;' and 'text'
        "text/plain;"
      when val.chomp =~ /^(\w+);\s(.*)$/i
        # Handles 'text; <parameters>'
        "text/plain; #{$2}"
      when val =~ /([\w\-]+\/[\w\-]+);\scharset="charset="(\w+)""/i
        # Handles text/html; charset="charset="GB2312""
        "#{$1}; charset=#{Utilities.quote_atom($2)}"
      when val =~ /([\w\-]+\/[\w\-]+);\s+(.*)/i
        type = $1
        # Handles misquoted param values
        # e.g: application/octet-stream; name=archiveshelp1[1].htm
        # and: audio/x-midi;\r\n\sname=Part .exe
        params = $2.to_s.split(/\s+/)
        params = params.map { |i| i.to_s.chomp.strip }
        params = params.map { |i| i.split(/\s*\=\s*/, 2) }
        params = params.map { |i| "#{i[0]}=#{Utilities.dquote(i[1].to_s.gsub(/;$/,""))}" }.join('; ')
        "#{type}; #{params}"
      when val =~ /^\s*$/
        'text/plain'
      else
        val
      end
    end
326784
def replace_tab_indents(s, replace="    "):
    
    lines = s.splitlines(True)
    return "".join([replace_tab_indent(l, replace) for l in lines])
556189
public String normalizeWhitespace(String value) {
        String result = null;
        if (value != null) {
            value = value.trim();
            result = replaceAllInWith("\\s+", value, " ");
        }
        return result;
    }
295730
function stripHeaderWhitespace (h){
    var n = {};
    var keys = Object.keys(h);
    keys.forEach(function(k){
        n[k] = h[k].replace(/,[ ]*/g, ',');
    });
    return n;
}
1066151
function cleanOptions(options) {
  if (options === undefined) {
    options = {
      selector: 'body'
    };
  } else if (typeof options === 'string') { // keeping compatiblity with version < v0.0.7
    if (options === '/') {
      options = {
        selector: 'body'
      };
    } else {
      options = {
        selector: options
      };
    }
  } else {
    options.selector = options.selector.replace('\\', '');
  }

  if (options.removeLinks === undefined) {
    options.removeLinks = false;
  }

  if (options.inlineCss === undefined) {
    options.inlineCss = true;
  }
  if (options.innerText === undefined) {
    options.innerText = false;
  }

  return options;
}
325084
def pretty_spaces(level):
    

    if level is None:
        return u''
    return (os.linesep if level >= 0 else u'') + (u' ' * (INDENT * level))
570218
function removeThisFunction (tokens, index) {
  for (var i = index + 1; i < tokens.length; i++) {
    var token = tokens[i]
    
    if (token.type === "operator") {
      if(token.data === ";") {
        //Remove the trailing newline
        var nextToken = tokens[i+1]
        if(nextToken.type === "whitespace" && nextToken.data[0] === "\n") {
          nextToken.data = nextToken.data.substr(1)
        }

        //Remove the previous tabs or spaces
        var prevToken = tokens[index-1]
        if(prevToken.type === "whitespace") {
          var indentation = prevToken.data.match("[\t ]*$")[0]
          prevToken.data = prevToken.data.substr(0, prevToken.data.length - indentation.length)
        }

        // Pull out the function
        tokens.splice(index, i - index + 1)
        return
      }
    }
  }
}