Get the descendants of each element in the current set
of matched elements, filtered by a selector.
557023
function find(selector) {
  var arr = [], $ = this.air, slice = this.slice;
  this.each(function(el) {
    arr = arr.concat(slice.call($(selector, el).dom));
  });
  return $(arr);
}
442432
def span_descendents(e)
      descendents = []
      e.each_element do |c|
        name = c.respond_to?(:name) ? c.name : nil
        if name && HTML_INLINE_ELEMS.include?(c.name)
          descendents << c
          descendents += span_descendents(c)
        end
      end
    end
455577
public static List<Element> getChildElements(Element root, String ... steps) {
        List<Element> lst;
        
        lst = new ArrayList<>();
        doGetChildElements(root, steps, 0, lst);
        return lst;
    }
1083275
function _qwery(selector, _root) {
      var r = [], ret = [], i, l, m, token, tag, els, intr, item, root = _root
        , tokens = tokenCache.g(selector) || tokenCache.s(selector, selector.split(tokenizr))
        , dividedTokens = selector.match(dividers)
  
      if (!tokens.length) return r
  
      token = (tokens = tokens.slice(0)).pop() // copy cached tokens, take the last one
      if (tokens.length && (m = tokens[tokens.length - 1].match(idOnly))) root = byId(_root, m[1])
      if (!root) return r
  
      intr = q(token)
      // collect base candidates to filter
      els = root !== _root && root.nodeType !== 9 && dividedTokens && /^[+~]$/.test(dividedTokens[dividedTokens.length - 1]) ?
        function (r) {
          while (root = root.nextSibling) {
            root.nodeType == 1 && (intr[1] ? intr[1] == root.tagName.toLowerCase() : 1) && (r[r.length] = root)
          }
          return r
        }([]) :
        root[byTag](intr[1] || '*')
      // filter elements according to the right-most part of the selector
      for (i = 0, l = els.length; i < l; i++) {
        if (item = interpret.apply(els[i], intr)) r[r.length] = item
      }
      if (!tokens.length) return r
  
      // filter further according to the rest of the selector (the left side)
      each(r, function(e) { if (ancestorMatch(e, tokens, dividedTokens)) ret[ret.length] = e })
      return ret
    }
937186
function (selector) {
            var nodes = [];
            if (vQ.isFunction(selector) && selector.call !== undefined) {
                this.each(function (idx) {
                    if (!selector.call(this, idx)) nodes.push(this);
                });
            } else {
                var excludes = typeof selector == 'string' ?
                    this.filter(selector) : (vQ.isArrayLike(selector) && vQ.isFunction(selector.item)) ? slice.call(selector) : vQ(selector);
                this.each(function (inx, el) {
                    if (excludes.indexOf(el) < 0){
                        nodes.push(el);
                    }
                });
            }
            return vQ(nodes);
        }
945577
def get_descendants(self):
        
        if self.is_leaf():
            return get_result_class(self.__class__).objects.none()
        return self.__class__.get_tree(self).exclude(pk=self.pk)
334235
function childrenByClass(element, name) {
  var filtered = [];

  for (var i = 0; i < element.children.length; i++) {
    var child = element.children[i];
    var classNames = child.className.split(' ');
    if (classNames.indexOf(name) !== -1) {
      filtered.push(child);
    }
  }

  return filtered;
}
1065593
function (collection, elements, settings, index) {
            for (var i = index + 1; i < elements.length; i++) {
                elements = swapElements(collection, elements, i - 1, i);
            }
            return collection.find(settings.elements_selector);
        }
781864
def _filtered_list(self, selector):
        
        res = []
        for elem in self.obj:
            self._append(elem, selector, res)
        return res
791582
function findAll(el, selector) {
  if (!selector) {
    selector = el;
    el = document;
  }
  return el.querySelectorAll(selector);
}
115378
private List<Element> extractElements(String content, String selector, int amount) {

		Element body = parseContent(content);

		List<Element> elements = body.select(selector);
		if (elements.size() > 0) {

			elements = filterParents(elements);

			if (amount >= 0) {
				// limit to the indicated amount
				elements = elements.subList(0, Math.min(amount, elements.size()));
			}

			// remove all from their parents
			for (Element element : elements) {
				element.remove();
			}
		}

		List<Element> results = new ArrayList<Element>();
		// first element is the body
		results.add(body);
		results.addAll(elements);
		return results;
	}
255905
function (scope, predicate) {
      var result = [];
      var dom = scope.dom();
      var children = Arr.map(dom.childNodes, Element.fromDom);

      Arr.each(children, function (x) {
        if (predicate(x)) {
          result = result.concat([ x ]);
        }
        result = result.concat(filterDescendants(x, predicate));
      });
      return result;
    }
424634
def with(selector)
            @selectors[selector] = Selector.new selector unless @selectors.has_key? selector
            yield @current_node if @selectors[selector].matches? @current_node, @filtered_nodes
        end
3519
function(element, options) {
    return Element.findChildren(
      element, options.only, options.tree ? true : false, options.tag);
  }
556936
function (selector) {
        var self = this, ctrl, parents = new Collection();

        // Add each parent to collection
        for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) {
          parents.add(ctrl);
        }

        // Filter away everything that doesn't match the selector
        if (selector) {
          parents = parents.filter(selector);
        }

        return parents;
      }
327146
function findAll (el, node) {
  return [].slice.call(node ? el.querySelectorAll(node) : $.querySelectorAll(el))
}
1276215
function ( selector ) {
            var el = this.element(),
                children = el.children;
    
            if ( typeof selector === 'string' ) {
                var elNum = children.length, result = [], i;
    
                for ( i = 0; i < elNum; ++i ) {
                    var child = children[i],
                        match = $B.selector.match( child, selector );
    
                    if ( match ) result.push( child );
                }
                return result;
            } else {
                //this.element().childNodes;
                return $B( children ).toArray();
            }
        }