Filter tag's children.
194568
def filter(self):  # noqa A001
        """"""

        return [tag for tag in self.get_contents(self.tag) if not self.is_navigable_string(tag) and self.match(tag)]
964138
def tags(self, value):
        
        if value == self._defaults['tags'] and 'tags' in self._values:
            del self._values['tags']
        else:
            self._values['tags'] = value
1314248
function (original, tag) {
      var nu = shallowAs(original, tag);

      Insert.before(original, nu);
      var children = Traverse.children(original);
      InsertAll.append(nu, children);
      Remove.remove(original);
      return nu;
    }
632783
protected function filterTags()
    {
        $data       = array();
        $returndata = array();
        $predicates = array();
        $count      = 0;
        $arr        = $this->getData();
        if (!empty($this->templateVars['Page']) && !empty($this->templateVars['MaxRows'])) {
            $this->templateVars['StartItem'] = (($this->templateVars['Page']-1)*$this->templateVars['MaxRows']) +1;
            $this->templateVars['EndItem'] = ($this->templateVars['Page'])*$this->templateVars['MaxRows'];
        }

        $partial = $this->getTemplateVariable('Partial');

        $partials = array();
        if(!empty($partial)) {
            $partialsStr = explode(',',$partial);
            foreach($partialsStr as $partial)
                $partials[] = new TagPartial($partial);
        }

        if (!empty($arr))
            foreach ((array)$arr as $tag) {
                if (!empty($partials)) {
                    $found = false;
                    foreach($partials as $partial) {
                        if($this->TagsHelper->matchPartial($partial, $tag))
                        {
                            $found = true;
                            break;
                        }
                    }
                    if(!$found)
                        continue;
                }

                if (($this->getTemplateVariable('Status.eq') != null) &&
                  $tag['TagLinkStatus'] != $this->getTemplateVariable('Status.eq'))
                    continue;
                if (($this->getTemplateVariable('Status.isActive') != null) && empty($tag['TagLinkURL']))
                    continue;

                $data[] = $tag;
            }

        $this->templateVars['TotalRecords'] = sizeof($data);
        if (!empty($data))
            foreach ((array)$data as $row) {
                if (!empty($this->templateVars['StartItem']) && $this->templateVars['StartItem'] > ++$count)
                    continue;

                $returndata[] = $row['TagLinkNode'];

                if (!empty($this->templateVars['MaxRows']) && sizeof($returndata) >= $this->templateVars['MaxRows'])
                    break;
            }
        return $returndata;
    }
932817
protected List<Element> filterDescendants(Element parent, String[] tagNames)
    {
        List<Element> result = new ArrayList<Element>();
        for (String tagName : tagNames) {
            NodeList nodes = parent.getElementsByTagName(tagName);
            for (int i = 0; i < nodes.getLength(); i++) {
                Element element = (Element) nodes.item(i);
                result.add(element);
            }
        }
        return result;
    }
89574
def remove_all(self, *tagnames):
        
        for tagname in tagnames:
            matching = self.findall(qn(tagname))
            for child in matching:
                self.remove(child)
403360
def filter_by(self, string):
        """"""

        self._reatach()
        if string == '':
            self.filter_remove()
            return

        self._expand_all()
        self.treeview.selection_set('')

        children = self.treeview.get_children('')
        for item in children:
            _, detached = self._detach(item)
            if detached:
                self._detached.extend(detached)
        for i, p, idx in self._detached:
            # txt = self.treeview.item(i, 'text')
            self.treeview.detach(i)
        self.filter_on = True
53870
def get_child_content(self, children, element_name):
        """"""
        # Loop through the children and get the specified element.
        for child in children:
            # If the child is the requested element, return its content.
            if child.tag == element_name:
                return child.content
        return ''
337229
def _filter_candidates(self, tokens, candidates):
        """"""
        results = []
        for abbr_span, long_span in candidates:
            abbr = tokens[abbr_span[0]:abbr_span[1]]
            long = tokens[long_span[0]:long_span[1]]
            if not all(a in long for a in abbr) and len(''.join(long)) > len(''.join(abbr)):
                results.append((abbr_span, long_span))
        return results
675701
public CmsRelationFilter filterIncludeChildren() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        filter.m_includeSubresources = true;
        return filter;
    }
1169256
def _filter(self, text, context, encoding):
        """"""

        content = []
        blocks, attributes, comments = self.to_text(bs4.BeautifulSoup(text, self.parser))
        if self.comments:
            for c, desc in comments:
                content.append(filters.SourceText(c, context + ': ' + desc, encoding, self.type + 'comment'))
        if self.attributes:
            for a, desc in attributes:
                content.append(filters.SourceText(a, context + ': ' + desc, encoding, self.type + 'attribute'))
        for b, desc in blocks:
            content.append(filters.SourceText(b, context + ': ' + desc, encoding, self.type + 'content'))
        return content
465860
def children(self):
        """""""
        for c in self.table.columns:
            if c.parent == self.name and  not c.valuetype_class.is_label():
                yield c
178623
def get_descendants(self, el, tags=True, no_iframe=False):
        """"""

        if not no_iframe or not self.is_iframe(el):
            next_good = None
            for child in el.descendants:

                if next_good is not None:
                    if child is not next_good:
                        continue
                    next_good = None

                is_tag = self.is_tag(child)

                if no_iframe and is_tag and self.is_iframe(child):
                    if child.next_sibling is not None:
                        next_good = child.next_sibling
                    else:
                        last_child = child
                        while self.is_tag(last_child) and last_child.contents:
                            last_child = last_child.contents[-1]
                        next_good = last_child.next_element
                    yield child
                    if next_good is None:
                        break
                    # Coverage isn't seeing this even though it's executed
                    continue  # pragma: no cover

                if not tags or is_tag:
                    yield child
447657
function isNullEndTag(tagName) {
  let names = ['br', 'hr', 'img', 'input', 'link', 'meta'];
  tagName = tagName ? tagName.toLowerCase() : '';
  return names.indexOf(tagName) > -1 ? true : false;
}
1213914
def _child_list(element, child_tagname):
    
    xpath = './%s' % child_tagname
    return element.xpath(xpath, namespaces=nsmap)
227855
def _filter(self, event):
        '''
        
        '''
        tag = event['tag']
        if self.opts['event_return_whitelist']:
            ret = False
        else:
            ret = True
        for whitelist_match in self.opts['event_return_whitelist']:
            if fnmatch.fnmatch(tag, whitelist_match):
                ret = True
                break
        for blacklist_match in self.opts['event_return_blacklist']:
            if fnmatch.fnmatch(tag, blacklist_match):
                ret = False
                break
        return ret
1255580
def _xml_tag_filter(s: str, strip_namespaces: bool) -> str:
    
    if strip_namespaces:
        ns_end = s.find('}')
        if ns_end != -1:
            s = s[ns_end+1:]
        else:
            ns_end = s.find(':')
            if ns_end != -1:
                s = s[ns_end+1:]
    return s