Pre-process a string of JSpec.

@param  {string} input
@return {string}
@api private
345737
function(input) {
      if (typeof input != 'string') return
      input = hookImmutable('preprocessing', input)
      return input.
        replace(/\t/g, '  ').
        replace(/\r\n|\n|\r/g, '\n').
        split('__END__')[0].
        replace(/([\w\.]+)\.(stub|destub)\((.*?)\)$/gm, '$2($1, $3)').
        replace(/describe\s+(.*?)$/gm, 'describe($1, function(){').
        replace(/^\s+it\s+(.*?)$/gm, ' it($1, function(){').
        replace(/^ *(before_each|after_each|before|after)(?= |\n|$)/gm, 'JSpec.currentSuite.addHook("$1", function(){').
        replace(/^\s*end(?=\s|$)/gm, '});').
        replace(/-\{/g, 'function(){').
        replace(/(\d+)\.\.(\d+)/g, function(_, a, b){ return range(a, b) }).
        replace(/\.should([_\.]not)?[_\.](\w+)(?: |;|$)(.*)$/gm, '.should$1_$2($3)').
        replace(/([\/\s]*)(.+?)\.(should(?:[_\.]not)?)[_\.](\w+)\((.*)\)\s*;?$/gm, '$1 expect($2).$3($4, $5)').
        replace(/, \)/g, ')').
        replace(/should\.not/g, 'should_not')
    }
1064370
function(input) {
  var code = 'var $_parsers = {\n';
  var parsernames = Object.keys(parsers);
  for (var i = 0; i < parsernames.length; i++) {
    code += '  ' + JSON.stringify(parsernames[i]) + ': ' +
      parsers[parsernames[i]].toString() + ',\n';
  };
  code += '}\n';
  code += compile(input) + '\nif (typeof $_end === "function") {$_end();}';
  var script = new vm.Script(code, {timeout: 4 * 60 * 1000});
  var runner = function(scope) {
    var output = '';
    var pipeOpen = false;
    var ended = false;
    var stream = new Readable({
      encoding: 'utf8',
      read: function() {
        pipeOpen = true;
        if (ended && output === '') {
          pipeOpen = this.push(null);
        } else if (output !== '') {
          pipeOpen = this.push(output);
          output = '';
        }
      },
    });
    scope.$_scope = scope;
    scope.$_write = function(data) {
      output += '' + data;
      if (pipeOpen && output !== '') {
        pipeOpen = stream.push(output);
        output = '';
      }
    };
    scope.$_end = function() {
      ended = true;
      if (pipeOpen) { stream.push(null); }
    };
    script.runInNewContext(scope)
    return stream;
  };
  runner.code = code;
  return runner;
}
1206569
function(input) {
    return input.replace(/\{{2,}/g, function(match) {
      return match.length > 2 ? match.substr(2) : '<%=';
    }).replace(/\}{2,}/g, function(match) {
      return match.length > 2 ? match.substr(2) : '%>';
    });
  }
535654
function assembleInput(input) {
  if (_.isArray(input.context)) {
    return input.context;
  }
  var result = (input.prefix || '') + (input.context || '') + (input.suffix || '');
  return strip(result);
}
632434
private String regExp(String htmlInput) {

        String parsedHtml = htmlInput.trim();

        if (m_modeWord) {
            // process all cleanup regular expressions
            for (int i = 0; i < m_cleanupPatterns.length; i++) {
                parsedHtml = m_clearStyle[i].matcher(parsedHtml).replaceAll("");
            }
        }

        // process all replace regular expressions
        for (int i = 0; i < m_replacePatterns.length; i++) {
            parsedHtml = m_replaceStyle[i].matcher(parsedHtml).replaceAll(m_replaceValues[i]);
        }

        return parsedHtml;
    }
602935
def _process(self, input):
        '''
        
        '''

        input = re.sub("<[^>]*>", " ", input) 
        punct = list(string.punctuation)
        for symbol in punct:
            input = input.replace(symbol, " %s " % symbol)
        input = filter(lambda x: x != u'', input.lower().split(' '))
        return input
279817
function processHtmlAttributes(input = {}) {
    const attributes = {};
    const htmlAttributes = input.htmlAttributes;
    const wildcardAttributes = input['*'];

    let obj = htmlAttributes || wildcardAttributes;
    if (htmlAttributes && wildcardAttributes) {
        obj = Object.assign(wildcardAttributes, htmlAttributes);
    }

    if (obj) {
        Object.keys(obj).forEach((key) => {
            attributes[camelToKebab(key)] = obj[key];
        });
    }

    return attributes;
}
205757
function(input) {
      // 清理input数据、因为parsed数据最终会被缓存，
      // 我们要尽量让相同的选择器只对应一份parsed数据
      input = clean(input);
      // 先检查缓存中是否有数据
      if (parsed = this.cache.get(input)) return parsed;
      // 如果没有: 初始化参数
      var parsed = this.parsed = [
        [null]
      ];
      var remain = this.input = input;
      var TRUNK = this.TRUNK;
      var prevRemain;
        // 将remain进行this._process这里每匹配一个字符串都会进行一次reduce
      while (prevRemain != (remain = remain.replace(TRUNK, this._process.bind(this)))) {
        prevRemain = remain;
      }
      // 如果没有被解析完 证明选择器字符串有不能被解析的部分
      if (remain !== '') this.error(remain);
      // 返回数据并推入cache
      return this.cache.set(input, parsed);
    }
