Delete a calculation and all associated outputs.
483865
def del_calculation(job_id, confirmed=False):
    
    if logs.dbcmd('get_job', job_id) is None:
        print('There is no job %d' % job_id)
        return

    if confirmed or confirm(
            'Are you sure you want to (abort and) delete this calculation and '
            'all associated outputs?\nThis action cannot be undone. (y/n): '):
        try:
            abort(job_id)
            resp = logs.dbcmd('del_calc', job_id, getpass.getuser())
        except RuntimeError as err:
            safeprint(err)
        else:
            if 'success' in resp:
                print('Removed %d' % job_id)
            else:
                print(resp['error'])
741684
def delete(self, *args, **kwargs):
        """"""
        # Store ids in memory as relations are also deleted with the Data object.
        storage_ids = list(self.storages.values_list('pk', flat=True))  # pylint: disable=no-member

        super().delete(*args, **kwargs)

        Storage.objects.filter(pk__in=storage_ids, data=None).delete()
580796
def teardown(self, np=np):
    """"""

    if self.old_err is not None:
        np.seterr(**self.old_err)

    if self.old_opts is not None:
        np.set_printoptions(**self.old_opts)
1240400
def erase(self):
        """"""
        with self._at_last_line():
            self.stream.write(self._term.clear_eol)
        self.stream.flush()
270711
private function cleanup()
    {
        foreach ($this->tokens as $i => $t) {
            if ($t[0] === self::$deleteToken) {
                unset($this->tokens[$i]);
            }
        }
        $this->tokens = array_values($this->tokens);
    }
788195
public void cleanUp() {
	int nI;
	for (nI = 0; nI < PBOX_ENTRIES; nI++)
	    m_pbox[nI] = 0;
	for (nI = 0; nI < SBOX_ENTRIES; nI++)
	    m_sbox1[nI] = m_sbox2[nI] = m_sbox3[nI] = m_sbox4[nI] = 0;
    }
1308513
def delete(self, s, p, o):
        """"""
        with self.walrus.atomic():
            for key in self.keys_for_values(s, p, o):
                del self._z[key]
1307479
async def delete(self):
        """"""
        interface = self._data['interface']
        data = await interface._handler.unlink_subnet(
            system_id=interface.node.system_id, id=interface.id, _id=self.id)
        interface._data['links'] = list(data['links'])
        interface._orig_data['links'] = copy.deepcopy(interface._data['links'])
762945
def _cleanup(self, kill, verbose):
        
        if kill:
            removed_indices = self.g.prune()

            self.nout -= len(removed_indices)

            if verbose and removed_indices:
                print('Removing %s' % removed_indices)

            for j in removed_indices:
                self.inv_map.pop(j[0])
335768
def clear():
    """"""
    fig = _context['figure']
    if fig is not None:
        fig.marks = []
        fig.axes = []
        setattr(fig, 'axis_registry', {})
        _context['scales'] = {}
        key = _context['current_key']
        if key is not None:
            _context['scale_registry'][key] = {}
34655
def cleanup(self):
        """"""
        if self.image:
            try:
                self.image.close()
            except Exception:
                pass
        if (self.outtmp is not None):
            try:
                os.unlink(self.outtmp)
            except OSError as e:
                self.logger.warning("Failed to cleanup tmp output file %s"
                                    % (self.outtmp))
611253
def delete(self):
        """"""
        if lib.EnvDeleteActivation(self._env, self._act) != 1:
            raise CLIPSError(self._env)

        self._env = None
1009034
public function delete()
    {
		        
		Event::trigger(EVENT_CORE_MATH_DELETE, ['material' => $this , 'message' => $this->getBoUrl()]);
		
        parent::delete();
        
        $this->updateCache();
    }
198835
def clear(self):
        "
        self.bad = False
        self.errors = {}
        self._collection.clear()
1204932
function cleanup()
    {
        // destroy loop variable(s)
        foreach ( $this->LoopVariablesNames as $varName )
            $this->Tpl->unsetVariable( $varName, $this->RootNamespace );
    }
239430
def clear(self):
        """"""    
        self.sam |= KEY_WRITE
        for v in list(self.values()):
            del self[v.name]
        for k in list(self.subkeys()):
            self.del_subkey(k.name)
1315940
public function clear() {
        global $DB, $USER;

        \core_analytics\manager::check_can_manage_models();

        // Delete current model version stored stuff.
        $predictor = $this->get_predictions_processor(false);
        if ($predictor->is_ready() !== true) {
            $predictorname = \core_analytics\manager::get_predictions_processor_name($predictor);
            debugging('Prediction processor ' . $predictorname . ' is not ready to be used. Model ' .
                $this->model->id . ' could not be cleared.');
        } else {
            $predictor->clear_model($this->get_unique_id(), $this->get_output_dir());
        }

        $predictionids = $DB->get_fieldset_select('analytics_predictions', 'id', 'modelid = :modelid',
            array('modelid' => $this->get_id()));
        if ($predictionids) {
            list($sql, $params) = $DB->get_in_or_equal($predictionids);
            $DB->delete_records_select('analytics_prediction_actions', "predictionid $sql", $params);
        }

        $DB->delete_records('analytics_predictions', array('modelid' => $this->model->id));
        $DB->delete_records('analytics_predict_samples', array('modelid' => $this->model->id));
        $DB->delete_records('analytics_train_samples', array('modelid' => $this->model->id));
        $DB->delete_records('analytics_used_files', array('modelid' => $this->model->id));
        $DB->delete_records('analytics_used_analysables', array('modelid' => $this->model->id));

        // Purge all generated files.
        \core_analytics\dataset_manager::clear_model_files($this->model->id);

        // We don't expect people to clear models regularly and the cost of filling the cache is
        // 1 db read per context.
        $this->purge_insights_cache();

        if (!$this->is_static()) {
            $this->model->trained = 0;
        }

        $this->model->timemodified = time();
        $this->model->usermodified = $USER->id;
        $DB->update_record('analytics_models', $this->model);
    }