This method is used as a modifier for minification to clean up
the stream a bit.
543540
function cleanContent() {
    function transform(file, cb) {
        file.contents = new Buffer((function (src) {
            var lines = src.replace('_.mixin({\n','').split('\n'),
                last = lines.pop();
            // handle empty lines at the end of the file
            while(last===''){
                last = lines.pop();
            }
            return lines.join('\n');
        })(String(file.contents)));
        cb(null, file);
    }

    return require('event-stream').map(transform);
}
195007
def cleanup(self):
        
        plots = self.traverse(lambda x: x, [Plot])
        for plot in plots:
            if not isinstance(plot, (GenericCompositePlot, GenericElementPlot, GenericOverlayPlot)):
                continue
            for stream in set(plot.streams):
                stream._subscribers = [
                    (p, subscriber) for p, subscriber in stream._subscribers
                    if util.get_method_owner(subscriber) not in plots]
        if self.comm:
            self.comm.close()
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);
	});
}
1030307
private void cleanupProcess(LinuxProcess linuxProcess, int stdinFd, int stdoutFd, int stderrFd)
   {
      pidToProcessMap.remove(linuxProcess.getPid());
      fildesToProcessMap.remove(stdinFd);
      fildesToProcessMap.remove(stdoutFd);
      fildesToProcessMap.remove(stderrFd);

      //        linuxProcess.close(linuxProcess.getStdin());
      //        linuxProcess.close(linuxProcess.getStdout());
      //        linuxProcess.close(linuxProcess.getStderr());

      if (linuxProcess.cleanlyExitedBeforeProcess.get()) {
         linuxProcess.onExit(0);
         return;
      }

      IntByReference ret = new IntByReference();
      int rc = LibC.waitpid(linuxProcess.getPid(), ret, LibC.WNOHANG);

      if (rc == 0) {
         deadPool.add(linuxProcess);
      }
      else if (rc < 0) {
         linuxProcess.onExit((Native.getLastError() == LibC.ECHILD) ? Integer.MAX_VALUE : Integer.MIN_VALUE);
      }
      else {
         handleExit(linuxProcess, ret.getValue());
      }
   }
584715
void shrink()
  {

    int n = m_opMap.elementAt(MAPINDEX_LENGTH);
    m_opMap.setToSize(n + 4);

    m_opMap.setElementAt(0,n);
    m_opMap.setElementAt(0,n+1);
    m_opMap.setElementAt(0,n+2);


    n = m_tokenQueue.size();
    m_tokenQueue.setToSize(n + 4);

    m_tokenQueue.setElementAt(null,n);
    m_tokenQueue.setElementAt(null,n + 1);
    m_tokenQueue.setElementAt(null,n + 2);
  }
442036
protected void eliminate()
    {
        int count = end-begin;
        int mod = Math.floorMod(begin, size);
        while (count > 0 && isRemovable(mod))
        {
            remove(mod);
            begin++;
            count--;
            mod = Math.floorMod(begin, size);
        }
    }
34989
void performCleanUp(@Nullable Runnable task) {
    evictionLock.lock();
    try {
      maintenance(task);
    } finally {
      evictionLock.unlock();
    }
    if ((drainStatus() == REQUIRED) && (executor == ForkJoinPool.commonPool())) {
      scheduleDrainBuffers();
    }
  }
626161
function sweep() {

    # remove used values
    foreach (array_keys($this->flash) as $k) {
      if ($this->used[$k]) {
        unset($this->flash[$k], $this->used[$k]);
      } else {
        $this->_use($k);
      }
    }

    # cleanup if someone meddled with flash or used
    $fkeys = array_keys($this->flash);
    $ukeys = array_keys($this->used);
    foreach (array_diff($fkeys, $ukeys) as $k => $v) {
      unset($this->used[$k]);
    }
  }
