Gets a localized URIReference based on the given Node.
966613
private URIReference getLocalizedResource(Node n)
            throws GraphElementFactoryException {
        if (n instanceof URIReference) {
            URIReference u = (URIReference) n;
            return _connector.getElementFactory().createResource(u.getURI());
        } else {
            throw new RuntimeException("Error localizing triple; "
                    + n.getClass().getName() + " is not a URIReference");
        }
    }
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)
333914
public CmsInheritanceReference getReference(Locale locale) {

        CmsInheritanceReference ref = m_references.get(locale);
        if (ref == null) {
            ref = m_references.get(Locale.ENGLISH);
        }
        return ref;
    }
536303
public String getReferencedHost() throws URIException {
        String referencedHost = this.getHost();
        if(referencedHost==null && this.getScheme().equals("dns")) {
            // extract target domain of DNS lookup
            String possibleHost = this.getCurrentHierPath();
            if(possibleHost != null && possibleHost.matches("[-_\\w\\.:]+")) {
                referencedHost = possibleHost;
            }
        }
        return referencedHost;
    }
605970
function getContentFromNode(options, node) {
	return new Promise(function (resolve, reject) {
		if (node.tag === 'link') {
			return fs.readFile(normalizePath(node.attrs.href, options.root, options.from), 'utf8', function (err, res) {
				return err ? reject(err) : resolve(res);
			});
		}

		return resolve(node.content);
	});
}
1367219
public Element getLocaleNode(Locale locale) throws CmsRuntimeException {

        String localeStr = locale.toString();
        Iterator<Element> i = CmsXmlGenericWrapper.elementIterator(m_document.getRootElement());
        while (i.hasNext()) {
            Element element = i.next();
            if (localeStr.equals(element.attributeValue(CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_LANGUAGE))) {
                // language element found, return it
                return element;
            }
        }
        // language element was not found
        throw new CmsRuntimeException(Messages.get().container(Messages.ERR_XMLCONTENT_MISSING_LOCALE_1, locale));
    }
981056
private static String resolveURI(final URL baseURI, final Parent parent, String url) {
        url = url.equals(".") || url.equals("./") ? "" : url;
        if (isRelativeURI(url) && parent != null && parent instanceof Element) {
            final Attribute baseAtt = ((Element) parent).getAttribute("base", Namespace.XML_NAMESPACE);
            String xmlBase = baseAtt == null ? "" : baseAtt.getValue();
            if (!isRelativeURI(xmlBase) && !xmlBase.endsWith("/")) {
                xmlBase = xmlBase.substring(0, xmlBase.lastIndexOf("/") + 1);
            }
            return resolveURI(baseURI, parent.getParent(), xmlBase + url);
        } else if (isRelativeURI(url) && parent == null) {
            return baseURI + url;
        } else if (baseURI != null && url.startsWith("/")) {
            String hostURI = baseURI.getProtocol() + "://" + baseURI.getHost();
            if (baseURI.getPort() != baseURI.getDefaultPort()) {
                hostURI = hostURI + ":" + baseURI.getPort();
            }
            return hostURI + url;
        }
        return url;
    }
955336
function getLocatedNode(parent, data, pos) {
        if (data.startRepeat) {
            var ret = data.startRepeat,
                    end = data.endRepeat
            pos += 1
            for (var i = 0; i < pos; i++) {
                ret = ret.nextSibling
                if (ret == end)
                    return end
            }
            return ret
        } else {
            return parent.childNodes[data.group * pos] || null
        }
    }
976558
def visit(self, node):
        
        if isinstance(node, Placeholder):
            return self.placeholders[node.id]
        else:
            return super(PlaceholderReplace, self).visit(node)
833101
def reference(node):
    
    o = nodes.reference()
    o['refuri'] = node.destination
    if node.title:
        o['name'] = node.title
    for n in MarkDown(node):
        o += n
    return o
1107164
function findReference(scope, node) {
    const references = scope.references.filter(reference => reference.identifier.range[0] === node.range[0] &&
            reference.identifier.range[1] === node.range[1]);

    if (references.length === 1) {
        return references[0];
    }
    return null;
}
905405
function getOrigin(loc) {
                var a;
                if (loc.protocol !== undefined) {
                    a = loc;
                } else {
                    a = document.createElement("a");
                    a.href = loc;
                }
                return a.protocol.replace(/:/g, "") + a.host;
            }
763206
function getCommentLocatuons(node) {
            const contentStartIndex = node.commentOpen.range[1]
            const contentEndIndex = node.commentClose.range[0]
            const contentText = sourceCode.text.slice(
                contentStartIndex,
                contentEndIndex
            )
            const contentFirstIndex = (() => {
                const index = contentText.search(/\S/u)
                if (index >= 0) {
                    return index + contentStartIndex
                }
                return contentEndIndex
            })()
            const contentLastIndex = (() => {
                const index = contentText.search(/\S\s*$/gu)
                if (index >= 0) {
                    return index + contentStartIndex + 1
                }
                return contentStartIndex
            })()

            return {
                first: {
                    index: contentFirstIndex,
                    loc: sourceCode.getLocFromIndex(contentFirstIndex),
                },
                last: {
                    index: contentLastIndex,
                    loc: sourceCode.getLocFromIndex(contentLastIndex),
                },
            }
        }
1037459
def parseURIReference(self, str):
        
        ret = libxml2mod.xmlParseURIReference(self._o, str)
        return ret
1005063
function getUrange() {
  const startPos = pos;
  const type = NodeType.UrangeType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  let content = [];

  content = joinValues(startPos, tokens[startPos].urangeEnd);
  pos = tokens[startPos].urangeEnd + 1;

  return newNode(type, content, line, column);
}
1176315
function getLastLocationInTag(node) {
            const tagClose = node.tagClose
            const text = sourceCode.text.slice(node.range[0], tagClose.range[0])
            const index = text.search(/\S\s*$/gu) + node.range[0] + 1
            return {
                index,
                loc: sourceCode.getLocFromIndex(index),
            }
        }
717510
public String getURIReference() throws URIException {
        char[] uriReference = getRawURIReference();
        return (uriReference == null) ? null : decode(uriReference,
                getProtocolCharset());
    }