1052299
function simpleCloneInputData(input) {
    // make a simple copy of the pointers because we will get a reference if we don't
    // we only need clientXY for the calculations
    var pointers = [];
    var i = 0;
    while (i < input.pointers.length) {
        pointers[i] = {
            clientX: round(input.pointers[i].clientX),
            clientY: round(input.pointers[i].clientY)
        };
        i++;
    }

    return {
        timeStamp: now(),
        pointers: pointers,
        center: getCenter(pointers),
        deltaX: input.deltaX,
        deltaY: input.deltaY
    };
}
422860
function toCodePoints(input) {
  const codepoints = [];
  const size = input.length;

  for (let i = 0; i < size; i += 1) {
    const before = input.charCodeAt(i);

    if (before >= 0xd800 && before <= 0xdbff && size > i + 1) {
      const next = input.charCodeAt(i + 1);

      if (next >= 0xdc00 && next <= 0xdfff) {
        codepoints.push((before - 0xd800) * 0x400 + next - 0xdc00 + 0x10000);
        i += 1;
        continue;
      }
    }

    codepoints.push(before);
  }

  return codepoints;
}
269370
private static String unescapeHtml(final String input) {
        StringBuilder writer = null;
        int len = input.length();
        int i = 1;
        int st = 0;
        while (true) {
            // look for '&'
            while (i < len && input.charAt(i-1) != '&') {
                i++;
            }
            if (i >= len) {
                break;
            }

            // found '&', look for ';'
            int j = i;
            while (j < len && j < i + MAX_ESCAPE + 1 && input.charAt(j) != ';') {
                j++;
            }
            if (j == len || j < i + MIN_ESCAPE || j == i + MAX_ESCAPE + 1) {
                i++;
                continue;
            }

            // found escape
            if (input.charAt(i) == '#') {
                // numeric escape
                int k = i + 1;
                int radix = 10;

                final char firstChar = input.charAt(k);
                if (firstChar == 'x' || firstChar == 'X') {
                    k++;
                    radix = 16;
                }

                try {
                    int entityValue = Integer.parseInt(input.substring(k, j), radix);

                    if (writer == null) {
                        writer = new StringBuilder(input.length());
                    }
                    writer.append(input.substring(st, i - 1));

                    if (entityValue > 0xFFFF) {
                        final char[] chrs = Character.toChars(entityValue);
                        writer.append(chrs[0]);
                        writer.append(chrs[1]);
                    }
                    else if(entityValue == 39) {
                        writer.append('\'');
                    }
                    else {
                        writer.append(entityValue);
                    }

                }
                catch (NumberFormatException ex) {
                    i++;
                    continue;
                }
            }
            else {
                // named escape
                CharSequence value = LOOKUP_MAP.get(input.substring(i, j));
                if (value == null) {
                    i++;
                    continue;
                }

                if (writer == null) {
                    writer = new StringBuilder(input.length());
                }
                writer.append(input.substring(st, i - 1));

                writer.append(value);
            }

            // skip escape
            st = j + 1;
            i = st;
        }

        if (writer != null) {
            writer.append(input.substring(st, len));
            return writer.toString();
        }
        return input;
    }
489550
function parseObj (input) {
  try {
    return require(path.resolve(input));
  } catch (e) {
    var str;
    try {
      str = fs.readFileSync(program.obj, 'utf8');
    } catch (e) {
      str = program.obj;
    }
    try {
      return JSON.parse(str);
    } catch (e) {
      return eval('(' + str + ')');
    }
  }
}
653501
function() {
      var result = new StringBuffer();
      var array = this._input.split('');
      // var prev = null;

      for (var i = 0; i < array.length; i++) {
        var cur = array[i];
        var next = array[i + 1];

        if (typeof next !== 'undefined') {
          var curToken = cur + next;

          if (this._mode.tokens.ia[curToken]) {
            var nextNext = array[i + 2];
            if (typeof nextNext === 'undefined' || /^[-\s]$/.test(nextNext)) {
              result.append(this._mode.tokens.ia[curToken]);
              i++;
              continue;
            }
          }
        }

        if (this._mode.cyr2lat[cur]) {
          result.append(this._mode.cyr2lat[cur]);
        } else {
          result.append(cur);
        }

        // prev = cur;
      }

      return result.toString();
    }
1024854
function( input ) {

		if ( input == null ) {

			input = this.result;

		}
		 	this.result = input;

		  this.alphaNum(this.result);

			this.halfSpace( this.result );

			this.removeArabicChar( this.result );

			return this;

		}
706104
function fromBytes(input){
    var len = input.length;
    var output = '';

    for (var i = 0; i < len; i++)
      output += chars[input[i]];

    return output;
  }
160702
function( input ) {

		if ( input == null ) {

			input = this.result;

		}

		for (var i = 0; i < input.length; i++) {

			if ( isNaN( parseInt( input.charAt( i ) ) ) ) continue;

			else {

			this.temp = this.persian_number[ parseInt( input.charAt( i ) ) ];

			this.result = this.result.replace( input.charAt( i ), this.temp );

			}

		}

		return this;

	}
424824
public static ByteBuffer decode(String input) throws IOException {
		return decode(input.getBytes(StandardCharsets.US_ASCII));
	}