Cleans up datastore and deletes all information about current round.
357099
def cleanup_datastore(self):
    """"""
    print_header('CLEANING UP ENTIRE DATASTORE')
    kinds_to_delete = [u'Submission', u'SubmissionType',
                       u'DatasetImage', u'DatasetBatch',
                       u'AdversarialImage', u'AdversarialBatch',
                       u'Work', u'WorkType',
                       u'ClassificationBatch']
    keys_to_delete = [e.key for k in kinds_to_delete
                      for e in self.datastore_client.query_fetch(kind=k)]
    self._cleanup_keys_with_confirmation(keys_to_delete)
868535
public void cleanup() {
    keys.cleanup();
    counts.cleanup();
    dictionary.cleanup();
    // Decrement the dictionary memory by the total size of all the elements
    memoryEstimate.decrementDictionaryMemory(SizeOf.SIZE_OF_LONG * numElements);
  }
958093
function clearDatabase() {
        var promises = [];

        _.each(resources, function (resource) {
            var service = pancakes.getService(resource.name);
            if (service.removePermanently) {
                log.info('purging ' + resource.name);
                promises.push(service.removePermanently({ where: {}, multi: true }));
            }
        });

        return Q.all(promises);
    }
874604
protected function cleanup()
    {
        $this->stmt->closeCursor();

        $this->stmt          = null;
        $this->rsm           = null;
        $this->cache         = [];
        $this->metadataCache = [];

        $this->em
             ->getEventManager()
             ->removeEventListener([Events::onClear], $this);
    }
768283
private void cleanUp(final DataSet ds) {
		Set<String> indexedKeys = Sets.newHashSet();
		for (String key : ds.getDataView().keySet()) {
			// Search for indexed entries
			if (key.contains("#")) {
				// Remember key (without index)
				indexedKeys.add(key.substring(0, key.indexOf("#")));
			}
		}
		// Remove all indexes
		for (String indexedKey : indexedKeys) {
			ds.removeValue(indexedKey);
		}
	}
361984
@Override
	public void clear() {
		super.clear();

		// currentSchema = null;
		dataSets = new HashSet<>();
		generatedDaos = null;
		generatedEntities = null;
		globalDaoElements.clear();
		schemas = new LinkedHashSet<>();
	}
525574
public function cleanup()
    {
        Cache::clear(false, 'default');
        Cache::clear(false, '_cake_model_');
        Cache::clear(false, '_cake_core_');
        $this->dispatchShell('orm_cache clear');
        $this->dispatchShell('orm_cache build');
    }
783171
public static void cleanup ()
  {
    if (MimeTypeInfoManager.isDefaultInstantiated ())
      MimeTypeInfoManager.getDefaultInstance ().reinitializeToDefault ();
    if (MicroTypeConverterRegistry.isInstantiated ())
      MicroTypeConverterRegistry.getInstance ().reinitialize ();
    if (XMLSchemaCache.isInstantiated ())
      XMLSchemaCache.getInstance ().clearCache ();
    XMLSchemaCache.clearPerClassLoaderCache ();
  }
1247275
public function clearData()
    {
        $cart = Cart::where($this->cartIdentifier())->first();

        if ($cart) {
            $cart->delete();
        }
    }
182235
def close(self):
        """"""

        # remove callbacks
        Datastore.stores[self.domain].remove(self)

        # delete data after the last instance is gone
        if self.release_storage and not Datastore.stores[self.domain]:
            del Datastore.global_data[self.domain]

        del self
543137
def cleanup(self):
        
        # Closes connections to all databases to avoid the long running process
        # from holding connections indefinitely.
        for alias in db.connections.databases:
            logger.info('Closing database connection: %s', alias)
            db.connections[alias].close()
819370
public void clear() {
    mMap.forEach((key, value) -> {
      onCacheUpdate(key, value.mValue);
      onRemove(key);
    });
    mMap.clear();
  }
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()
152702
private void cleanup() {
        if ((++counter & 0xFF) != 0) { // (++counter % 256) != 0
            return;
        }

        final long currentTimeNanos = System.nanoTime();
        if (currentTimeNanos - lastCleanupTimeNanos < CLEANUP_INTERVAL_NANOS) {
            return;
        }

        for (final Iterator<State> i = map.values().iterator(); i.hasNext();) {
            final State state = i.next();
            final boolean remove;

            synchronized (state) {
                remove = state.allActiveRequests == 0 &&
                         currentTimeNanos - state.lastActivityTimeNanos >= CLEANUP_INTERVAL_NANOS;
            }

            if (remove) {
                i.remove();
            }
        }

        lastCleanupTimeNanos = System.nanoTime();
    }
45671
def clean(self, *args, **kwargs):
        """"""
        for key in list(self.store.keys()):
            self.unset(key)
242292
def clean_up(self):
        """"""
        self.action_buffer = []
        self.sources = {}
        self.doc_to_get = {}
        self.doc_to_update = []
753871
def cleanup_defenses(self):
    """"""
    print_header('CLEANING UP DEFENSES DATA')
    work_ancestor_key = self.datastore_client.key('WorkType', 'AllDefenses')
    keys_to_delete = [
        e.key
        for e in self.datastore_client.query_fetch(kind=u'ClassificationBatch')
    ] + [
        e.key
        for e in self.datastore_client.query_fetch(kind=u'Work',
                                                   ancestor=work_ancestor_key)
    ]
    self._cleanup_keys_with_confirmation(keys_to_delete)