Minify & Obsfuscate Function
17809
function parseData(source_code) {
			let functions = [];
			let variables = [];
			let new_source = '';
				
			// Return an array of tokens (same as php function token_get_all) 
			let tokens = parser.tokenGetAll(source_code);

			tokens.forEach((token, key) => {
				if(!Array.isArray(token)){
					new_source += token;
					return;
				}

				if(token[0] == 'T_VARIABLE' && options.excludes.indexOf(token[1]) < 0)
					if(!variables[token[1]]) variables[token[1]] = uniqid.time();

				if(token[0] == 'T_STRING' && typeof tokens[key-2] !== 'undefined' && Array.isArray(tokens[key-2]) && tokens[key-2][1] == "$this")
					if(!variables["$" + token[1]]) variables["$" + token[1]] = uniqid.time();

				if(token[0] == 'T_STRING' && typeof tokens[key-2] !== 'undefined' && Array.isArray(tokens[key-2]) && tokens[key-2][1] == "function")
					if(!functions[token[1]]) functions[token[1]] = token[1];

				if(options.minify.remove_comments && (token[0] == 'T_COMMENT' || token[0] == 'T_DOC_COMMENT'))
					return;

				new_source += token[1];
			});

			// Minify and Obsfuscate
			tokens = parser.tokenGetAll(new_source);

			new_source = '';
			tokens.forEach((token, key) => {
				if(Array.isArray(token))
				{
					if(token[0] == 'T_VARIABLE' && options.minify.replace_variables && options.excludes.indexOf(token[1]) < 0) {
						new_source += "$" + variables[token[1]];
					} 
					else if(token[0] == 'T_WHITESPACE' && options.minify.remove_whitespace) {
						if(typeof tokens[key-1] !== 'undefined' && typeof tokens[key+1] !== 'undefined' 
							&& Array.isArray(tokens[key-1]) && Array.isArray(tokens[key+1]) 
							&& tokens[key-1][1].match(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/) 
							&& tokens[key-1][1].match(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/)
						){
							new_source += " ";
						}
					} 
					else if(token[0] == 'T_STRING' && typeof tokens[key-2] !== 'undefined' && Array.isArray(tokens[key-2]) && tokens[key-2][1] == "$this" && options.minify.replace_variables && options.excludes.indexOf(token[1]) < 0) 
					{
						if(!functions[token[1]]){
							new_source += variables["$" + token[1]];
						} else {
							new_source += token[1];
						}
					}
					else if(token[0] == 'T_CASE') {
						new_source += token[1] + " ";
					} 
					else if(token[0] == 'T_OPEN_TAG') {
						new_source += "<?php ";
					}
					else if (token[0] == 'T_CLOSE_TAG') {
						new_source += " ?>";
					}
					else if (token[0] == 'T_INLINE_HTML'){
						new_source += token[1].replace(/[\n\r]+/g, '').replace(/\s{2,10}/g, ' ');
					}
					else {
						new_source += token[1];
					}
				} else {
					new_source += token;
				}
			}, this);

			//  Finished
			if(options.output){
				fs.writeFile(options.output, new_source, (err) => {
					if (err) reject('Error: Can’t Write to File');
					resolve();
				});
			} else {
				resolve(new_source);
			}
		}
927666
def flat(self, obj, mask=0):
        '''
        '''
        s = self.base
        if self.leng and self.item > 0:  # include items
            s += self.leng(obj) * self.item
        if _getsizeof:  # _getsizeof prevails
            s = _getsizeof(obj, s)
        if mask:  # align
            s = (s + mask) & ~mask
        return s
783274
function minimizeImage(src, dest, cb) {
    squirrel(
        IMIN_MODULES, IMIN_OPTIONS,
        (err, Imagemin) => {
            const safeCb = (err) => {
                if (err) {
                    logger.error(err);
                }
                cb();
            };

            if (err) {
                safeCb(err);
            } else {
                const imin = new Imagemin()
                    .src(src)
                    .dest(dest)
                    .use(Imagemin.jpegtran({progressive: true}))
                    .use(Imagemin.optipng({optimizationLevel: 3}))
                    .use(Imagemin.gifsicle({interlaced: true}))
                    .use(Imagemin.svgo());

                imin.run(safeCb);
            }
        }
    );
}
683859
def transformer_aux_tiny():
  """"""
  hparams = transformer.transformer_tiny()
  hparams.shared_embedding_and_softmax_weights = False
  hparams.add_hparam("shift_values", "1,2")
  return hparams
