return the value of the child element with name in the parent Element
339201
def get_child_value(parent, name, allow_missing=0):
        
        if not parent.hasElement(name):
            if allow_missing:
                return np.nan
            else:
                raise Exception('failed to find child element %s in parent' % name)
        else:
            return XmlHelper.as_value(parent.getElement(name))
557366
def getElementById(self, _id):
        '''
            
        '''
        for child in self.children:
            if child.getAttribute('id') == _id:
                return child
            found = child.getElementById(_id)
            if found is not None:
                return found
        return None
755829
def _get_parent(root):
    

    elem = root

    while True:
        elem = elem.getparent()

        if elem.tag in ['ul', 'ol']:
            return elem
241094
function(tagName, parent){
	this.name = tagName;
	this.parent = parent;
	this.attributes = {};
	this.children = [];
	this.tagScore = 0;
	this.attributeScore = 0;
	this.totalScore = 0;
	this.elementData = "";
	this.info = {
		textLength: 0,
		linkLength: 0,
		commas:		0,
		density:	0,
		tagCount:	{}
	};
	this.isCandidate = false;
}
824117
def parent_of(self, name):
        
        if not self._in_tag(name):
            return

        node = self.cur_node
        while node.tag != name:
            node = node.getparent()
        self.cur_node = node.getparent()
735086
public static Element getChild(Element parent, String childName) {
		NodeList nodes = parent.getChildNodes();
		for (int i = 0; i < nodes.getLength(); ++i) {
			Node node = nodes.item(i);
			if ((node instanceof Element) && node.getNodeName().equals(childName))
				return (Element)node;
		}
		return null;
	}
696045
static Element getChildByName(Node parent, String nodeName) {
	return getChildByName(parent, nodeName, false);
    }
1334404
def get_element_text(parent_to_parse, element_path=None, default_value=u''):
    

    parent_element = get_element(parent_to_parse, element_path)

    if parent_element is None:
        return default_value

    if parent_element.text:
        return parent_element.text.strip() or default_value

    return default_value
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;
        }
1135100
def parent(self):
        
        if self == root or self == empty:
            raise NoParent
        return Name(self.labels[1:])
575340
def getElementById(self, _id):
        '''
            
        '''
        for tag in self:
            if tag.id == _id:
                return tag
            for subtag in tag.children:
                tmp = subtag.getElementById(_id)
                if tmp is not None:
                    return tmp
        return None
877324
def get_element_name(parent, ns):
    # type: (_Element, str) -> str
    """"""
    name = parent.find('./' + ns + 'SHORT-NAME')
    if name is not None and name.text is not None:
        return name.text
    return ""
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
352733
function selector(el){
  var classname = trim(el.className.baseVal ? el.className.baseVal : el.className);
  var i = el.parentNode && 9 == el.parentNode.nodeType ? -1 : index(el);

  return el.tagName.toLowerCase()
    + (el.id ? '#' + el.id : '')
    + (classname ? classname.replace(/^| +/g, '.') : '')
    + (~i ? ':nth-child(' + (i + 1) + ')' : '');
}
307880
def get_child(parent, tag_name, root_or_cache, namespace):
    # type: (_Element, str, _DocRoot, str) -> typing.Optional[_Element]
    """"""
    # logger.debug("get_child: " + tag_name)
    if parent is None:
        return None
    ret = parent.find('.//' + namespace + tag_name)
    if ret is None:  # no direct element - try reference
        reference = parent.find('.//' + namespace + tag_name + '-REF')
        if reference is not None:
            if isinstance(root_or_cache, ArTree):
                ret = get_cached_element_by_path(root_or_cache, reference.text)
            else:
                ret = get_element_by_path(root_or_cache, reference.text, namespace)
    return ret
131159
protected Element getElement(Object parent, String name) {
		if (name == null) {
			return null;
		}
		String id;
		if (parent == null) {
			id = getRootElement().getId();
		} else {
			id = groupToId.get(parent);
		}
		return Dom.getElementById(Dom.assembleId(id, name));
	}
679478
function() {
            var element = this._element;
            while (element.parentNode) {
                element = element.parentNode;
                if (element.$widget) {
                    return element.$widget;
                }
            }
            return null;
        }