Fixes spaces around various brackets.

 @param input [String] The paragraph which will be converted.
 @return [String] Paragraph with correct spaces around brackets.
11756
def brackets_whitespace(input)
      output = input.gsub(/([\(\[\{])\s*/, '\1')
      output = output.gsub(/\s*([\]\)\}])/, '\1')
      output = output.gsub(/\s+([\(\[\{])\s*/, ' \1')
      output = output.gsub(/\s*([\]\)\}])\s+/, '\1 ')
    end
467030
function splitInput(str) {
  if (str.slice(0, 3) !== '---') return;

  var matcher = /\n(\.{3}|-{3})/g;
  var metaEnd = matcher.exec(str);

  return metaEnd && [str.slice(0, metaEnd.index), str.slice(matcher.lastIndex)];
}
1372985
function padding (string, span = 2) {
  const spaces = ' '.repeat(span)
  return spaces + string.replace(/\n/g, `\n${spaces}`)
}
228930
private String translateWildcards(String input)
   {
      StringBuilder translated = new StringBuilder(input.length());
      boolean escaped = false;
      for (int i = 0; i < input.length(); i++)
      {
         if (input.charAt(i) == '\\')
         {
            if (escaped)
            {
               translated.append("\\\\");
               escaped = false;
            }
            else
            {
               escaped = true;
            }
         }
         else if (input.charAt(i) == '*')
         {
            if (escaped)
            {
               translated.append('*');
               escaped = false;
            }
            else
            {
               translated.append('%');
            }
         }
         else if (input.charAt(i) == '?')
         {
            if (escaped)
            {
               translated.append('?');
               escaped = false;
            }
            else
            {
               translated.append('_');
            }
         }
         else if (input.charAt(i) == '%' || input.charAt(i) == '_')
         {
            // escape every occurrence of '%' and '_'
            escaped = false;
            translated.append('\\').append(input.charAt(i));
         }
         else
         {
            if (escaped)
            {
               translated.append('\\');
               escaped = false;
            }
            translated.append(input.charAt(i));
         }
      }
      return translated.toString();
   }
751105
def normalize_leading_spaces(sections)
      sections.map do |section|
        if section.any? && section[0].any?
          leading_space = section[0][0].match("^\s+")
          if leading_space
            section[0] = section[0].map { |line| line.sub(/^#{leading_space.to_s}/, '') }
          end
        end

        section
      end
    end
233781
function parseInput(input) {
  var match = re.exec(input);

  if (match !== null) {
    var _match = _slicedToArray(match, 6),
        pre_keyword = _match[1],
        operator_keyword = _match[2],
        value = _match[3],
        unit = _match[4],
        post_keyword = _match[5];

    if (pre_keyword && post_keyword || pre_keyword && operator_keyword || post_keyword && operator_keyword) {
      return null;
    }

    return {
      value: sanitizeValue({
        value: value,
        operator_keyword: operator_keyword,
        post_keyword: post_keyword
      }),
      unit: unit
    };
  }

  return null;
}
1350012
function(input) {

      // Specials to be escaped by default.
      var specials = ['&','|','!','>','<','=','~','(',')',','];

      var specialsRegex = new RegExp('[' + specials.join('\\') + ']', 'g');

      if (input && typeof input === 'string') {
        input = input.replace(specialsRegex, '\\$&');
      }

      return input;
    }
1362934
def remove_whitespace(text_string):
    '''
    
    '''
    if text_string is None or text_string == "":
        return ""
    elif isinstance(text_string, str):
        return " ".join(text_string.split())
    else:
        raise InputError("none type or string not passed as an argument")
643944
public static String formatInput(Replaceable input,
                                     Transliterator.Position pos) {
        return formatInput((ReplaceableString) input, pos);
    }
588346
public static String doubleEncodeBrackets(final String input) {
		if (input == null || input.length() == 0) {  // For performance reasons don't use Util.empty
			return input;
		}
		return DOUBLE_ENCODE_BRACKETS.translate(input);
	}
136250
public static String rset(String input, int width)
   {
      String result; // result to return
      StringBuilder pad = new StringBuilder();
      if (input == null)
      {
         for (int i = 0; i < width - 1; i++)
         {
            pad.append(' '); // put blanks into buffer
         }
         result = " " + pad; // one short to use + overload
      }
      else
      {
         if (input.length() >= width)
         {
            result = input.substring(0, width); // when input is too long, truncate
         }
         else
         {
            int padLength = width - input.length(); // number of blanks to add
            for (int i = 0; i < padLength; i++)
            {
               pad.append(' '); // actually put blanks into buffer
            }
            result = pad + input; // concatenate
         }
      }
      return result;
   }
1095358
public String prepare(String input) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < input.length(); i++){
		    char c = input.charAt(i);        
		    if(map.get(c) != null) {
		    	replacements++;
		    	sb.append(map.get(c));
		    } else
		    	sb.append(c);
		}
		return sb.toString();
	}
53959
public static String escapeForReplaceAll(final String input) {
        return input == null ? null : java.util.regex.Matcher.quoteReplacement(input);
    }
1234405
function standardizeInput(input) {
  if ([undefined, null].indexOf(input) !== -1) {
    input = null;
  }
  else if (_.isNaN(input)) {
    input = null;
  }
  else if (_.isString(input)) {
    input = input.trim();

    // Written empty values
    if (["unspecified", "unknown", "none", "null", "empty", ""].indexOf(input.toLowerCase()) !== -1) {
      input = null;
    }
  }

  return input;
}
537014
public Token[] tokenize(String input) 
    {
    	char[] stringChars =  input.toCharArray();
        List<Token> tokens = new ArrayList<Token>();
        for (char c : stringChars) {
			if(Character.isLetterOrDigit(c)){
				tokens.add(internSomething(Character.toString(c)));
			}
			else if (!ignorePunctuation && !Character.isWhitespace(c)) {
				tokens.add(internSomething(Character.toString(c)));
			}
		}
        return (Token[]) tokens.toArray(new BasicToken[tokens.size()]);
    }
588110
function wrap(input, wrap, ends) {

  if(!isString(input) || isUndefined(wrap)) {
    return input;
  }

  return [wrap, input, ends || wrap].join('');

}
1287420
function (input) {
            var ellipsisContainer = input.previousSibling, elementoffsetWidth = ellipsisContainer.offsetWidth, frameWidth = this._frame.innerWidth;
            // 10 is to consider margin and padding
            if (elementoffsetWidth >= (frameWidth - 10)) {
                ellipsisContainer.firstChild.className += " ellipsisClass";
                var elementWidth = frameWidth - ellipsisContainer.offsetLeft
                        - (ellipsisContainer.firstChild.offsetLeft + ellipsisContainer.lastChild.offsetWidth) * 2;
                ellipsisContainer.firstChild.style.maxWidth = elementWidth + "px";
            }

        }