1141934
function prettify ( fnBody ) {
  	var lines = fnBody
  		.replace( /^\t+/gm, function ( tabs ) { return tabs.split( '\t' ).join( '  ' ); } )
  		.split( '\n' );

  	var minIndent = lines.length < 2 ? 0 :
  		lines.slice( 1 ).reduce( function ( prev, line ) {
  			return Math.min( prev, /^\s*/.exec( line )[0].length );
  		}, Infinity );

  	return lines.map( function ( line, i ) {
  		return '    ' + ( i ? line.substring( minIndent ) : line );
  	}).join( '\n' );
  }
94374
function obv (fn, immediate) {
    if(!fn) return state
    listeners.push(fn)
    if(immediate !== false && fn(state) === true) obv.more()
    return function () {
      var i = listeners.indexOf(fn)
      listeners.splice(i, 1)
    }
  }
520416
function(arr, func, obj, func2){
					var big = [obj, func2];
					each(arr, function(i, item){
						big.unshift(item, func)
					});
					when.apply(steal, big);
				}
1365261
function omit(array, exp) {

  if(!isArray(array) || isUndefined(exp)) {
    return array;
  }

  return array.filter(function(elm) {
    return (isObject(elm) || isFunction(exp))
      ? !$parse(exp)(elm)
      : elm !== exp;
  });
}
207402
def minimize(self, minimize):
        '''
        '''

        self._minimize = minimize
        self._logger.log('debug', 'Minimize set to {}'.format(minimize))
769088
function rule(analyzer) {
	analyzer.setMetric('notMinified');

	/**
	 * A simple CSS minification detector
	 */
	function isMinified(css) {
		// analyze the first 1024 characters
		css = css.trim().substring(0, 1024);

		// there should be no newline in minified file
		return /\n/.test(css) === false;
	}

	analyzer.on('css', function(css) {
		analyzer.setMetric('notMinified', isMinified(css) ? 0 : 1);
	});
}
258012
function omit(obj, remove) {
  var result = {};
  if (typeof remove === 'string') {
    remove = [].slice.call(arguments, 1);
  }
  for (var prop in obj) {
    if (!obj.hasOwnProperty || obj.hasOwnProperty(prop)) {
      if (remove.indexOf(prop) === -1) {
        result[prop] = obj[prop];
      }
    }
  }
  return result;
}
87783
function collapseCurrent() {
        var editor = EditorManager.getFocusedEditor();
        if (!editor) {
            return;
        }
        var cm = editor._codeMirror;
        var cursor = editor.getCursorPos(), i;
        // Move cursor up until a collapsible line is found
        for (i = cursor.line; i >= 0; i--) {
            if (cm.foldCode(i)) {
                editor.setCursorPos(i);
                return;
            }
        }
    }
601725
def minify(tokens, options):
    
    # Remove comments
    remove_comments(tokens)
    # Remove docstrings
    remove_docstrings(tokens)
    result = token_utils.untokenize(tokens)
    # Minify our input script
    result = multiline_indicator.sub('', result)
    result = fix_empty_methods(result)
    result = join_multiline_pairs(result)
    result = join_multiline_pairs(result, '[]')
    result = join_multiline_pairs(result, '{}')
    result = remove_blank_lines(result)
    result = reduce_operators(result)
    result = dedent(result, use_tabs=options.tabs)
    return result
376658
function adjustTarget(oMessage) {
					if (oMessage.target) {
						var aSegments = oMessage.target.split("/");

						if (aSegments.shift() === sBindingParameter) {
							oMessage.target = aSegments.join("/");
							return;
						}
					}
					delete oMessage.target;
				}
600074
function execExclude(file) {
    var result = false;
    excludeList.every(function (item) {
      if (minimatch(file, item)) {
        result = true;
      }
      return !result;
    });
    return result;
  }
1140245
def minify(text, minifier):
    ''''''
    # there really isn't a good way to know if a file is already minified.
    # our heuristic is if source is more than 50 bytes greater of dest OR
    # if a hard return is found in the first 50 chars, we assume it is not minified.
    minified = minifier(text)
    if  abs(len(text) - len(minified)) > 50 or '\n' in text[:50]:
        return minified
    return text
108739
function uglify(js) {
		return ugli.minify(js, {
			fromString: true,
			mangle: false,
			compress: {
				warnings: false
			}
		}).code;
	}