Deletes and auto-created cohort named after the instance.
165774
def auto_delete_cohort(instance, **kwargs):
    ""
    cohorts = Cohort.objects.filter(autocreated=True)

    if isinstance(instance, Project):
        cohorts = cohorts.filter(project=instance)
    elif isinstance(instance, Batch):
        cohorts = cohorts.filter(batch=instance)
    else:
        return

    count = cohorts.count()
    cohorts.delete()
    log.info('Delete {0} autocreated cohorts for {1}'.format(count, instance))
12061
private static void purgeQueue() {

        ChronoReference cref;

        while ((cref = (ChronoReference) QUEUE.poll()) != null) {
            for (ChronoReference test : CHRONOS) {
                if (test.name.equals(cref.name)) {
                    CHRONOS.remove(test);
                    break;
                }
            }
        }

    }
549989
def delete_instance_if_removed(self, port):
        """"""
        instance_type = self.get_instance_type(port)
        if not instance_type:
            return
        if not db_lib.instance_provisioned(port['device_id']):
            i_res = MechResource(port['device_id'], instance_type,
                                 a_const.DELETE)
            self.provision_queue.put(i_res)
128052
function deleteSelf(callback) {
  var _this = this;

  _flowsync2["default"].series([function (done) {
    _this.beforeDelete(done);
  }, function (done) {
    if (_this.constructor.useSoftDelete !== undefined) {
      _this.softDestroy(done);
    } else {
      _this.destroy(done);
    }
  }, function (done) {
    _this.afterDelete(done);
  }], function (errors) {
    callback(errors);
  });
}
606549
void deleteWithChildren() {
    if (leaderboard != null) leaderboard.deleteWithChildren();

    if (gridKeys != null)
      for (Key<Grid> gridKey : gridKeys) gridKey.remove();

    // If the Frame was made here (e.g. buildspec contained a path, then it will be deleted
    if (buildSpec.input_spec.training_frame == null && origTrainingFrame != null) {
      origTrainingFrame.delete();
    }
    if (buildSpec.input_spec.validation_frame == null && validationFrame != null) {
      validationFrame.delete();
    }
    if (buildSpec.input_spec.leaderboard_frame == null && leaderboardFrame != null) {
      leaderboardFrame.delete();
    }
    delete();
  }
987479
def purgeAutoSelected(self):
        """"""
        params = self._autoParams.allData()
        for p in params:
            comps_to_remove = []
            for comp in p['selection']:
                if self.indexByComponent(comp) is None:
                    comps_to_remove.append(comp)
            for orphaned in comps_to_remove:
                p['selection'].remove(orphaned)
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()
299556
public static function cleanup_instances() {
        global $DB;
        self::init_levels();

        $sqls = array();
        foreach (self::$alllevels as $level=>$classname) {
            $sqls[] = $classname::get_cleanup_sql();
        }

        $sql = implode(" UNION ", $sqls);

        // it is probably better to use transactions, it might be faster too
        $transaction = $DB->start_delegated_transaction();

        $rs = $DB->get_recordset_sql($sql);
        foreach ($rs as $record) {
            $context = context::create_instance_from_record($record);
            $context->delete();
        }
        $rs->close();

        $transaction->allow_commit();
    }
896680
def delete(instance_id, profile=None, **kwargs):
    '''
    

    '''
    conn = _auth(profile, **kwargs)
    return conn.delete(instance_id)
685624
def delete(ctx, short_name):
    """"""
    wva = get_wva(ctx)
    subscription = wva.get_subscription(short_name)
    subscription.delete()
247731
function(elem, name) {
  if (!elem.attribs || !hasOwn.call(elem.attribs, name))
    return;

  delete elem.attribs[name];
}
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()
1202173
public static function clearRelatedInstancePool()
    {
        // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool,
        // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
                DealerShedulesTableMap::clearInstancePool();
                DealerContactTableMap::clearInstancePool();
                DealerContentTableMap::clearInstancePool();
                DealerFolderTableMap::clearInstancePool();
                DealerBrandTableMap::clearInstancePool();
                DealerProductTableMap::clearInstancePool();
                DealerAdminTableMap::clearInstancePool();
                DealerI18nTableMap::clearInstancePool();
                DealerVersionTableMap::clearInstancePool();
            }
268936
def delete(self, instance):
        ''''''
        flushdb(self.client) if flushdb else self.client.flushdb()
1155820
public void cleanup() {
        List<String> keys = new ArrayList<>(created.keySet());
        keys.sort(String::compareTo);
        for (String key : keys) {
            created.remove(key)
                .stream()
                .sorted(Comparator.comparing(HasMetadata::getKind))
                .forEach(metadata -> {
                    log.info(String.format("Deleting %s : %s", key, metadata.getKind()));
                    deleteWithRetries(metadata);
                });
        }
    }
844653
def delete_tracked(name)
      groups.values.each {|v| v.delete_tracked name }
      name
    end
948016
def cleanup(self, sched, coro):
        """"""
        try:
            sched.sigwait[self.name].remove((self, coro))
        except ValueError:
            pass
        return True