clean up by deleting the documents used in the example query
184696
public static void tearDownExample(DatabaseClient client) {
    XMLDocumentManager docMgr = client.newXMLDocumentManager();

    for (String filename: filenames) {
      docMgr.delete("/example/"+filename);
    }
  }
175418
def clear_document(self):
        
        self._components.clear()
        self._sequences.clear()
        self._namespaces.clear()
        self._models.clear()
        self._modules.clear()
        self._collections.clear()
        self._annotations.clear()
        self._functional_component_store.clear()
        self._collection_store.clear()
818911
def delete_by_query!(query, params = nil, request_options = {})
      res = delete_by_query(query, params, request_options)
      wait_task(res['taskID'], WAIT_TASK_DEFAULT_TIME_BEFORE_RETRY, request_options) if res
      res
    end
1219791
def cleanup(self):
        

        all([delete_file_or_tree(f) for f in self.to_delete])
        self.to_delete = []
876590
public static void tearDownExample(XMLDocumentManager docMgr, String docId, String webserviceId, String newId) {
    docMgr.delete(docId);
    docMgr.delete(webserviceId);
    docMgr.delete(newId);
  }
68436
def cleanup_on_delete(self, sender, document, **kwargs):
        '''
        
        '''
        if not self.follow or sender is not self.owner_document:
            return
        slug = getattr(document, self.db_field)
        namespace = self.owner_document.__name__
        SlugFollow.objects(namespace=namespace, new_slug=slug).delete()
523659
def delete(self, docids):
        """"""
        logger.debug("deleting %i documents from %s" % (len(docids), self))
        deleted = 0
        for docid in docids:
            try:
                del self.id2pos[docid]
                deleted += 1
                del self.id2sims[docid]
            except:
                pass
        self.id2sims.sync()
        if deleted:
            logger.info("deleted %i documents from %s" % (deleted, self))
        self.update_mappings()
434374
def cleanup(self):
        
        empty_keys = [k for k, v in self.items() if not v]

        for k in empty_keys:
            del self[k]
1011055
public static function tearDown()
    {
        $dm = static::$dm;

        if (is_null($dm)) {
            return;
        }

        $documents = [
            'Applications\Entity\Application',
            'Cv\Entity\Cv',
            'Jobs\Entity\Job',
            'Organizations\Entity\Organization',
            'Auth\Entity\User',
            'Jobs\Entity\Category',
            'Auth\Entity\UserImage',
            'Organizations\Entity\OrganizationName',
        ];
        foreach ($documents as $document) {
            try {
                $dm->createQueryBuilder($document)
                    ->remove()
                    ->getQuery()
                    ->execute()
                ;
            } catch (\Exception $e) {
            }
        }
    }
416599
public void delExampleQueries(List<String> corpusNames)
  {

    if (corpusNames == null || corpusNames.isEmpty())
    {
      log.info("delete all example queries");
      jdbcTemplate.execute("TRUNCATE example_queries");
    }
    else
    {
      List<Long> ids = queryDao.mapCorpusNamesToIds(corpusNames);
      for (Long id : ids)
      {
        delExampleQueries(id);
      }
    }
  }
694889
public static void tearDownExample(
    String host, int port, String user, String password, Authentication authType)
    throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException {
    DatabaseClient client = DatabaseClientFactory.newClient(host, port, user, password, authType);

    XMLDocumentManager docMgr = client.newXMLDocumentManager();

    for (String filename: filenames) {
      docMgr.delete("/example/"+filename);
    }

    QueryOptionsManager optionsMgr = client.newServerConfigManager().newQueryOptionsManager();

    optionsMgr.deleteOptions(OPTIONS_NAME);

    client.release();
  }
1129170
def _cleanup(self):  # pragma: no cover
        
        need_to_delete = []  # can't delete from a dict while iterating
        with self.attr_lock:
            now_time = time()
            for path in self.cache:
                if now_time - self.attr[path][TIMESTAMP_KEY] >= MAX_CACHE_TIME:
                    need_to_delete.append(path)
            for path in need_to_delete:
                del self.attr[path]
                del self.cache[path]
281798
def delete_search_document(self, *, index):
        """"""
        cache.delete(self.search_document_cache_key)
        get_client().delete(index=index, doc_type=self.search_doc_type, id=self.pk)
359769
static function cleanup()
    {
        $db = eZDB::instance();
        $db->begin();
        $rows = $db->arrayQuery( "SELECT productcollection_id FROM ezwishlist" );
        if ( count( $rows ) > 0 )
        {
            $productCollectionIDList = array();
            foreach ( $rows as $row )
            {
                $productCollectionIDList[] = $row['productcollection_id'];
            }
            eZProductCollection::cleanupList( $productCollectionIDList );
        }
        $db->query( "DELETE FROM ezwishlist" );
        $db->commit();
    }
1183278
def delete_many(self, query):
        
        items = self.find(query)
        result = [
            self.table.remove(where(u'_id') == item[u'_id'])
            for item in items
        ]

        if query == {}:
            # need to reset TinyDB's index for docs order consistency
            self.table._last_id = 0

        return DeleteResult(raw_result=result)
331780
def clean(all=False, docs=False, dist=False, extra=None):
    """"""

    run('find . -type f -name "*.py[co]" -delete')
    run('find . -type d -name "__pycache__" -delete')

    patterns = ['build', '*.egg-info/']
    if all or docs:
        patterns.append('doc/build/*')
    if all or dist:
        patterns.append('dist')
    if extra:
        patterns.append(extra)
    for pattern in patterns:
        run('rm -rf {}'.format(pattern))
50977
static function cleanup()
    {
        $ini = eZINI::instance();
        $db = eZDB::instance();
        $timeFrame = 1;
        if ( $ini->hasVariable( 'TipAFriend', 'TimeFrame' ) )
            $timeFrame = $ini->variable( 'TipAFriend', 'TimeFrame' );
        $time = time() - $timeFrame * 3600;

        $db->query( "DELETE FROM eztipafriend_request
                      WHERE created < $time " );
    }