1. element: type
 2. element: name, must not be a building block
359626
def add_lib_elements(array_of_tuples, front = false)
      if front
        @lib_elements = array_of_tuples+lib_elements
      else
        lib_elements.concat(array_of_tuples)
      end
    end
278403
function validateElement(item) {
      if (!item) return
      if (!__passed) {
        __errors.push({
          element: item.element,
          type: item.type
        })
        if (item.callback) item.callback()
      } else {
        convertToObject($(item.element).array[0].getAttribute('name'), $(item.element).array[0].value)
      }
    }
945197
void expectValidTypeofName(Node n, String found) {
    report(JSError.make(n, UNKNOWN_TYPEOF_VALUE, found));
  }
874636
function (element, options) {
    this.element = $(element)
    this.options = $.extend(true, {}, this.options, options)
    this._init()
  }
537316
function isCustomElement(element) {
  assertType(element, Node, false, 'Invalid element specified');

  let is = getAttribute(element, 'is');
  let tag = element.tagName.toLowerCase();

  if (is && (getElementRegistry(is) !== undefined)) return true;
  if (tag && (getElementRegistry(tag) !== undefined)) return true;
  return false;
}
1079327
def raise_invalid_type_exception(self):
        """"""
        message = 'Expecting element type of %s' % (
            self._parameter.element_type.__name__)
        err = ValueError(message)
        return err
903973
function (element) {
    return this._someNode(element.childNodes, function(node) {
      return this.DIV_TO_P_ELEMS.indexOf(node.tagName) !== -1 ||
             this._hasChildBlockElement(node);
    });
  }
588871
function Element(doc, name, content) {
    if (!doc) {
        throw new Error('document argument required');
    } else if (! (doc instanceof bindings.Document)) {
        throw new Error('document argument must be an ' +
                        'instance of Document');
    } else if (!name) {
        throw new Error('name argument required');
    }

    return new bindings.Element(doc, name, content);
}
976309
function(element, name) {
        var names = element.className;
        return (!!names && new RegExp("(^|\\s)" + name + "(\\s|$)").test(names));
    }
1339180
def create_element(cls, type_=None, props=None, *children):
        
        # Create an empty document fragment.
        if not type_:
            return cls.dom.create_tag('fragment')

        if props is None:
            props = {}

        # If the first element of children is a list, we use it as the list.
        if len(children) and isinstance(children[0], (list, tuple)):
            children = children[0]

        # The children prop is the first child if there is only one.
        props['children'] = children[0] if len(children) == 1 else children

        if callable(type_):
            # Function component, via def or lambda.
            elt = type_(props)
        else:
            # Raw tag, as a string.
            attributes = {}

            # Never render those attributes on a raw tag.
            props.pop('children', None)
            props.pop('block', None)
            props.pop('blocks', None)
            props.pop('entity', None)
            props.pop('inline_style_range', None)

            # Convert style object to style string, like the DOM would do.
            if 'style' in props and isinstance(props['style'], dict):
                rules = ['{0}: {1};'.format(DOM.camel_to_dash(s), props['style'][s]) for s in props['style'].keys()]
                props['style'] = ''.join(sorted(rules))

            # Convert props to HTML attributes.
            for key in props:
                if props[key] is False:
                    props[key] = 'false'

                if props[key] is True:
                    props[key] = 'true'

                if props[key] is not None:
                    attributes[key] = unicode(props[key])

            elt = cls.dom.create_tag(type_, attributes)

            # Append the children inside the element.
            for child in children:
                if child not in (None, ''):
                    cls.append_child(elt, child)

        # If elt is "empty", create a fragment anyway to add children.
        if elt in (None, ''):
            elt = cls.dom.create_tag('fragment')

        return elt
1111030
int newElement() {
		int element = m_firstFree;
		if (element == -1) {
			if (m_last == m_capacity) {
				long newcap = m_capacity != 0 ? (((long) m_capacity + 1) * 3 / 2)
						: (long) 1;
				if (newcap > Integer.MAX_VALUE)
					newcap = Integer.MAX_VALUE;// cannot grow past 2gb elements
												// presently

				if (newcap == m_capacity)
					throw new IndexOutOfBoundsException();

				grow_(newcap);
			}

			element = ((m_last / m_blockSize) << m_blockPower)
					+ (m_last % m_blockSize) * m_realStride;
			m_last++;
		} else {
			m_firstFree = m_buffer[element >> m_blockPower][element
					& m_blockMask];
		}

		m_size++;
		int ar[] = m_buffer[element >> m_blockPower];
		int ind = element & m_blockMask;
		for (int i = 0; i < m_stride; i++) {
			ar[ind + i] = -1;
		}
		return element;
	}
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))
207997
def type(self):
        
        value = self._schema.get("type", "any")
        if not isinstance(value, (basestring, dict, list)):
            raise SchemaError(
                "type value {0!r} is not a simple type name, nested "
                "schema nor a list of those".format(value))
        if isinstance(value, list):
            type_list = value
            # Union types have to have at least two alternatives
            if len(type_list) < 2:
                raise SchemaError(
                    "union type {0!r} is too short".format(value))
        else:
            type_list = [value]
        seen = set()
        for js_type in type_list:
            if isinstance(js_type, dict):
                # no nested validation here
                pass
            elif isinstance(js_type, list):
                # no nested validation here
                pass
            else:
                if js_type in seen:
                    raise SchemaError(
                        ("type value {0!r} contains duplicate element"
                         " {1!r}").format(value, js_type))
                else:
                    seen.add(js_type)
                if js_type not in (
                    "string", "number", "integer", "boolean", "object",
                    "array", "null", "any"):
                    raise SchemaError(
                        "type value {0!r} is not a simple type "
                        "name".format(js_type))
        return value
1202737
def from_element(cls, element):
        
        def _int_helper(name):
            """Try to convert the name attribute to an int, or None."""
            result = element.get(name)
            if result is not None:
                try:
                    return int(result)
                except ValueError:
                    raise DIDLMetadataError(
                        'Could not convert {0} to an integer'.format(name))
            else:
                return None

        content = {}
        # required
        content['protocol_info'] = element.get('protocolInfo')
        if content['protocol_info'] is None:
            raise DIDLMetadataError('Could not create Resource from Element: '
                                    'protocolInfo not found (required).')
        # Optional
        content['import_uri'] = element.get('importUri')
        content['size'] = _int_helper('size')
        content['duration'] = element.get('duration')
        content['bitrate'] = _int_helper('bitrate')
        content['sample_frequency'] = _int_helper('sampleFrequency')
        content['bits_per_sample'] = _int_helper('bitsPerSample')
        content['nr_audio_channels'] = _int_helper('nrAudioChannels')
        content['resolution'] = element.get('resolution')
        content['color_depth'] = _int_helper('colorDepth')
        content['protection'] = element.get('protection')
        content['uri'] = element.text
        return cls(**content)
10544
def each_element(e_node_type=nil, &block) 
		@children.each do |c| 
			if c.kind_of? MDElement
				if (not e_node_type) || (e_node_type == c.node_type)
					block.call c
				end
				c.each_element(e_node_type, &block)
			end
		end
	end
98535
static boolean isElementParentName(Element element, String name) {
        Element parent = element.getParentElement();
        if (parent == null) {
            return false;
        }
        return isElementName(parent, name);
    }
648306
def element(self, *args, **kwargs):
        
        child_element = self._element.add_element(*args, **kwargs)
        return Builder(child_element)