Adds the ipaddress attribute to the given node object if not already
    present and it is correctly given by ohai
    Returns True if ipaddress is added, False otherwise
191355
def _get_ipaddress(node):
    
    if "ipaddress" not in node:
        with settings(hide('stdout'), warn_only=True):
            output = sudo('ohai -l warn ipaddress')
        if output.succeeded:
            try:
                node['ipaddress'] = json.loads(output)[0]
            except ValueError:
                abort("Could not parse ohai's output for ipaddress"
                      ":\n  {0}".format(output))
            return True
    return False
1023802
private boolean isAllowedAddress(String ipAddress) {
        if (allowedAddresses == null) {
            return false;
        }

        // IPv4
        int offset = ipAddress.lastIndexOf('.');
        if (offset == -1) {
            // IPv6
            offset = ipAddress.lastIndexOf(':');
            if (offset == -1) {
                return false;
            }
        }

        String ipAddressClass = ipAddress.substring(0, offset + 1) + '*';
        return (allowedAddresses.contains(ipAddressClass) || allowedAddresses.contains(ipAddress));
    }
1334508
private boolean isIPV4address(String address) {
        StringTokenizer st = new StringTokenizer(address, ".");
        List<String> nodes = new ArrayList<String>();
        while (st.hasMoreTokens())
            nodes.add(st.nextToken());
        return (nodes.size() == 4);
    }
919324
private void setNodeDirty(final Node<K, V> node) {
		final int nodeid = node.id;
		final int index = nodeid < 0 ? -nodeid : nodeid;
		(node.isLeaf() ? dirtyLeafNodes : dirtyInternalNodes).put(nodeid, node);
		(node.isLeaf() ? cacheLeafNodes : cacheInternalNodes).remove(nodeid);
		if (enableIOStats) {
			getIOStat(nodeid).incCacheWrite();
		}
		if (enableDirtyCheck) {
			dirtyCheck.set(index);
		}
	}
829247
@Override
  public boolean visit(Assignment node) {
    Expression lhs = node.getLeftHandSide();
    TypeMirror lhsType = lhs.getTypeMirror();
    if (lhs instanceof ArrayAccess && !lhsType.getKind().isPrimitive()) {
      FunctionInvocation newAssignment = newArrayAssignment(node, (ArrayAccess) lhs, lhsType);
      node.replaceWith(newAssignment);
      newAssignment.accept(this);
      return false;
    }
    return true;
  }
863221
def add_node_attribute(self, node, attr):
        
        self.node_attr[node] = self.node_attr[node] + [attr]
508326
def update_property_node(node_to_insert, field_uri):
  
  root = T.SetItemField(
            T.FieldURI(FieldURI=field_uri),
            T.CalendarItem(node_to_insert)
        )
  return root
548201
function addParentNodeInterfaceToPrototype(p) {
    Object.defineProperty(p, "firstElementChild", {
      get: function firstElementChild() {
        var el = this.firstChild;
        while (el && el.nodeType !== 1) {
          el = el.nextSibling;
        }
        return el;
      },
    });

    Object.defineProperty(p, "lastElementChild", {
      get: function lastElementChild() {
        var el = this.lastChild;
        while (el && el.nodeType !== 1) {
          el = el.previousSibling;
        }
        return el;
      },
    });

    Object.defineProperty(p, "childElementCount", {
      get: function childElementCount() {
        var el = this.firstElementChild;
        var count = 0;
        while (el) {
          count++;
          el = el.nextElementSibling;
        }
        return count;
      },
    });
  }
556124
def _check_add_node(self, parent, name):
        
        if name == ns("text", "a"):
            if parent.tag == ns("draw", "text-box"):
                return False

        return True
108229
function addNode( $nodeID, $isSubtree = true )
    {
        $this->RootNodeIDArray[] = $nodeID;
        $this->NodeIDArray[] = $nodeID;

        if ( $isSubtree )
        {
            $nodeArray = eZContentObjectTreeNode::subTreeByNodeID( array( 'AsObject' => false ), $nodeID );
            foreach( $nodeArray as $node )
            {
                $this->NodeIDArray[] = $node['node_id'];
            }
        }
    }
595623
function addConnect ( base, add ) {

            if ( !add ) {
                return false;
            }

            return addNodeTo(base, options.cssClasses.connect);
        }
