element (based on rule 2).
519660
private static UNode parseXMLElement(Element elem) {
        assert elem != null;
        
        // Get the element's content and attributes, if any.
        String content = Utils.getElementText(elem);
        NamedNodeMap attrMap = elem.getAttributes();
        
        // Map the element's child elements, if any, into a UNode list. This also tells us
        // if there are any child nodes.
        List<UNode> childUNodeList = new ArrayList<UNode>();
        boolean bDupNodeNames = parseXMLChildElems(elem, childUNodeList);
        
        // Decide what the element becomes as documented above.
        UNode result = null;
        
        // Detect base64 encoding attribute and remove it.
        String encoding = elem.getAttribute("encoding");
        if (!Utils.isEmpty(encoding) && encoding.equalsIgnoreCase("base64")) {
            attrMap.removeNamedItem("encoding");
            content = Utils.base64ToString(content);
        }
        
        // Case 1): <key>Stellar1</key>
        if (attrMap.getLength() == 0 && childUNodeList.size() == 0) {
            // No attributes and no child elements. Use the tag name and the element
            // content (which may be empty) as the node value.
            result = createValueNode(elem.getTagName(), content);
        
        // Case 2): <field name="_ID">lollapalooza</field>
        } else if (attrMap.getLength() == 1 &&
                        elem.getAttribute("name").length() > 0 &&
                        childUNodeList.size() == 0) {
            // Only a "name" attribute and no child elements. Use attribute value as the
            // name and content as the value.
            result = createValueNode(elem.getAttribute("name"), content, elem.getTagName());
            
        // Case 3): <option name="AutoTables" value="false"/>
        } else if (attrMap.getLength() == 2 &&
                        elem.getAttribute("name").length() > 0 &&
                        elem.getAttribute("value").length() > 0 &&
                        childUNodeList.size() == 0) {
            // Use values of "name" and "value" attributes. No content allowed.
            assert content.length() == 0 : "Content is not allowed for 'name/value' element: " + content;
            result = createValueNode(elem.getAttribute("name"), elem.getAttribute("value"), elem.getTagName());
            
        // Case 4): All other cases generate a MAP or an ARRAY.
        } else {
            // We shouldn't have any content for these nodes.
            assert content.length() == 0 : "Unexpected content for element '" +
                                           elem.getTagName() + "': " + content;
            
            // Use the "name" attribute value for the UNode name, if present. Otherwise,
            // use the element name.
            if (elem.getAttribute("name").length() > 0) {
                if (bDupNodeNames) {
                    result = createArrayNode(elem.getAttribute("name"), elem.getTagName());
                } else {
                    result = createMapNode(elem.getAttribute("name"), elem.getTagName());
                }
                attrMap.removeNamedItem("name");
            } else {
                if (bDupNodeNames) {
                    result = createArrayNode(elem.getTagName());
                } else {
                    result = createMapNode(elem.getTagName());
                }
            }
            
            // Map remaining attributes, if any, into child UNode objects and add all
            // child UNodes to this node's list.
            parseXMLAttributes(attrMap, childUNodeList);
            result.addChildNodes(childUNodeList);
        }
        return result;
    }
610328
function(selector) {
    for (var ii = 0; ii < document.styleSheets.length; ++ii) {
      var styleSheet = document.styleSheets[ii];
      var rules = styleSheet.cssRules || styleSheet.rules;
      if (rules) {
        for (var rr = 0; rr < rules.length; ++rr) {
          var rule = rules[rr];
          if (rule.selectorText === selector) {
            return rule;
          }
        }
      }
    }
  }
1169104
function select(rule, prefix) {
 return rule.selectors && rule.selectors[0] && rule.selectors[0].indexOf(prefix) === 0;
}
235942
function(elementA, elementB) {

        var isSuccessor = false;
        this.search(elementA, function(element) {
            if (element === elementB && element !== elementA) {
                isSuccessor = true;
                return false;
            }
        }, { outbound: true });
        return isSuccessor;
    }
102251
def element(label = '&nbsp;', value = '', type = 'text_field', &block)
      value += @template.capture(&block) if block_given?
      %{
        <div class='control-group'>
          <label class='control-label'>#{label}</label>
          <div class='controls'>
            #{value}
          </div>
        </div>
      }.html_safe
    end
123617
def element(i)
      unless i.matched?
        unless (0 ... shape.last).member? i
          raise "Index must be in 0 ... #{shape.last} (was #{i})"
        end
        i = INT.new i
      end
      i.size = @index.size if i.is_a?(Variable) and @index.size.get
      @term.subst @index => i
    end
