clean up any remaining tags
358512
function parsePart () {
    chars = true;
    parseTag();

    var same = html === last;
    last = html;

    if (same) { // discard, because it's invalid
      html = '';
    }
  }
220368
def strip_tags(cls, html):
        
        s = cls()
        s.feed(html)

        return s.get_data()
757538
public static function cleanup()
    {
        remove_action('wp_head', 'feed_links_extra', 3); // remove extra RSS links (as category)
        remove_action('wp_head', 'rsd_link');
        remove_action('wp_head', 'wlwmanifest_link');
        remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
        remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
        remove_filter('dbem_notes', 'wpautop');

        global $wp_widget_factory;
        remove_action('wp_head', [$wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style']);
    }
140125
def delete_tags(self, archive_name, tags):
        '''
        

        '''
        updated_tag_list = list(self._get_tags(archive_name))
        for tag in tags:
            if tag in updated_tag_list:
                updated_tag_list.remove(tag)

        self._set_tags(archive_name, updated_tag_list)
842168
private void cleanup() {
        Entry<K, V>[] tab = this.table;

        for (int i = tab.length ; i-- > 0 ;) {
            for (Entry<K, V> e = tab[i], prev = null; e != null; e = e.next) {
                if (e.get() == null) {
                    // Clean up after a cleared Reference.
                    this.modCount++;
                    if (prev != null) {
                        prev.next = e.next;
                    } else {
                        tab[i] = e.next;
                    }
                    this.count--;
                } else {
                    prev = e;
                }
            }
        }
    }
58528
def clean_dataset_tags(self):
        # type: () -> Tuple[bool, bool]
        
        tags_dict, wildcard_tags = Tags.tagscleanupdicts()

        def delete_tag(tag):
            logger.info('%s - Deleting tag %s!' % (self.data['name'], tag))
            return self.remove_tag(tag), False

        def update_tag(tag, final_tags, wording, remove_existing=True):
            text = '%s - %s: %s -> ' % (self.data['name'], wording, tag)
            if not final_tags:
                logger.error('%snothing!' % text)
                return False, True
            tags_lower_five = final_tags[:5].lower()
            if tags_lower_five == 'merge' or tags_lower_five == 'split' or (
                    ';' not in final_tags and len(final_tags) > 50):
                logger.error('%s%s - Invalid final tag!' % (text, final_tags))
                return False, True
            if remove_existing:
                self.remove_tag(tag)
            tags = ', '.join(self.get_tags())
            if self.add_tags(final_tags.split(';')):
                logger.info('%s%s! Dataset tags: %s' % (text, final_tags, tags))
            else:
                logger.warning(
                    '%s%s - At least one of the tags already exists! Dataset tags: %s' % (text, final_tags, tags))
            return True, False

        def do_action(tag, tags_dict_key):
            whattodo = tags_dict[tags_dict_key]
            action = whattodo[u'action']
            final_tags = whattodo[u'final tags (semicolon separated)']
            if action == u'Delete':
                changed, error = delete_tag(tag)
            elif action == u'Merge':
                changed, error = update_tag(tag, final_tags, 'Merging')
            elif action == u'Fix spelling':
                changed, error = update_tag(tag, final_tags, 'Fixing spelling')
            elif action == u'Non English':
                changed, error = update_tag(tag, final_tags, 'Anglicising', remove_existing=False)
            else:
                changed = False
                error = False
            return changed, error

        def process_tag(tag):
            changed = False
            error = False
            if tag in tags_dict.keys():
                changed, error = do_action(tag, tag)
            else:
                for wildcard_tag in wildcard_tags:
                    if fnmatch.fnmatch(tag, wildcard_tag):
                        changed, error = do_action(tag, wildcard_tag)
                        break
            return changed, error

        anychange = False
        anyerror = False
        for tag in self.get_tags():
            changed, error = process_tag(tag)
            if changed:
                anychange = True
            if error:
                anyerror = True

        return anychange, anyerror
215322
def delete_tags(name, tags, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    if exists(name, region, key, keyid, profile):
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        ret = _remove_tags(conn, name, tags)
        return ret
    else:
        return False
1249229
def delete_tags(sender, **kwargs):
    
    try:
        obj = kwargs.get('instance')
        tags = Tag.get_tags(obj)
        tags.delete()
    except AttributeError:
        pass
854673
function cleanConditionally(e, tag) {
  var tagsList = e.getElementsByTagName(tag);
  var curTagsLength = tagsList.length;

  /**
   * Gather counts for other typical elements embedded within.
   * Traverse backwards so we can remove nodes at the same time without effecting the traversal.
   *
   * TODO: Consider taking into account original contentScore here.
   **/
  for (var i = curTagsLength - 1; i >= 0; i--) {
    var weight = getClassWeight(tagsList[i]);

    dbg("Cleaning Conditionally " + tagsList[i] + " (" + tagsList[i].className + ":" + tagsList[i].id + ")" + ((typeof tagsList[i].readability != 'undefined') ? (" with score " + tagsList[i].readability.contentScore) : ''));

    if (weight < 0) {
      tagsList[i].parentNode.removeChild(tagsList[i]);
    } else if (getCharCount(tagsList[i], ',') < 10) {
      /**
       * If there are not very many commas, and the number of
       * non-paragraph elements is more than paragraphs or other ominous signs, remove the element.
       **/

      var p = tagsList[i].getElementsByTagName("p").length;
      var img = tagsList[i].getElementsByTagName("img").length;
      var li = tagsList[i].getElementsByTagName("li").length - 100;
      var input = tagsList[i].getElementsByTagName("input").length;

      var embedCount = 0;
      var embeds = tagsList[i].getElementsByTagName("embed");
      for (var ei = 0, il = embeds.length; ei < il; ei++) {
        if (embeds[ei].src && embeds[ei].src.search(regexps.videoRe) == -1) {
          embedCount++;
        }
      }

      var linkDensity = getLinkDensity(tagsList[i]);
      var contentLength = getInnerText(tagsList[i]).length;
      var toRemove = false;

      if (img > p && img > 1) {
        toRemove = true;
      } else if (li > p && tag != "ul" && tag != "ol") {
        toRemove = true;
      } else if (input > Math.floor(p / 3)) {
        toRemove = true;
      } else if (contentLength < 25 && (img == 0 || img > 2)) {
        toRemove = true;
      } else if (weight < 25 && linkDensity > .2) {
        toRemove = true;
      } else if (weight >= 25 && linkDensity > .5) {
        toRemove = true;
      } else if ((embedCount == 1 && contentLength < 75) || embedCount > 1) {
        toRemove = true;
      }

      if (toRemove) {
        tagsList[i].parentNode.removeChild(tagsList[i]);
      }
    }
  }
}
1314011
def _breakRemNewlines(tag):
	""""""
	for i,c in enumerate(tag.contents):
		if type(c) != bs4.element.NavigableString:
			continue
		c.replace_with(re.sub(r' {2,}', ' ', c).replace('\n',''))
447049
def delete_tags(self, arg):
        

        if len(arg) > 0:
            raw = html.fromstring(arg)
            return raw.text_content().strip()

        return arg
1106824
private void cleanConditionally(Element e, String tag) {
        Elements tagsList = getElementsByTag(e, tag);

        /**
         * Gather counts for other typical elements embedded within. Traverse
         * backwards so we can remove nodes at the same time without effecting
         * the traversal.
         * 
         * TODO: Consider taking into account original contentScore here.
         */
        for (Element node : tagsList) {
            int weight = getClassWeight(node);

            dbg("Cleaning Conditionally (" + node.className() + ":" + node.id()
                    + ")" + getContentScore(node));

            if (weight < 0) {
                node.remove();
            } else if (getCharCount(node, ",") < 10) {
                /**
                 * If there are not very many commas, and the number of
                 * non-paragraph elements is more than paragraphs or other
                 * ominous signs, remove the element.
                 */
                int p = getElementsByTag(node, "p").size();
                int img = getElementsByTag(node, "img").size();
                int li = getElementsByTag(node, "li").size() - 100;
                int input = getElementsByTag(node, "input").size();

                int embedCount = 0;
                Elements embeds = getElementsByTag(node, "embed");
                for (Element embed : embeds) {
                    if (!Patterns.get(Patterns.RegEx.VIDEO)
                            .matcher(embed.absUrl("src")).find()) {
                        embedCount++;
                    }
                }

                float linkDensity = getLinkDensity(node);
                int contentLength = getInnerText(node, true).length();
                boolean toRemove = false;

                if (img > p) {
                    toRemove = true;
                } else if (li > p && !"ul".equalsIgnoreCase(tag)
                        && !"ol".equalsIgnoreCase(tag)) {
                    toRemove = true;
                } else if (input > Math.floor(p / 3)) {
                    toRemove = true;
                } else if (contentLength < 25 && (img == 0 || img > 2)) {
                    toRemove = true;
                } else if (weight < 25 && linkDensity > 0.2f) {
                    toRemove = true;
                } else if (weight > 25 && linkDensity > 0.5f) {
                    toRemove = true;
                } else if ((embedCount == 1 && contentLength < 75)
                        || embedCount > 1) {
                    toRemove = true;
                }

                if (toRemove) {
                    node.remove();
                }
            }
        }
    }
913132
def raw_clean(self, datas):
        
        datas = strip_tags(datas)             # Remove HTML
        datas = STOP_WORDS.rebase(datas, '')  # Remove STOP WORDS
        datas = PUNCTUATION.sub('', datas)    # Remove punctuation
        datas = datas.lower()
        return [d for d in datas.split() if len(d) > 1]
1331725
function cleanUpData(data) {
  if (!(data instanceof Tag) && !(data && typeof data.trigger == T_FUNCTION))
    return data

  var o = {}
  for (var key in data) {
    if (!contains(RESERVED_WORDS_BLACKLIST, key))
      o[key] = data[key]
  }
  return o
}
1088600
public void removeLL() {
    if (head[0] == this)
      head[0] = nextTag;
    if (prevTag != null) {
      prevTag.nextTag = nextTag;
    }
    if (nextTag != null) {
      nextTag.prevTag = prevTag;
    }
  }
589472
def clear_content(self):
        
        for child in self[:]:
            if child.tag == qn('w:pPr'):
                continue
            self.remove(child)
929431
def clear(self, tag=None):
        
        if tag is None:
            del self.jobs[:]
        else:
            self.jobs[:] = (job for job in self.jobs if tag not in job.tags)