Creation of a new reference node.
195733
def newReference(self, name):
        
        ret = libxml2mod.xmlNewReference(self._o, name)
        if ret is None:raise treeError('xmlNewReference() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
1098819
def newCharRef(self, name):
        
        ret = libxml2mod.xmlNewCharRef(self._o, name)
        if ret is None:raise treeError('xmlNewCharRef() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
959002
function referenceFactory(tree, options) {
  var definitions = getDefinitions(tree, options)

  return reference

  /* Transform a reference based on bound `definitions`. */
  function reference(node, index, parent) {
    var definition = definitions(node.identifier)
    var replacement
    var image

    if (definition) {
      image = node.type === 'imageReference'

      replacement = {
        type: image ? 'image' : 'link',
        url: definition.url,
        title: definition.title
      }

      if (image) {
        replacement.alt = node.alt
      } else {
        replacement.children = node.children
      }

      parent.children[index] = replacement
    }
  }
}
1183421
def add_node(self, node):
        """"""
        other_nodes = [n for n in self.nodes() if n.id != node.id]

        for n in other_nodes:
            if isinstance(n, Source):
                node.connect(direction="from", whom=n)
            else:
                node.connect(direction="both", whom=n)
107854
def add_nodes(self, new_nodes):
        """"""
        for unique_id, node in new_nodes.items():
            if unique_id in self.nodes:
                raise_duplicate_resource_name(node, self.nodes[unique_id])
            self.nodes[unique_id] = node
92978
def newDocRawNode(self, doc, name, content):
        
        if doc is None: doc__o = None
        else: doc__o = doc._o
        ret = libxml2mod.xmlNewDocRawNode(doc__o, self._o, name, content)
        if ret is None:raise treeError('xmlNewDocRawNode() failed')
        __tmp = xmlNode(_obj=ret)
        return __tmp
663128
def create_node(self, network, participant):
        """"""
        return self.models.RogersAgent(network=network, participant=participant)
1155437
private void createNewState(AbstractBaseDTNode<I, D> newNode) {
        TTTTransition<I, D> newTreeTrans = newNode.getIncoming().choose();
        assert newTreeTrans != null;

        TTTState<I, D> newState = createState(newTreeTrans);
        link(newNode, newState);
        initializeState(newState);
    }
301351
def visit_annassign(self, node, parent):
        """"""
        newnode = nodes.AnnAssign(node.lineno, node.col_offset, parent)
        annotation = _visit_or_none(node, "annotation", self, newnode)
        newnode.postinit(
            target=self.visit(node.target, newnode),
            annotation=annotation,
            simple=node.simple,
            value=_visit_or_none(node, "value", self, newnode),
        )
        return newnode
525458
function reference(node, index, parent) {
    var definition = definitions(node.identifier)
    var replacement
    var image

    if (definition) {
      image = node.type === 'imageReference'

      replacement = {
        type: image ? 'image' : 'link',
        url: definition.url,
        title: definition.title
      }

      if (image) {
        replacement.alt = node.alt
      } else {
        replacement.children = node.children
      }

      parent.children[index] = replacement
    }
  }
207510
def visit_reference(self, node: docutils.nodes.reference) -> None:
        """"""
        # if len(node.children) != 1 or not isinstance(node.children[0], docutils.nodes.Text) \
        #         or not all(_ in node.attributes for _ in ('name', 'refuri')):
        #     return
        path = pathlib.Path(node.attributes['refuri'])
        try:
            if path.is_absolute():
                return
            resolved_path = path.resolve()
        except FileNotFoundError:  # in resolve(), prior to Python 3.6
            return
        # except OSError:  # in is_absolute() and resolve(), on URLs in Windows
        #     return
        try:
            resolved_path.relative_to(HERE)
        except ValueError:
            return
        if not path.is_file():
            return
        assert node.attributes['name'] == node.children[0].astext()
        self.references.append(node)
68683
def add(self, node):
        """"""
        if not isinstance(node, Node):
            raise TypeError()
        for i, j in enumerate(self.__nodes):
            if j.node_id == node.node_id:
                self.__nodes[i] = node
                return
        self.__nodes.append(node)
1004982
def _make_refnode(self, fromdocname, builder, docname, labelid, sectname,
                      contnode, **kwargs):
        """"""
        nodeclass = kwargs.pop('nodeclass', nodes.reference)
        newnode = nodeclass('', '', internal=True, **kwargs)
        innernode = nodes.emphasis(sectname, sectname)
        if docname == fromdocname:
            newnode['refid'] = labelid
        else:
            # Set more info on contnode. In case the get_relative_uri call
            # raises NoUri, the builder will then have to resolve these.
            contnode = addnodes.pending_xref('')
            contnode['refdocname'] = docname
            contnode['refsectname'] = sectname
            newnode['refuri'] = builder.get_relative_uri(fromdocname, docname)
            if labelid:
                newnode['refuri'] += '#' + labelid
        newnode.append(innernode)
        return newnode
715419
def dnode(self, node):
        """"""
        new_node = copy(node)
        new_node.lineno += self.dline
        new_node.col_offset += self.dcol
        return new_node
1196709
public static Node newUndefinedNode(Node srcReferenceNode) {
    Node node = IR.voidNode(IR.number(0));
    if (srcReferenceNode != null) {
      node.useSourceInfoFromForTree(srcReferenceNode);
    }
    return node;
  }
597628
function handleInsert(node, newNode, refChild){
    return newNode != null
      ? node.insertBefore(isNode(newNode) ? newNode : createText(newNode), refChild || null)
      : null;
  }
1196808
def addReference(self, reference):
        
        id_ = reference.getId()
        self._referenceIdMap[id_] = reference
        self._referenceNameMap[reference.getLocalId()] = reference
        self._referenceIds.append(id_)