/*
Helper function for getNodesByName
503576
function getNodesByNameHelper(childArray, name) {
  let nodes = [].concat(childArray.filter(element => element.name === name));
  let otherNodes = [];
  childArray.forEach(node => {
    if (hasChildren(node)) {
      otherNodes = otherNodes.concat(getNodesByNameHelper(node.children, name));
    }
  });
  return nodes.concat(otherNodes);
}
953714
public Node getNamedItem(String name)
  {

    for (int n = dtm.getFirstAttribute(element); n != DTM.NULL;
            n = dtm.getNextAttribute(n))
    {
      if (dtm.getNodeName(n).equals(name))
        return dtm.getNode(n);
    }

    return null;
  }
34370
function findNodes(body, nodeName) {
  let nodesArray = [];

  if (body) {
    nodesArray = body.filter(node => node.type === nodeName);
  }

  return nodesArray;
}
1069213
function getNodeParameters() {
        return typeof process !== "undefined" && process.argv && process.argv.length > 1 ? process.argv.slice(1) : null;
    }
97861
function (oTreeModel, aAdditionalRuleSetsNames) {

			if (!aAdditionalRuleSetsNames) {
				return;
			}

			aAdditionalRuleSetsNames.forEach(function (sRuleName) {
				Object.keys(oTreeModel).forEach(function(iKey) {
					if (oTreeModel[iKey].name === sRuleName) {
						oTreeModel[iKey].selected = false;
						oTreeModel[iKey].nodes.forEach(function(oRule){
							oRule.selected = false;
						});
					}
				});
			});

			return oTreeModel;
		}
671281
function nodeIdByName( $params )
    {
        $node = $this->nodeByName( $params );

        $id = false;
        if( is_object( $node ) )
            $id = $node->attribute( 'node_id' );

        return $id;
    }
1000104
function loadChildNodes(parentNode){
    if (gNodesWithChildren[parentNode._id]){
        var children = [];
        for (var i = 0; i < gNodesWithChildren[parentNode._id].length; ++i){
            var currentNode = gNodesWithChildren[parentNode._id][i];
            children.push({
                _id : currentNode._id, //todo : id instead of name?
                node : currentNode,
                parent : parentNode._id, //todo id instead of name?
                childNodes : loadChildNodes(currentNode)
            });
        }
        return children;
    }
}
511081
function getNodePath(node) {
    var nodePaths = [];
    var nodeParent = node;
    while (nodeParent) {
        switch (nodeParent.nodeType) {
            case NodeType.ELEM:
                nodePaths.unshift(nodeParent.tagName);
                break;

            case NodeType.IF:
                nodePaths.unshift('if');
                break;

            case NodeType.FOR:
                nodePaths.unshift('for[' + nodeParent.anode.directives['for'].raw + ']'); // eslint-disable-line dot-notation
                break;

            case NodeType.SLOT:
                nodePaths.unshift('slot[' + (nodeParent.name || 'default') + ']');
                break;

            case NodeType.TPL:
                nodePaths.unshift('template');
                break;

            case NodeType.CMPT:
                nodePaths.unshift('component[' + (nodeParent.subTag || 'root') + ']');
                break;

            case NodeType.TEXT:
                nodePaths.unshift('text');
                break;
        }

        nodeParent = nodeParent.parent;
    }

    return nodePaths;
}
744712
function getBlockNodes(nodes) {
  // TODO(perf): just check if all items in `nodes` are siblings and if they are return the original
  //             collection, otherwise update the original collection.
  var node = nodes[0];
  var endNode = nodes[nodes.length - 1];
  var blockNodes = [node];

  do {
    node = node.nextSibling;
    if (!node) break;
    blockNodes.push(node);
  } while (node !== endNode);

  return jqLite(blockNodes);
}
354381
def _get_names(node, result):
    """"""
    if isinstance(node, ast.Name):
        return node.id + result
    elif isinstance(node, ast.Subscript):
        return result
    elif isinstance(node, ast.Starred):
        return _get_names(node.value, result)
    else:
        return _get_names(node.value, result + '.' + node.attr)
219841
function getInstanceFromNode(node) {
  var inst = node[internalInstanceKey];
  if (inst) {
    if (inst.tag === HostComponent || inst.tag === HostText) {
      return inst;
    } else if (inst._hostNode === node) {
      return inst;
    } else {
      return null;
    }
  }
  inst = getClosestInstanceFromNode(node);
  if (inst != null && inst._hostNode === node) {
    return inst;
  } else {
    return null;
  }
}
718470
function getNodeInfo(x, y){
        var nodeInfo = {};
        var bestNodeInfo = {
            node: null,
            boundSize: 0
        };
        getBestNode(appTree, x, y, bestNodeInfo);
        var bestNode = bestNodeInfo.node;
        if(bestNode){
            var text = bestNode.text || bestNode.label;
            if(text){
                text = text.replace(/\s*\r?\n\s*/g,' ');
                text = text.replace(/^\s+|\s+$/g, '');
                var textLen = byteLen(text);
                text = textLen > 20 ? leftstr(text, 20) + '...' : text;
                nodeInfo.text = text;
            }
            nodeInfo.path = getNodeXPath(bestNode);
        }
        else{
            nodeInfo.x = x;
            nodeInfo.y = y;
        }
        return nodeInfo;
    }
983968
function makePredByNodeName(nodeName) {
  nodeName = nodeName.toUpperCase();
  return function(node) {
    return node && node.nodeName.toUpperCase() === nodeName;
  };
}
17149
function (xmlNode, nodeName) {

            var childs = xmlNode.childNodes;

            for (var i = 0; i < childs.length; ++i) {

                var item = childs.item(i);

                if (item.nodeType !== 1) {
                    continue;
                }

                if ((item.nodeName && !nodeName) || (nodeName && nodeName === item.nodeName)) {
                    return item;
                }
            }

            return null;
        }
336592
func (clstr *Cluster) GetNodeByName(nodeName string) (*Node, error) {
	node := clstr.findNodeByName(nodeName)

	if node == nil {
		return nil, NewAerospikeError(INVALID_NODE_ERROR, "Invalid node name"+nodeName)
	}
	return node, nil
}
1026077
@Override
    public String getFrameworkNodeName() {
        String name = getLookup().getProperty("framework.server.name");
        if (null!=name) {
            return name.trim();
        } else {
            return name;
        }
    }
596300
function getTextOfNode(node) {
        var result;
        if (node != null && node.childNodes[0]) {
            result = node.childNodes[0].nodeValue;
        } else if (node != null) {
            result = "";
        }
        return result;
    }