1148228
function containsActiveElement (el) {
  const node = el && findDOMNode(el)
  const active = getActiveElement()
  return (node && (active === node || contains(node,active)))
}
224620
function ruleEnd(e){

    var selectors ;

    if (e.old === 'ruleStart'){
      selectors = this.get('selectors');
      //delete the last selector
      selectors.pop();
      var lines = this.get('lines');
      lines.pop();

      this.attributes.nest.pop();

      return;
    } else if (e.old === 'valueStart') {
      this._addValue(e);
    }

    ruleEnd.recode = ruleEnd.recode || 0;
    ruleEnd.recode++;
    this.attributes.nest.pop();

    if (!this.attributes.nest.length){
      var num = this.getLen() - ruleEnd.recode;
      ruleEnd.recode = 0;
      var idList = this.get('idList');
      idList.push(num);
      this.fire(this.get('RULE_END_EVT'), this.getRule(num));
    }
  }
929271
function (element, attr) {
			for (var key in attr) {
				element.setAttribute(key, attr[key]);
			}

			return element;
		}
1017247
function (element, className) {
		var elemClassName;
		while (element) {
			elemClassName = attr(element, 'class');
			if (elemClassName) {
				if (elemClassName.indexOf(className) !== -1) {
					return true;
				} else if (elemClassName.indexOf(PREFIX + 'container') !== -1) {
					return false;
				}
			}
			element = element.parentNode;
		}		
	}
648306
def element(self, *args, **kwargs):
        
        child_element = self._element.add_element(*args, **kwargs)
        return Builder(child_element)
1111634
def baseline(cls, element):
        
        if 'title' in element.attrib:
            matches = cls.baseline_pattern.search(element.attrib['title'])
            if matches:
                return float(matches.group(1)), int(matches.group(2))
        return (0, 0)
698812
public static void processRuleElement(ParserContext context, ConfigurationRuleBuilder rule, Element element)
    {
        String id = $(element).attr("id");

        List<Element> children = $(element).children().get();
        for (Element child : children)
        {
            Object result = context.processElement(child);

            switch ($(child).tag())
            {
            case "when":
                rule.when(((Condition) result));
                break;

            case "perform":
                rule.perform(((Operation) result));
                break;

            case "otherwise":
                rule.otherwise(((Operation) result));
                break;

            case "where":
                break;
            }
        }

        if (StringUtils.isNotBlank(id))
        {
            rule.withId(id);
        }

    }
282803
function(element) {
        if(!element) return;

        var children = element.children();
        if(children.length <= 0) return;

        var totalWidth = 0;
        for(var i = 0; i < children.length; i++) {
            totalWidth += $(children[i]).width();
        }

        element.width(totalWidth);
    }
1095569
function elementType(element) {
  var name = element.nodeName.toLowerCase();
  if (name !== "input") {
    if (name === "select" && element.multiple) {
      return "select-multiple";
    }
    return name;
  }
  var type = element.getAttribute('type');
  if (!type) {
    return "text";
  }
  return type.toLowerCase();
}
1325755
function(el) {
		var self = this,
			$el = $(el);

		if ($el.length > 1) {
			$el.each(function() {
				self.addElement(this);
			});
		} else if ($el.length === 0) {
			throw new Error("Invalid element!");
		}

		if (this.$el.closest($el).length) {
			throw new Error("Element is a child of this view. This is only for unrelated elements");
		}
		if ($el.closest(this.$el).length) {
			throw new Error("Element is an ancestor of this view! Reconsider how you're using this view.");
		}

		// normalize
		el = $el.get(0);

		if (!this._trackedElements) {
			this._trackedElements = [];
		}
		_(this._trackedElements).each(function(otherEl) {
			var $otherEl = $(otherEl);

			if ($otherEl.closest($el).length) {
				throw new Error("Element is a child of another tracked element. This will cause problems.");
			}
			if ($el.closest($otherEl).length) {
				throw new Error("Element is an ancestor of another tracked element. This will cause problems.");
			}
		});
		this._trackedElements.push(el);
	}
950333
function checkPositionAndRule( nodeA, nodeB, def, posBitFlags ) {
		return ( nodeA.getPosition( nodeB ) | posBitFlags ) == posBitFlags &&
			( !def.childRule || def.childRule( nodeA ) );
	}