Sort class and id groups alphabetically
@param {Object} selector - postcss selector node
11353
function sortGroups(selector) {
  selector.each((subSelector) => {
    subSelector.nodes.sort((a, b) => {
      // different types cannot be sorted
      if (a.type !== b.type) {
        return 0;
      }

      // sort alphabetically
      return a.value < b.value ? -1 : 1;
    });
  });

  selector.sort((a, b) => (a.nodes.join('') < b.nodes.join('') ? -1 : 1));
}
119416
function (selector) {
            var self = this, all = self.all(selector), ret = all.length ? all.slice(0, 1) : null;
            if (ret) {
                ret.__parent = self;
            }
            return ret;
        }
1111123
function querySelector(selector) {
    // match selector and halt on first result.
    var result = mixinImpl.query(this, function(n) {
      return matchesSelector(n, selector);
    }, function(n) {
      return Boolean(n);
    })[0];
    return result || null;
  }
1238550
function _parseSelector(ctx) {
            var selector = "";

            // Skip over {
            TokenUtils.movePrevToken(ctx);

            while (true) {
                if (ctx.token.type !== "comment") {
                    // Stop once we've reached a {, }, or ;
                    if (/[\{\}\;]/.test(ctx.token.string)) {
                        break;
                    }

                    // Stop once we've reached a <style ...> tag
                    if (ctx.token.string === "style" && ctx.token.type === "tag") {
                        // Remove everything up to end-of-tag from selector
                        var eotIndex = selector.indexOf(">");
                        if (eotIndex !== -1) {
                            selector = selector.substring(eotIndex + 1);
                        }
                        break;
                    }

                    selector = ctx.token.string + selector;
                }
                if (!TokenUtils.movePrevToken(ctx)) {
                    break;
                }
            }

            return selector;
        }
720260
function standardIndexing(selector, maxLen) {
  if (isUndefined(selector) || selector === null) {
    return null;
  }

  // Handle boolean case if applicable
  var boolIdxResult = attemptBoolIndexing(selector, maxLen);
  if (!isUndefined(boolIdxResult)) {
    return boolIdxResult;
  }

  // Handle integer indexing
  var opts = resolverOpts(RESOLVE_MODE.INT, maxLen);
  return resolveSelector(selector, opts);
}
1265097
function(n) {
    var la = this.lookahead(n).type;
    switch (la) {
      case 'for':
        return this.bracketed;
      case '[':
        this.bracketed = true;
        return true;
      case ']':
        this.bracketed = false;
        return true;
      default:
        return ~selectorTokens.indexOf(la);
    }
  }
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)
449734
function sortitem()
{
  var self = this;
  
  /* ATTRIBUTES */
  
  /* passed html title binding */
  this.title = "";
  
  /* passed active item binding */
  this.active = false;
  
  /* passed onsort method to be used when clicked */
  this.onSort = function(){};
  
  /* toggles class based on this.active */
  this.filters.activeText = function(v)
  {
    return (v ? 'active' : 'inactive');
  }
  
  /* the actual click event */
  this.sortClick = function(e)
  {
    self.onSort(self.title);
  };
}
231075
function setComparator() {
    // If the first three letters are "asc", sort in ascending order
    // and remove the prefix.
    if (by.substring(0,3) == 'asc') {
      var i = by.substring(3);
      comp = function(a, b) { return a[i] - b[i]; };
    } else {
      // Otherwise sort in descending order.
      comp = function(a, b) { return b[by] - a[by]; };
    }

    // Reset link styles and format the selected sort option.
    $('a.sel').attr('href', '#').removeClass('sel');
    $('a.by' + by).removeAttr('href').addClass('sel');
  }
171831
function transformSelector(selector, customSelectors) {
	const transpiledSelectors = [];

	for (const index in selector.nodes) {
		const { value, nodes } = selector.nodes[index];

		if (value in customSelectors) {
			for (const replacementSelector of customSelectors[value].nodes) {
				const selectorClone = selector.clone();

				selectorClone.nodes.splice(index, 1, ...replacementSelector.clone().nodes.map(node => {
					// use spacing from the current usage
					node.spaces = { ...selector.nodes[index].spaces };

					return node;
				}));

				const retranspiledSelectors = transformSelector(selectorClone, customSelectors);

				adjustNodesBySelectorEnds(selectorClone.nodes, Number(index));

				if (retranspiledSelectors.length) {
					transpiledSelectors.push(...retranspiledSelectors);
				} else {
					transpiledSelectors.push(selectorClone);
				}
			}

			return transpiledSelectors;
		} else if (nodes && nodes.length) {
			transformSelectorList(selector.nodes[index], customSelectors);
		}
	}

	return transpiledSelectors;
}
847060
function ( selector ) {
            var node = this.element().nextSibling;
            if ( !node ) return;
    
            //comment, text
            if ( node.nodeType == 8 || node.nodeType == 3 && !$B.string.trim(node.data) ) {
                return $B( node ).next( selector );
            } else {
                if ( typeof selector === 'string' ) node = $B.selector.match( node, selector )? node : undefined;
                return node;
            }
        }
