/* 
Query an element selector if it's not an element already.
193248
function query (el) {
  if (typeof el === 'string') {
    var selected = document.querySelector(el);
    if (!selected) {
      process.env.NODE_ENV !== 'production' && warn(
        'Cannot find element: ' + el
      );
      return document.createElement('div')
    }
    return selected
  } else {
    return el
  }
}
614682
function query (el) {
  if (typeof el === 'string') {
    const selected = document.querySelector(el);
    if (!selected) {
      warn(
        'Cannot find element: ' + el
      );
      return document.createElement('div')
    }
    return selected
  } else {
    return el
  }
}
1232983
function (selector) {
            var result, own = this;
            if (!selector) result = vQ();
            else if (typeof selector == 'object')
                result = vQ(selector).filter(function () {
                    var node = this;
                    //Array.some
                    for (var i = 0; i < own.length; i++) {
                        if (vQ.contains(own[i], node)) {
                            return true;
                        }
                    }
                    return false;
                });
            else if (this.length == 1) result = vQ(vQ.qsa(this[0], selector));
            else result = this.map(function () {
                    return vQ.qsa(this, selector);
                });
            return result;
        }
910138
function query( elem, selector ) {
    // append to fragment if no parent
    checkParent( elem );

    // match elem with all selected elems of parent
    var elems = elem.parentNode.querySelectorAll( selector );
    for ( var i=0, len = elems.length; i < len; i++ ) {
      // return true if match
      if ( elems[i] === elem ) {
        return true;
      }
    }
    // otherwise return false
    return false;
  }
127589
function matches (el, selector) {
  var _matches = el.matches ||
    el.matchesSelector ||
    el.msMatchesSelector ||
    el.mozMatchesSelector ||
    el.webkitMatchesSelector ||
    el.oMatchesSelector

  if (_matches) {
    return _matches.call(el, selector)
  } else if (el.parentNode) {
    // IE8 and below
    var nodes = el.parentNode.querySelectorAll(selector)
    for (var i = nodes.length; i--; 0) {
      if (nodes[i] === el) return true
    }
    return false
  }
}
346646
function(selector, node) {
        var groups = selector.split(','),
            queries = [],
            prefix = '',
            i, len;

        if (node) {
            // enforce for element scoping
            if (node.tagName) {
                node.id = node.id || Y.guid();
                prefix = '[id="' + node.id + '"] ';
            }

            for (i = 0, len = groups.length; i < len; ++i) {
                selector =  prefix + groups[i];
                queries.push([selector, node]);
            }
        }

        return queries;
    }
261015
def find_element_by_jquery(step, browser, selector):
    """"""
    elements = find_elements_by_jquery(browser, selector)
    assert_true(step, len(elements) > 0)
    return elements[0]
616983
function ( el, selector, rootEl ) {
            var root = rootEl || document,
                parent = el.parentNode;
    
            if ( parent && parent != root ) {
                var match = this.match( parent, selector );
                return match? parent : this.closest( parent, selector );
            } else {
                return;
            }
        }
4697
def construct_selector(self, el, attr=''):
        """"""

        selector = deque()
        ancestor = el
        while ancestor and ancestor.parent:
            if ancestor is not el:
                selector.appendleft(ancestor.name)
            else:
                tag = ancestor.name
                prefix = ancestor.prefix
                classes = self.get_classes(ancestor)
                tag_id = ancestor.attrs.get('id', '').strip()
                sel = ''
                if prefix:
                    sel += prefix + '|'
                sel += tag
                if tag_id:
                    sel += '#' + tag_id
                if classes:
                    sel += '.' + '.'.join(classes)
                if attr:
                    sel += '[%s]' % attr
                selector.appendleft(sel)
            ancestor = ancestor.parent
        return '>'.join(selector)
697715
function getElements(node, attr) {
  return Array.prototype.slice.call(node.querySelectorAll("[" + attr + "]"));
}
958455
function querySelector(sel, flag) {
      var node = this.root.querySelector(normalize(sel));
      return !flag ? node : node._tag || undefined;
    }
360016
function(element, query) {
        if (!query) {
            return null;
        }

        element = $(element);

        if ($.type(query) === 'function') {
            return query.call(this, element);
        }

        return element.attr(query);
    }
761719
def isElement(self, node, name, nsuri=None):
        """"""
        if node.nodeType != node.ELEMENT_NODE:
            return 0
        return node.localName == name and \
               (nsuri is None or self.nsUriMatch(node.namespaceURI, nsuri))
397441
def _find_by_nsp(self, browser, criteria, tag, constraints):
        """"""
        return self._filter_elements(
            browser.find_elements_by_ios_predicate(criteria),
            tag, constraints)
1929
function(el, prevSelector) {

        var selector;

        if (el === this.el) {
            if (typeof prevSelector === 'string') selector = '> ' + prevSelector;
            return selector;
        }

        if (el) {

            var nthChild = V(el).index() + 1;
            selector = el.tagName + ':nth-child(' + nthChild + ')';

            if (prevSelector) {
                selector += ' > ' + prevSelector;
            }

            selector = this.getSelector(el.parentNode, selector);
        }

        return selector;
    }
234961
function (selector) {
            if (vQ.isFunction(selector)) return this.not(this.not(selector));
            return vQ(filter.call(this, function (element) {
                return vQ.matches(element, selector);
            }));
        }
113872
function(elementA, elementB) {

        var isPredecessor = false;
        this.search(elementA, function(element) {
            if (element === elementB && element !== elementA) {
                isPredecessor = true;
                return false;
            }
        }, { inbound: true });
        return isPredecessor;
    }