1043998
function(stream, data, cb) {
  // Reference default write method
  const oldWrite = stream.write;

  // Clear hook function
  const clearHook = function() {
    stream.write = oldWrite;
  };

  // New stream write with our shiny function
  stream.write = function() {
    // Old behaviour
    oldWrite.apply(stream, arguments);
    // Hook
    if (arguments[0] === data) {
      clearHook();
      cb();
    }
  };
}
1176210
function() {
    if ( !this.modifiers ) {
      return;
    }

    this.modifiers.forEach( function( modifier ) {
      if ( classList.contains( this.element, modifier.ui.base ) ) {
        if ( modifier.initialize ) {
          this.initializers.push( modifier.initialize );
          delete modifier.initialize;
        }
        assign( this, modifier );
      }
    }, this );
  }
777006
@Override
  public void cleanup() {
    // @formatter:off
    this
      .setMLSupporter(null)
      .setStatisticsSupporter(null)
      .setIndexingHandler(null)
      .setJoinsHandler(null)
      .setMetaDataHandler(null)
      .setMiscellanyHandler(null)
      .setMissingDataHandler(null)
      .setMutabilityHandler(null)
      .setSqlHandler(null)
      .setPersistenceHandler(null)
      .setRepresentationHandler(null)
      .setReshapingHandler(null)
      .setSchemaHandler(null)
      .setStreamingDataHandler(null)
      .setTimeSeriesHandler(null)
      ;
    // @formatter:on
  }
1255918
function minifyCss() {
  var stream = gulp.src([compiled.css + '/**/*', '!' + compiled.css + '/styleguide*'])
    .pipe(plugins.minifyCss())
    .pipe(plugins.rename({ suffix: '.min' }))
    .pipe(gulp.dest(dist.css));
  return stream;
}
73206
public ValidationData minimalize() {
        this.setValidationRules(this.validationRules.stream().filter(vr -> vr.isUse()).collect(Collectors.toList()));
        return this;
    }
82775
function crop(stream, config, cb) {
  PNGCrop.cropToStream(stream, config, function(err, outputStream) {
    var buf = concat(function(data) {
      cb(err, data);
    });
    outputStream.pipe(buf);
  });
}
1200427
def Trim(self):
        
        ms = StreamManager.GetStream()
        writer = BinaryWriter(ms)
        self.SerializeUnsigned(writer)
        writer.WriteByte(1)
        self.Script.Serialize(writer)

        writer.WriteHashes([tx.Hash.ToBytes() for tx in self.Transactions])
        retVal = ms.ToArray()
        StreamManager.ReleaseStream(ms)
        return retVal
1224776
private void makeIncoming() {
        if (stays == null && move == null) {
            for (BitSet in : ins) {
                in.clear();
            }
            stays = new BitSet();
            move = new BitSet();
            for (int i = 0; i < hosts.length; i++) {
                if (hosts[i] != null && hosts[i].isInstantiated()) {
                    int newPos = hosts[i].getValue();
                    if (oldPos[i] != -1 && newPos != oldPos[i]) {
                        //The VM has move
                        ins[newPos].set(i);
                        move.set(i);
                    } else if (newPos == oldPos[i]) {
                        stays.set(i);
                    }
                }
            }
        }
    }
446302
public function minify()
    {
        $css_files = $this->cleanStack($this->get(), 'file');

        $organized_css = array('rest'=>array());
        foreach ($css_files as $_file) {
            if (!empty($_file['media'])) {
                if (!isset($organized_css[ $_file['media'] ])) {
                    $organized_css[ $_file['media'] ] = array();
                }
                $organized_css[ $_file['media'] ][] = $_file;
            } else {
                $organized_css['rest'][] = $_file;
            }
        }

        foreach ($organized_css as $media=>$stack) {
            $cleaned_stack = $this->extractFromStack($stack, 'file');
            if (!empty($cleaned_stack)) {
                $this->addMinified(
                    $this->minifyStack($cleaned_stack), $media=='rest' ? 'screen' : $media
                );
            }
        }

        return $this;
    }