Delete unused tags
972848
public function reIndex()
    {
        $tags = $this->select(['tags.id', 'taggables.tag_id as pivot_tag_id'])
            ->join('taggables', 'tags.id', '=', 'taggables.tag_id')
            ->get()->keyBy('id')->all();

        $this->whereNotIn('id', array_keys($tags))->delete();

        // dd($this->has($model->getMorphClass(), '=', 0)->toSql());
        //
        // The commentable relation on the Comment model will return either a
        // Post or Video instance, depending on which type of model owns the comment.
        // $commentable = $comment->commentable;
    }
423729
def delete_unused(self, keyword_ids=None):
        
        if keyword_ids is None:
            keywords = self.all()
        else:
            keywords = self.filter(id__in=keyword_ids)
        keywords.filter(assignments__isnull=True).delete()
964138
def tags(self, value):
        
        if value == self._defaults['tags'] and 'tags' in self._values:
            del self._values['tags']
        else:
            self._values['tags'] = value
438150
function cleanup(html) {
      html = cheerio.load(html);
      html('[' + ignoreAttr + ']').removeAttr(ignoreAttr);
      html = html.html();
      return html;
    }
1267836
def delete_repository_tag(self, namespace, repository, tag):
        """"""
        return self._http_call(self.TAGS + '/' + tag, delete,
                               namespace=namespace, repository=repository)
24765
def cleanup(self):
        ''' '''
        allList = []
        allList.extend(self.cur.execute("SELECT keywordid FROM keyword;"))
        usedList = []
        usedList.extend(self.cur.execute("SELECT keywordid FROM notekeyword;"))
        unusedList = [val for val in allList if val not in usedList]
        for key in unusedList:
            if self.debug:
                print("About to delete keyword with ID %s" % key)
            try:
                self.cur.execute("DELETE FROM keyword WHERE keywordId = ?;", key)
            except:
                self.error("There was a problem deleting keyword %s" % key)
        self.con.commit()
44545
function (str) {
            return _(str).chain()
                .unescapeHTML()
                .stripTags()
                .clean()
                .value()
                .replace( matchJunk, '' )
                .toLowerCase();
        }
1128969
def DeleteClusterTags(r, tags, dry_run=False):
    

    query = {
        "dry-run": dry_run,
        "tag": tags,
    }

    return r.request("delete", "/2/tags", query=query)
129810
def delete(self, filething=None):
        

        self.tags.clear()
        self.save(filething, padding=lambda x: 0)
912208
public function clean($mode = \Zend_Cache::CLEANING_MODE_ALL, $tags = array()) 
    {
    	if ($mode == \Zend_Cache::CLEANING_MODE_MATCHING_TAG) {
            if ($tags) {
                if (!method_exists($this->_handle, 'tag_delete')) {
                    \Zend_Cache::throwException('Method tag_delete() is not supported by the PHP memcached extension!');
                }
                foreach ($tags as $tag) {
                    $this->_handle->tag_delete($tag);
                }
            }
        } else {
            return parent::clean($mode, $tags); 
        }
    }
251407
def del_tag(
            self,
            tag):
        

        if tag.replace("@", "") not in self.tags:
            return

        self.refresh
        oldContent = self.to_string(indentLevel=1)
        newTags = []
        newTags[:] = [n for n in newTags if tag not in n]
        self.tags = newTags
        newContent = self.to_string(indentLevel=1)

        # ADD DIRECTLY TO CONTENT IF THE PROJECT IS BEING ADDED SPECIFICALLY TO
        # THIS OBJECT
        self.parent._update_document_tree(
            oldContent=oldContent,
            newContent=newContent
        )

        self.refresh
        return None
78603
def remove_tags(alert_ids, tag_names)
      query = generate_query_params(alertIds: alert_ids, tagNames: tag_names)
      http_delete('/tags' + query)
    end
1279932
def strip_tags(s):
    """"""

    def handle_match(m):
        name = m.group(1)
        if name in html_entities:
            return unichr(html_entities[name])
        if name[:2] in ("#x", "#X"):
            try:
                return unichr(int(name[2:], 16))
            except ValueError:
                return u""
        elif name.startswith("#"):
            try:
                return unichr(int(name[1:]))
            except ValueError:
                return u""
        return u""

    return _entity_re.sub(handle_match, _striptags_re.sub("", s))
825309
function unmountRedundant(items, tags) {

  var i = tags.length,
    j = items.length,
    t

  while (i > j) {
    t = tags[--i]
    tags.splice(i, 1)
    t.unmount()
  }
}
911692
protected void removeContainerTags() {
	tags.removeOfType(TreeMember.class);
	tags.removeOfType(RootContainer.class);
	tags.removeOfType(TreeDepth.class);
    }
575154
def remove_tags(text: str) -> str:
    

    tags = {i:" " for i in re.findall("(<[^>\n]*>)",text.strip())}
    no_tag_text = reduce(lambda x, kv:x.replace(*kv), tags.iteritems(), text)
    return " ".join(no_tag_text.split())
220368
def strip_tags(cls, html):
        
        s = cls()
        s.feed(html)

        return s.get_data()