Executes the purge functionality.
970855
def do_purge(bare=False, downloads=False, allow_global=False):
    """"""

    if downloads:
        if not bare:
            click.echo(crayons.normal(fix_utf8("Clearing out downloads directory…"), bold=True))
        vistir.path.rmtree(project.download_location)
        return

    # Remove comments from the output, if any.
    installed = set([
        pep423_name(pkg.project_name) for pkg in project.environment.get_installed_packages()
    ])
    bad_pkgs = set([pep423_name(pkg) for pkg in BAD_PACKAGES])
    # Remove setuptools, pip, etc from targets for removal
    to_remove = installed - bad_pkgs

    # Skip purging if there is no packages which needs to be removed
    if not to_remove:
        if not bare:
            click.echo("Found 0 installed package, skip purging.")
            click.echo(crayons.green("Environment now purged and fresh!"))
        return installed

    if not bare:
        click.echo(
            fix_utf8("Found {0} installed package(s), purging…".format(len(to_remove)))
        )

    command = "{0} uninstall {1} -y".format(
        escape_grouped_arguments(which_pip(allow_global=allow_global)),
        " ".join(to_remove),
    )
    if environments.is_verbose():
        click.echo("$ {0}".format(command))
    c = delegator.run(command)
    if c.return_code != 0:
        raise exceptions.UninstallError(installed, command, c.out + c.err, c.return_code)
    if not bare:
        click.echo(crayons.blue(c.out))
        click.echo(crayons.green("Environment now purged and fresh!"))
    return installed
1372818
public function execute()
    {
        if ($this->hasOption('start')) {
            $this->options[] = 'doNotSelfQlose';
            echo new HTML\Tag('script', $this->args, $this->options);

            return;
        }

        $options = $this->options;
        $options[] = 'doNotSelfQlose';
        if (in_array('compressJs', $options)) {
            $options[] = 'inlineInner';
        }

        $Tag = new HTML\Tag('script', $this->args, $options);

        $Tag->open();
        $Tag->content();
        $Tag->close();
    }
563469
protected function performAction()
    {
        $count = $this->db->delete("gems__appointments", $this->getWhere());

        $this->addMessage(sprintf($this->plural(
                '%d appointment deleted.',
                '%d appointments deleted.',
                $count
                ), $count));


        $this->setAfterCleanupRoute();
    }
336845
public function fire()
	{
		$database = $this->input->getOption('database');

		$this->call('migrate:reset', array('--database' => $database));

		// The refresh command is essentially just a brief aggregate of a few other of
		// the migration commands and just provides a convenient wrapper to execute
		// them in succession. We'll also see if we need to res-eed the database.
		$this->call('migrate', array('--database' => $database));

		if ($this->needsSeeding())
		{
			$this->runSeeder($database);
		}
	}
177812
def clean(self):
        ''''''
        if self.config.clean:
            logger.info('Cleaning')
            self.execute(self.config.clean)
300521
public void run() {
    long purged_columns;
    try {
      purged_columns = purgeUIDMeta().joinUninterruptibly();
      LOG.info("Thread [" + thread_id + "] finished. Purged [" + 
          purged_columns + "] UIDMeta columns from storage");
      
      purged_columns = purgeTSMeta().joinUninterruptibly();
      LOG.info("Thread [" + thread_id + "] finished. Purged [" + 
          purged_columns + "] TSMeta columns from storage");
    } catch (Exception e) {
      LOG.error("Unexpected exception", e);
    }
    
  }
810577
public function execute()
    {
        $this->addFromDeleteRels();

        $this->getModelsToDelete()->byRepo(function (Repo $repo, Models $models) {
            $repo->deleteModels($models);
        });

        $this->addFromInsertRels();

        $this->getModelsToInsert()->assertValid()->byRepo(function (Repo $repo, Models $models) {
            $repo->insertModels($models);
        });

        $this->addFromUpdateRels();

        $this->getModelsToUpdate()->assertValid()->byRepo(function (Repo $repo, Models $models) {
            $repo->updateModels($models);
        });
    }
152039
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->purgeMissingFamilies($output);
        $this->purgeMissingAttributes($output);
    }
588854
public function execute() {
        if (\core\task\database_logger::class == \core\task\logmanager::get_logger_classname()) {
            \core\task\database_logger::cleanup();
        }
    }