193740
function normalizeAttributes(selector) {
  selector.walkAttributes((node) => {
    if (node.value) {
      // remove quotes
      node.value = node.value.replace(/'|\\'|"|\\"/g, '');
    }
  });
}
1127464
function selectorForm(selector) {
    var str;
    if (selector.indexOf('[') !== -1) {
        var newSelector = attributeEquals(selector);
        newSelector = newSelector.replace('sel=', ''); // valid sass syntax
        var firstSelector = firstPart(selector);
        if (firstSelector in jquerySelectors) {
            str = jquerySelectors[firstSelector]
                  .replace('%', '"' + newSelector + '"');
        }
    } else
    if (selector in jquerySelectors) {
        str = jquerySelectors[selector].replace('%', '');
    } else {
        str = '$("' + selector + '")';
    }
    return str;
}
1010598
function(selectors) {
		var curSelector;
		var elements;
		var attributeName;
		var attributeValue;
		var elementIndex;

		for(var selectorIndex = 0; selectorIndex < selectors.length; selectorIndex++) {
			curSelector = selectors[selectorIndex];
			elements = document.querySelectorAll(curSelector[0]);
			attributeName = 'data-' + curSelector[1];
			attributeValue = curSelector[2];

			if(!elements) {
				continue;
			}

			for(elementIndex = 0; elementIndex < elements.length; elementIndex++) {
				elements[elementIndex].setAttribute(attributeName, attributeValue);
			}
		}
	}
2123
function children(selector) {
  var arr = [], slice = this.slice, nodes, matches;
  this.each(function(el) {
    nodes = slice.call(el.childNodes);
    // only include elements
    nodes = nodes.filter(function(n) {
      if(n instanceof Element) { return n;}
    })
    // filter direct descendants by selector
    if(selector) {
      matches = slice.call(el.querySelectorAll(selector));
      for(var i = 0;i < nodes.length;i++) {
        if(~matches.indexOf(nodes[i])) {
          arr.push(nodes[i]);
        }
      }
    // get all direct descendants
    }else{
      arr = arr.concat(nodes);
    }
  });
  return this.air(arr);
}
575299
function css($selector) {
		/** @var string $result */
		if (!$this->enabled()) {
			$result = '';
		}
		else {
			/** @var Css $css */
			$css = Css::i($selector);
			$css->rule('font-weight', $this->weight());
			$css->rule('color', $this->color());
			$css->rule('font-style', $this->style());
			if ($this->underline()) {
				$css->rule('text-decoration', 'underline');
			}
			switch ($this->letter_case()) {
				case LetterCase::$LOWERCASE:
					$css->rule('text-transform', 'lowercase');
					break;
				case LetterCase::$UCFIRST:
					/**
					 * 2015-11-14
					 * .link { text-transform: lowercase; }
					 * .link:first-letter {text-transform: uppercase;}
					 * http://stackoverflow.com/a/10256138
					 */
					$css->rule('text-transform', 'lowercase');
					$css->rule('text-transform', 'uppercase', ':first-letter');
					break;
				case LetterCase::$UCWORDS:
					$css->rule('text-transform', 'capitalize');
					break;
				case LetterCase::$UPPERCASE:
					$css->rule('text-transform', 'uppercase');
					break;
			}
			if ($this->letter_spacing()->value()) {
				$css->rule('letter-spacing', $this->letter_spacing());
			}
			if ($this->needScale()) {
				/** @var string[] $names */
				$names = [
					'transform'
					, '-webkit-transform'
					, '-moz-transform'
					, '-ms-transform'
					, '-o-transform'
				];
				foreach ($names as $name) {
					/** @var string $name */
					$css->rule($name, $this->scaleRule());
				}
			}
			if ($this->size()->value()) {
				$css->rule('font-size', $this->size());
			}
			if ('default' !== $this->family()) {
				$css->rule('font-family', df_quote_single($this->family()));
			}
			$result = $css->render();
		}
		return $result;
	}
297985
function(selector) {
        var nodelist = Y.all(Y.Selector.query(selector, this._node));
        nodelist._query = selector;
        nodelist._queryRoot = this._node;
        return nodelist;
    }