Delete stored objects (CAUTION!)
197782
def delete(ctx, schema, uuid, object_filter, yes):
    """"""

    database = ctx.obj['db']

    if schema is None:
        log('No schema given. Read the help', lvl=warn)
        return

    model = database.objectmodels[schema]

    if uuid:
        count = model.count({'uuid': uuid})
        obj = model.find({'uuid': uuid})
    elif object_filter:
        count = model.count(literal_eval(object_filter))
        obj = model.find(literal_eval(object_filter))
    else:
        count = model.count()
        obj = model.find()

    if count == 0:
        log('No objects to delete found')
        return

    if not yes and not _ask("Are you sure you want to delete %i objects" % count,
                            default=False, data_type="bool", show_hint=True):
        return

    for item in obj:
        item.delete()

    log('Done')
626295
function cleanObject(obj) {
  if (obj instanceof Object) {
    Object.keys(obj).forEach((key) => (obj[key] == null) && delete obj[key]);
  }
  return obj;
}
1344502
def delete(self):
    
    if self.exists():
      try:
        self._api.objects_delete(self._bucket, self._key)
      except Exception as e:
        raise e
112049
def clear_db():
    """"""
    cursor = '0'
    while cursor != 0:
        cursor, keys = DB.scan(cursor, match='*', count=5000)
        if keys:
            DB.delete(*keys)
420481
def cleanup(parent = Object, current = @top)
      return unless all_project_objects_lookup[current]
      current.constants.each {|const| cleanup current, current.const_get(const)}
      parent.send(:remove_const, current.to_s.split('::').last.to_sym)
    end
927915
function clear() {
  // TODO: Only remove used items
  data = {};
  if (localExists()) {
    try {
      // Clear session storage
      window.sessionStorage.clear();
    } catch (error) {
      _logger2.default.warn({
        description: 'Session storage could not be cleared.', error: error,
        obj: 'storage', func: 'removeItem'
      });
    }
  }
}
1347117
void purge() {

        uncommittedCache.clear();

        try {
            if (cacheReadonly) {
                close(false);
            } else {
                if (dataFile != null) {
                    dataFile.close();

                    dataFile = null;
                }

                FileUtil.getDefaultInstance().delete(fileName);
            }
        } catch (Exception e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_TextCache_purging_file_error,
                              new Object[] {
                fileName, e
            });
        }
    }
1204932
function cleanup()
    {
        // destroy loop variable(s)
        foreach ( $this->LoopVariablesNames as $varName )
            $this->Tpl->unsetVariable( $varName, $this->RootNamespace );
    }
837206
def delete(args):
    
    with _catalog(args) as cat:
        n = len(cat)
        cat.delete(args.args[0])
        args.log.info('{0} objects deleted'.format(n - len(cat)))
        return n - len(cat)
149652
def remove_objects_not_in(self, objects_to_keep, verbosity):
        
        for class_ in objects_to_keep.keys():
            current = class_.objects.all()
            current_ids = set([x.pk for x in current])
            keep_ids = set([x.pk for x in objects_to_keep[class_]])

            remove_these_ones = current_ids.difference(keep_ids)
            if remove_these_ones:
                for obj in current:
                    if obj.pk in remove_these_ones:
                        obj.delete()
                        if verbosity >= 2:
                            print("Deleted object: %s" % six.u(obj))

            if verbosity > 0 and remove_these_ones:
                num_deleted = len(remove_these_ones)
                if num_deleted > 1:
                    type_deleted = six.u(class_._meta.verbose_name_plural)
                else:
                    type_deleted = six.u(class_._meta.verbose_name)

                print("Deleted %s %s" % (str(num_deleted), type_deleted))
162715
def delete(self, redis):
        '''  '''
        value = getattr(self.obj, self.name)
        redis.srem(self.key() + ':' + value, self.obj.id)
103562
public static function deleteArchiveTables()
    {
        foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
            Log::debug("Dropping table $table");

            Db::query("DROP TABLE IF EXISTS `$table`");
        }

        ArchiveTableCreator::refreshTableList($forceReload = true);
    }
1355339
def delete_all(obj):
    ''''''
    types = tuple([
        Shader,
        Mesh,
        VertexBuffer,
        IndexBuffer,
        Texture,
        Program,
        Context,
    ])
    for name in dir(obj):
        child = getattr(obj, name)
        if isinstance(child, types):
            child.delete()
428863
function clearOwnProperties(obj) {
  _.forOwn(obj, function (value, key) {
    delete obj[key];
  });

  return obj;
}
148498
void cleanUpStaleEntries() {
        for (KeyedRef<K, V> ref = q.poll(); ref != null; ref = q.poll()) {
            map.remove(ref.getKey(), ref); // CONCURRENT remove() operation
        }
    }
99935
function() {
            var s = Storage.storage();
            if (s == null) {
                return false;
            }
            Object.keys(s).forEach(function(key){
                   if (/^(cache_)/.test(key)) {
                       s.removeItem(key);
                   }
            });
        }
208393
def clear_callbacks(obj):
    """"""
    callbacks = obj._callbacks
    if isinstance(callbacks, dllist):
        # Help the garbage collector by clearing all links.
        callbacks.clear()
    obj._callbacks = None