Return a unique BDD node.
340867
def _bddnode(root, lo, hi):
    """"""
    if lo is hi:
        node = lo
    else:
        key = (root, lo, hi)
        try:
            node = _NODES[key]
        except KeyError:
            node = _NODES[key] = BDDNode(*key)
    return node
53562
def get_node_by_dsl(self, node_dict: BaseEntity) -> Optional[Node]:
        """"""
        return self.get_node_by_hash(node_dict.as_sha512())
633903
def inspect_node(self, index):
        """"""

        if index >= len(self.graph.nodes):
            raise RPCErrorCode(6)  #FIXME: use actual error code here for UNKNOWN_ERROR status

        return create_binary_descriptor(str(self.graph.nodes[index]))
1374515
def branch(self, node, **kwargs):
        """"""

        return _Identifiers(self.compiler, node, self, **kwargs)
1305380
public BDDNode toLngBdd(final int bdd) {
    final BDDConstant falseNode = BDDConstant.getFalsumNode(this.f);
    final BDDConstant trueNode = BDDConstant.getVerumNode(this.f);
    if (bdd == BDDKernel.BDD_FALSE)
      return falseNode;
    if (bdd == BDDKernel.BDD_TRUE)
      return trueNode;
    final List<int[]> nodes = this.kernel.allNodes(bdd);
    final Map<Integer, BDDInnerNode> innerNodes = new HashMap<>();
    for (final int[] node : nodes) {
      final int nodenum = node[0];
      final Variable variable = this.idx2var.get(node[1]);
      final BDDNode lowNode = getInnerNode(node[2], falseNode, trueNode, innerNodes);
      final BDDNode highNode = getInnerNode(node[3], falseNode, trueNode, innerNodes);
      if (innerNodes.get(nodenum) == null)
        innerNodes.put(nodenum, new BDDInnerNode(variable, lowNode, highNode));
    }
    return innerNodes.get(bdd);
  }
1182430
def setnodeval(delta, graph, node, key, value):
    """"""
    if (
        graph in delta and 'nodes' in delta[graph] and
        node in delta[graph]['nodes'] and not delta[graph]['nodes'][node]
    ):
        return
    delta.setdefault(graph, {}).setdefault('node_val', {}).setdefault(node, {})[key] = value
382862
def unique_key(connection):
    
    while 1:
        key = str(uuid.uuid4().hex)
        if not connection.exists(key):
            break
    return key
959392
def _neg(node):
    """"""
    if node is BDDNODEZERO:
        return BDDNODEONE
    elif node is BDDNODEONE:
        return BDDNODEZERO
    else:
        return _bddnode(node.root, _neg(node.lo), _neg(node.hi))
597928
function spawnNodesWithId (n, factory, callback) {
  spawnNodes(n, factory, (err, nodes) => {
    if (err) return callback(err)
    map(nodes, identify, callback)
  })
}
570980
function (graph, opts, params) {
    if (graph.children.length == 0) return '';

    function getRels(node) {
      var rels = [];
      node.children.forEach(function(childNode) {
        rels.push('(' + node.name + ')-[__rel_' + childNode.name + ':' + childNode.comp.rel + ']->(' + childNode.name + ')');
        rels.push.apply(rels, getRels(childNode));
      });
      return rels;
    }
    
    return 'CREATE UNIQUE ' + getRels(graph).join(',');
  }
1310315
def getElementById(self, node, id, default=join):
        """"""
        attrget = self.getAttr
        ELEMENT_NODE = node.ELEMENT_NODE
        for child in node.childNodes:
            if child.nodeType == ELEMENT_NODE:
                if attrget(child, 'id') == id:
                    return child
        if default is not join:
            return default
        raise KeyError, name
755841
def uniqify_once(func):
  """"""
  @six.wraps(func)
  def unique_once(self, *args, **kwargs):
    return self.unique_once(func(self, *args, **kwargs))
  return unique_once
419713
def _get_node(self, node_id):
        """"""
        self.non_terminated_nodes({})  # Side effect: updates cache

        if node_id in self.cached_nodes:
            return self.cached_nodes[node_id]

        # Node not in {pending, running} -- retry with a point query. This
        # usually means the node was recently preempted or terminated.
        matches = list(self.ec2.instances.filter(InstanceIds=[node_id]))
        assert len(matches) == 1, "Invalid instance id {}".format(node_id)
        return matches[0]
950394
def duplicate_node(self, node, x, y, z):
        
        if node.status != "stopped" and not node.is_always_running():
            raise aiohttp.web.HTTPConflict(text="Cannot duplicate node data while the node is running")

        data = copy.deepcopy(node.__json__(topology_dump=True))
        # Some properties like internal ID should not be duplicated
        for unique_property in (
                'node_id',
                'name',
                'mac_addr',
                'mac_address',
                'compute_id',
                'application_id',
                'dynamips_id'):
            data.pop(unique_property, None)
            if 'properties' in data:
                data['properties'].pop(unique_property, None)
        node_type = data.pop('node_type')
        data['x'] = x
        data['y'] = y
        data['z'] = z
        new_node_uuid = str(uuid.uuid4())
        new_node = yield from self.add_node(
            node.compute,
            node.name,
            new_node_uuid,
            node_type=node_type,
            **data)
        try:
            yield from node.post("/duplicate", timeout=None, data={
                "destination_node_id": new_node_uuid
            })
        except aiohttp.web.HTTPNotFound as e:
            yield from self.delete_node(new_node_uuid)
            raise aiohttp.web.HTTPConflict(text="This node type cannot be duplicated")
        except aiohttp.web.HTTPConflict as e:
            yield from self.delete_node(new_node_uuid)
            raise e
        return new_node
319425
def pytorch_id(node):
    """"""
    # After ONNX simplification, the scopeName is not unique anymore
    # so append node outputs to guarantee uniqueness
    return node.scopeName() + "/outputs/" + "/".join([o.uniqueName() for o in node.outputs()])
1013582
def uniqueID(size=6, chars=string.ascii_uppercase + string.digits):
    """"""
    return ''.join(random.choice(chars) for x in xrange(size))
366360
def unique_deps(deps):
    """"""
    deps.sort()
    return list(k for k, _ in itertools.groupby(deps))