162364
public void addNode(Node node) {

		long nId = node.getId();
		
		if (this.containsNode(nId))
			throw new DuplicatedNodeException(nId);
		int index = nextNodeId++;
		nodeIdMapping.put(nId, index);

		int aliveIndex = index >> 5;
		int aliveSubIndex = index & 31;

		if (aliveIndex >= aliveNodes.size())
			aliveNodes.add(0);

		aliveNodes.set(aliveIndex, aliveNodes.get(aliveIndex) | (byte)(1 << aliveSubIndex));

		adjacency.add(new IntHashSet[] {new IntHashSet(), new IntHashSet()});

		nodes.add(node);
		numberOfNodes++;
	}
1302537
private boolean nodeAttribute(Node node, String attributeName, boolean defaultValue) {
        boolean value = defaultValue;
        if (node.hasAttributes()) {
            Node attribute = node.getAttributes().getNamedItem(attributeName);
            if (attribute != null) {
                value = Boolean.valueOf(attribute.getNodeValue());
            }
        }
        return value;
    }
628942
public synchronized boolean addNode(final NodeConfig config, final Balancer.BalancerBuilder balancerConfig, final XnioIoThread ioThread, final ByteBufferPool bufferPool) {

        final String jvmRoute = config.getJvmRoute();
        final Node existing = nodes.get(jvmRoute);
        if (existing != null) {
            if (config.getConnectionURI().equals(existing.getNodeConfig().getConnectionURI())) {
                // TODO better check if they are the same
                existing.resetState();
                return true;
            } else {
                existing.markRemoved();
                removeNode(existing);
                if (!existing.isInErrorState()) {
                    return false; // replies with MNODERM error
                }
            }
        }

        final String balancerRef = config.getBalancer();
        Balancer balancer = balancers.get(balancerRef);
        if (balancer != null) {
            UndertowLogger.ROOT_LOGGER.debugf("Balancer %s already exists, replacing", balancerRef);
        }
        balancer = balancerConfig.build();
        balancers.put(balancerRef, balancer);

        final Node node = new Node(config, balancer, ioThread, bufferPool, this);
        nodes.put(jvmRoute, node);
        // Schedule the health check
        scheduleHealthCheck(node, ioThread);
        // Reset the load factor periodically
        if (updateLoadTask.cancelKey == null) {
            updateLoadTask.cancelKey = ioThread.executeAtInterval(updateLoadTask, modCluster.getHealthCheckInterval(), TimeUnit.MILLISECONDS);
        }
        // Remove from the failover groups
        failoverDomains.remove(node.getJvmRoute());
        UndertowLogger.ROOT_LOGGER.registeringNode(jvmRoute, config.getConnectionURI());
        return true;
    }
402707
function registerNode (host, node, insertBefore, func) {
  const index = indexOfNode(host, insertBefore);
  eachNodeOrFragmentNodes(node, (eachNode, eachIndex) => {
    func(eachNode, eachIndex);

    if (canPatchNativeAccessors) {
      nodeToParentNodeMap.set(eachNode, host);
    } else {
      staticProp(eachNode, 'parentNode', host);
    }

    // When childNodes is artificial, do manual house keeping.
    if (Array.isArray(host.childNodes)) {
      if (index > -1) {
        arrProto.splice.call(host.childNodes, index + eachIndex, 0, eachNode);
      } else {
        arrProto.push.call(host.childNodes, eachNode);
      }
    }
  });
}
38723
def add(node_name, **kwargs):
    
    result = {}
    kwargs = kwargs.copy()
    overwrite = kwargs.pop('overwrite', False)
    node = nago.core.get_node(node_name)
    if not node:
        node = nago.core.Node()
    elif not overwrite:
        result['status'] = 'error'
        result['message'] = "node %s already exists. add argument overwrite=1 to overwrite it." % (node_name)
        return result
    else:
        node.delete()
        node = nago.core.Node()
    node['host_name'] = node_name
    for k, v in kwargs.items():
        node[k] = v
    node.save()
    result['message'] = "node successfully saved"
    result['node_data'] = node.data
    return result
106149
public Node addNode(@NonNull String ip, @NonNull int port) {
        val node = Node.builder()
                .id(ip)
                .port(port)
                .upstream(null)
                .build();

         return this.addNode(node);
    }