Cleans up anything from the process
437003
def close(self):
        
        self.logger.info("Closing Rest Service")
        self.closed = True

        # close threads
        self._close_thread(self._redis_thread, "Redis setup")
        self._close_thread(self._heartbeat_thread, "Heartbeat")
        self._close_thread(self._kafka_thread, "Kafka setup")
        self._close_thread(self._consumer_thread, "Consumer")

        # close kafka
        if self.consumer is not None:
            self.logger.debug("Closing kafka consumer")
            self.consumer.close()
        if self.producer is not None:
            self.logger.debug("Closing kafka producer")
            self.producer.close(timeout=10)
488285
public function clean()
    {
        $jobFiles = glob($this->getLocation() . '*.js');
        foreach ($jobFiles as $file) {
            unlink($file);
        }
    }
1252304
def Clean():
  """"""
  # Find all the compiled proto files and unlink them.
  for (root, _, files) in os.walk(ROOT):
    for filename in files:
      full_filename = os.path.join(root, filename)
      if full_filename.endswith("_pb2.py") or full_filename.endswith(
          "_pb2.pyc"):
        os.unlink(full_filename)
1019595
public function clean()
	{
		// So the task doesn't complain,
		// make any 'missing' dirs to cleanup
		array_map(function ($dir) {
			if ( ! is_dir($dir))
			{
				`mkdir -p {$dir}`;
			}
		}, $this->cleanDirs);

		$this->_cleanDir($this->cleanDirs);
		$this->_deleteDir($this->cleanDirs);
	}

	/**
	 * Run unit tests and generate coverage reports
	 */
	public function coverage()
	{
		$this->_run(['phpdbg -qrr -- vendor/bin/phpunit -c build']);
	}

	/**
	 * Generate documentation with phpdox
	 */
	public function docs()
	{
		$this->_run(['vendor/bin/phpdox']);
	}

	/**
	 * Verify that source files are valid
	 */
	public function lint()
	{
		$files = $this->getAllSourceFiles();

		$chunks = array_chunk($files, (int)`getconf _NPROCESSORS_ONLN`);

		foreach($chunks as $chunk)
		{
			$this->parallelLint($chunk);
		}
	}

	/**
	 * Run the phpcs tool
	 *
	 * @param bool $report - if true, generates reports instead of direct output
	 */
	public function phpcs($report = FALSE)
	{
		$dir = __DIR__;

		$report_cmd_parts = [
			'vendor/bin/phpcs',
			"--standard=./build/CodeIgniter",
			"--report-checkstyle=./build/logs/phpcs.xml",
		];

		$normal_cmd_parts = [
			'vendor/bin/phpcs',
			"--standard=./build/CodeIgniter",
		];

		$cmd_parts = ($report) ? $report_cmd_parts : $normal_cmd_parts;

		$this->_run($cmd_parts);
	}
805656
def cleanup(self):
        
        if getattr(self._finalizer, "detach", None) and self._finalizer.detach():
            if os.path.exists(self.path):
                try:
                    rmtree(self.path)
                except OSError:
                    pass
                else:
                    self.path = None
601351
def clean():
    """"""
    shutil.rmtree('{PROJECT_NAME}.egg-info'.format(PROJECT_NAME=PROJECT_NAME), ignore_errors=True)
    shutil.rmtree('build', ignore_errors=True)
    shutil.rmtree('dist', ignore_errors=True)
    shutil.rmtree('htmlcov', ignore_errors=True)
    shutil.rmtree('__pycache__', ignore_errors=True)
203839
def clean_process_meta(self):
        """"""
        ds = self.dataset
        ds.config.build.clean()
        ds.config.process.clean()
        ds.commit()
        self.state = self.STATES.CLEANED
1215146
def clean(self):
        """"""

        # Deleting seems to be really weird and unrelable.
        self._session \
            .query(Process) \
            .filter(Process.d_vid == self._d_vid) \
            .delete(synchronize_session='fetch')

        for r in self.records:
            self._session.delete(r)

        self._session.commit()
132389
public function cleanup()
    {
        $this->listeners = null;
        $this->producer = null;
        $this->args = [];
        $this->parent = null;
    }
1176056
@CommandArgument
  public void clean() {
    for (int i = 0; i < jobProgressStates.size();) {
      ProgressState state = jobProgressStates.get(i);
      if (state.isCancelled() || state.isComplete()) {
        jobProgressStates.remove(i);
      } else {
        i++;
      }
    }
  }
1260127
def _cleanup(self):
        '''
        
        '''
        self._declare_cb = None
        self._bind_cb = None
        self._unbind_cb = None
        self._delete_cb = None
        self._purge_cb = None
        super(QueueClass, self)._cleanup()
1305004
def _clean(self):
        """"""
        if self._workers:
            for w in self._workers:
                if w.is_finished():
                    self._workers.remove(w)

        if self._threads:
            for t in self._threads:
                if t.isFinished():
                    self._threads.remove(t)
        else:
            self._timer.stop()
524958
protected function cleanUpAll()
    {
        if ( $this->Options['clean-all'] )
        {
            $this->CLI->output( "eZSearchEngine: Cleaning up search data for all installations" );
            $searchEngine = new eZSolr();
            // The essence of teh All suffix
            $allInstallations = true;
            // Optimize: sets all indexes to minimal file size too
            $optimize = true;
            $searchEngine->cleanup( $allInstallations, $optimize );
        }
    }
622488
function cleanup(cleanups, start = 0) {
    for(let i = start; i < cleanups.length; ++i) {
        const res = cleanups[i]();
        if(res && res.then)
            return res.then(() => cleanup(cleanups, i+1));
    }
}
919395
function clean(done) {
	var del = require('del');
	del(cfg.destination).then(function () {
		if (typeof done === 'function') done();
		else process.exit();
	});
}
284995
def _clean(self):
        """"""
        if self._workers:
            for url in self._workers.copy():
                w = self._workers[url]
                if w.is_finished():
                    self._workers.pop(url)
                    self._paths.pop(url)
                    if url in self._get_requests:
                        self._get_requests.pop(url)

        else:
            self._timer.stop()
74872
public function cleanup() {
		foreach ( $this->_factories as $factory ) {
			if ( $factory instanceof \WPCC\Component\Factory ) {
				$factory->deleteAll();
			}
		}
	}