85862
public function execute() {
        global $CFG, $DB;

        $timenow = time();

        // Cleanup read and unread notifications.
        if (!empty($CFG->messagingdeleteallnotificationsdelay)) {
            $notificationdeletetime = $timenow - $CFG->messagingdeleteallnotificationsdelay;
            $params = array('notificationdeletetime' => $notificationdeletetime);
            $DB->delete_records_select('notifications', 'timecreated < :notificationdeletetime', $params);
        }

        // Cleanup read notifications.
        if (!empty($CFG->messagingdeletereadnotificationsdelay)) {
            $notificationdeletetime = $timenow - $CFG->messagingdeletereadnotificationsdelay;
            $params = array('notificationdeletetime' => $notificationdeletetime);
            $DB->delete_records_select('notifications', 'timeread < :notificationdeletetime', $params);
        }
    }
343933
public function execute() {
		$this->out(__d('cake_notify', 'Clear notifications in progress...'), 1, Shell::NORMAL);
		if ($this->Notification->clearNotifications()) {
			$this->out('<success>' . __d('cake_notify', 'Notifications clear successfully.') . '</success>', 1, Shell::NORMAL);
		} else {
			$this->out('<error>' . __d('cake_notify', 'Notifications clear unsuccessfully.') . '</error>');
		}
	}
566790
public function handle()
    {
        $this->purgeScreenshots();

        $this->purgeConsoleLogs();

        $options = array_slice($_SERVER['argv'], $this->option('without-tty') ? 3 : 2);

        return $this->withDuskEnvironment(function () use ($options) {
            $process = (new Process(array_merge(
                $this->binary(), $this->phpunitArguments($options)
            )))->setTimeout(null);

            try {
                $process->setTty(! $this->option('without-tty'));
            } catch (RuntimeException $e) {
                $this->output->writeln('Warning: '.$e->getMessage());
            }

            return $process->run(function ($type, $line) {
                $this->output->write($line);
            });
        });
    }
1177628
public function executeDataPurge()
    {
        $this->checkDataPurgeAdminSettingsIsEnabled();

        Piwik::checkUserHasSuperUserAccess();
        $this->checkTokenInUrl();

        // if the request isn't a POST, redirect to index
        if ($_SERVER["REQUEST_METHOD"] != "POST"
            && !Common::isPhpCliMode()
        ) {
            $this->redirectToIndex('PrivacyManager', 'privacySettings');
            return;
        }

        $settings = PrivacyManager::getPurgeDataSettings();
        if ($settings['delete_logs_enable']) {
            /** @var LogDataPurger $logDataPurger */
            $logDataPurger = StaticContainer::get('Piwik\Plugins\PrivacyManager\LogDataPurger');
            $logDataPurger->purgeData($settings['delete_logs_older_than'], true);
        }
        if ($settings['delete_reports_enable']) {
            $reportsPurger = ReportsPurger::make($settings, PrivacyManager::getAllMetricsToKeep());
            $reportsPurger->purgeData(true);
        }
    }
531839
public function execute() {
        global $DB;

        // Check if the category bin is disabled or there is no expiry time.
        $lifetime = get_config('tool_recyclebin', 'categorybinexpiry');
        if (!\tool_recyclebin\category_bin::is_enabled() || $lifetime <= 0) {
            return true;
        }

        // Get the items we can delete.
        $items = $DB->get_recordset_select('tool_recyclebin_category', 'timecreated <= :timecreated',
            array('timecreated' => time() - $lifetime));
        foreach ($items as $item) {
            mtrace("[tool_recyclebin] Deleting item '{$item->id}' from the category recycle bin ...");
            $bin = new \tool_recyclebin\category_bin($item->categoryid);
            $bin->delete_item($item);
        }
        $items->close();

        return true;
    }
51455
public function execute()
    {
        $this->triggerBeforeCreationEvent();
        $operation = $this->getAddOperation()->setServer($this->server);
        $this->connection->execute($operation);
        $this->triggerAfterCreationEvent($operation);
    }
1102356
def execute(self):
        """"""
        clean_cmd = ['git', 'clean', '-X', '-d']
        if 'CI' not in os.environ:
            LOGGER.info('The following files/directories will be deleted:')
            LOGGER.info('')
            LOGGER.info(check_output(clean_cmd + ['-n']).decode())
            if not strtobool(input('Proceed?: ')):
                return False
        check_call(clean_cmd + ['-f'])
        empty_dirs = self.get_empty_dirs(self.env_root)
        if empty_dirs != []:
            LOGGER.info('Now removing empty directories:')
        for directory in empty_dirs:
            LOGGER.info("Removing %s/", directory)
            shutil.rmtree(os.path.join(self.env_root, directory))
        return True
96726
private void startPurgeTimer() {
        if (null != this.future || null == this.scheduler) {
            return;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Creating repeating purge event");
        }
        this.future = this.scheduler.schedule(SessionEventHandler.PURGE_EVENT, this.purgeInterval, this.purgeInterval, TimeUnit.SECONDS);
    }