This is very much a private function we use to make the tests take up fewer server resources after they complete.
166321
function () {
    var self = this;
    _.each(_.clone(self._subscriptions), function (sub, id) {
      // Avoid killing the autoupdate subscription so that developers
      // still get hot code pushes when writing tests.
      //
      // XXX it's a hack to encode knowledge about autoupdate here,
      // but it doesn't seem worth it yet to have a special API for
      // subscriptions to preserve after unit tests.
      if (sub.name !== 'meteor_autoupdate_clientVersions') {
        self._send({msg: 'unsub', id: id});
        delete self._subscriptions[id];
      }
    });
  }
1212039
void channelCloses(final SynchronizeFXWebsocketChannel synchronizeFXTomcatChannel) {
        synchronized (channels) {
            if (isCurrentlyShutingDown) {
                return;
            }
            // Maybe a bit inefficient but the alternative would be to pass cannelName and SynchronizeFxServer to the
            // channel just to be able to close itself.
            final Iterator<Entry<String, SynchronizeFXWebsocketChannel>> channelIterator =
                    channels.entrySet().iterator();
            while (channelIterator.hasNext()) {
                if (channelIterator.next().getValue().equals(synchronizeFXTomcatChannel)) {
                    channelIterator.remove();
                }
            }

            final Iterator<Entry<SynchronizeFxServer, SynchronizeFXWebsocketChannel>> serverIterator =
                    servers.entrySet().iterator();
            while (serverIterator.hasNext()) {
                if (serverIterator.next().getValue().equals(synchronizeFXTomcatChannel)) {
                    serverIterator.remove();
                }
            }

            final Iterator<Entry<Session, SynchronizeFXWebsocketChannel>> clientIterator =
                    clients.entrySet().iterator();
            while (clientIterator.hasNext()) {
                if (clientIterator.next().getValue().equals(synchronizeFXTomcatChannel)) {
                    clientIterator.remove();
                }
            }
        }
    }
339257
function stop() {
  return new Promise((resolve) => {
    if (child && child.kill) {
      debug('stopping test server');
      child.kill('SIGTERM');
      process.removeListener('exit', stop);
      child = null;
      debug('stopped test server');
    }

    resolve();
  });
}
309798
def removeOldRequests
      now = Time.new
      @requestedPieces.length.times do |i|
        if @requestedPieces.set? i
          if now - @pieceRequestTime[i] > @requestTimeout
            @requestedPieces.clear i
            @pieceRequestTime[i] = nil
          end
        end
      end
    end
595276
function shutdown() {
  ee.emitAsync('shutdown_server')
    .then(() => ee.emitAsync('shutdown_service'))
    .then(() => {
      ee.emit('shutted_down');
    })
    .catch((err) => {
      ee.emit('error', err); // TODO [ERR2BTERR] Maybe err -> BootError(err)
    });
}
593645
function isolate(fn, val) {
    var value, lastPromise;

    // Reset lastPromise for nested helpers
    Test.lastPromise = null;

    value = fn(val);

    lastPromise = Test.lastPromise;
    Test.lastPromise = null;

    // If the method returned a promise
    // return that promise. If not,
    // return the last async helper's promise
    if (value && value instanceof Test.Promise || !lastPromise) {
      return value;
    } else {
      return run(function () {
        return Test.resolve(lastPromise).then(function () {
          return value;
        });
      });
    }
  }
634011
private void closeOnSuccess() {

        Timer closeTimer = new Timer() {

            /**
             * @see com.google.gwt.user.client.Timer#run()
             */
            @Override
            public void run() {

                CmsSingleFileUploadDialog.this.hide();
            }
        };
        closeTimer.schedule(1000);
    }
453806
function privateCreatePoolIfNotExists() {
        var createPoolOptions = Object.assign({}, defaultOptions, that.options, importantOptions);
        if (pool == null) {
            pool = mysql.createPool(createPoolOptions);
        }
    }
50112
def private(self):
        
        req = self.request(self.mist_client.uri+'/keys/'+self.id+"/private")
        private = req.get().json()
        return private
1250029
function _final() {
  var self = this;

  cluster.removeListener('fork', self._onFork);
  cluster.removeListener('disconnect', self._onDisconnect);
}
340756
function closeServer(done) {
            if (self.server) {
                self.server.close();
                self.server.removeListener('error', handlers.relayError);
            }
            self.httpServer.close(done);
        }
902002
def _setPrivate(self, private):
        """"""
        self.private = private
        self.public = pow(self.generator, self.private, self.modulus)
1077692
function decreaseBufferPool () {
  if (bufferPool.length > 50 * 1024) {
    if (counter === 1 || notDecreased > counter * 2) {
      const minSliceLen = Math.floor(bufferPool.length / 10)
      const sliceLength = minSliceLen < bufferOffset
        ? bufferOffset
        : minSliceLen
      bufferOffset = 0
      bufferPool = bufferPool.slice(sliceLength, bufferPool.length)
    } else {
      notDecreased++
      counter--
    }
  } else {
    clearInterval(interval)
    counter = 0
    notDecreased = 0
    interval = null
  }
}
392073
def omit(self):
        """"""
        self._omit = self.lib.iperf_get_test_omit(self._test)
        return self._omit
971909
def defer_reduce(func, items, test, accum=None):
    '''
    '''
    removals = []

    for k, item in enumerate(items):
        if test(item, accum):
            removals.append(k)
            if accum is None:
                accum = item
            else:
                accum = func(accum, item)
        
    deferred = indices_removed(items, removals)
    
    if deferred == items or not deferred:
        return accum, deferred

    return defer_reduce(func, deferred, test, accum)
1006236
function enableDestroy(server) {
    var connections = [];
    server.on('connection', function (conn) {
        var key = connections.push(conn);
        conn.on('close', function () {
            delete connections[key];
        });
    });
    server.destroy = function (cb) {
        server.close(cb);
        for (var key in connections)
            connections[key].destroy();
    };
}
729519
private void tearDownShiro()
  {
    try
    {
      SecurityManager securityManager = SecurityUtils.getSecurityManager();

      LifecycleUtils.destroy(securityManager);
      ThreadContext.unbindSecurityManager();
      ThreadContext.unbindSubject();
      ThreadContext.remove();
    }
    catch (UnavailableSecurityManagerException e)
    {

      // we don't care about this when cleaning up the test environment
      // (for example, maybe the subclass is a unit test and it didn't
      // need a SecurityManager instance because it was using only mock Subject instances)
    }

    SecurityUtils.setSecurityManager(null);
  }