Return the full ZNode path for a ZNode corresponding to a specific
to a specific ledger's metadata.
@param e Metadata object that we want to get the full path for
@return Full path to the ledger's child ZNode
489594
public String fullyQualifiedPathForLedger(EditLogLedgerMetadata e) {
    String nameForLedger = nameForLedger(e);
    return fullyQualifiedPathForLedger(nameForLedger);
  }
1197383
@Override
    public Path getParent() {
        final List<String> tokens = tokenize(this);
        // No parent?
        final int numTokens = tokens.size();
        if (numTokens == 0 || (numTokens == 1 && !this.isAbsolute())) {
            return null;
        }

        // Iterate over all but the last token and build a new path
        final StringBuffer sb = new StringBuffer();
        if (this.isAbsolute()) {
            sb.append(ArchivePath.SEPARATOR);
        }
        for (int i = 0; i < numTokens - 1; i++) {
            if (i >= 1) {
                sb.append(ArchivePath.SEPARATOR);
            }
            sb.append(tokens.get(i));
        }

        final String parentPath = sb.toString();
        return new ShrinkWrapPath(parentPath, fileSystem);
    }
96857
def _get_zk_path_children(self, zk_conn, zk_path, name_for_error):
        """"""
        children = []
        try:
            children = zk_conn.get_children(zk_path)
        except NoNodeError:
            self.log.info('No zookeeper node at %s', zk_path)
        except Exception:
            self.log.exception('Could not read %s from %s', name_for_error, zk_path)
        return children
523264
public static boolean isServiceNode(ChildData zNode) {
        String path = zNode.getPath();
        LOG.debug("正在检查节点路径:   " + path);
        LOG.debug("服务注册路径：   " + getNodeBasePath());
        if (!path.startsWith(getNodeBasePath()) || path.equals(getNodeBasePath())) {
            return false;
        }
        String name = path.substring((getNodeBasePath() + "/").length());
        String[] names = name.split("/");
        if (names.length != 2) {
            return false;
        }
        /*if (!SystemEnum.isServiceNodeName(names[0])) {
            todo 由于去掉了systemEnum类，我们在watch到zk外部服务注册事件之前，根本不知道到底有哪些application
            return false;
        }*/
        String zNodeDataStr = new String(zNode.getData());
        JSONObject zNodeData;
        try {
            zNodeData = JSON.parseObject(zNodeDataStr);
        } catch (JSONException notJsonString) {
            LOG.debug(String.format("节点%s的data是%s，它不是我们要找的那个服务节点，排除掉！  这是我期待结果之一，不打印堆栈", path, zNodeDataStr));
            return false;
        }
        try {
            if (zNodeData.getJSONObject("payload") == null) {
                LOG.debug(String.format("节点=%s，内容=%s，其内缺少payload属性，它不是我们预期的服务节点！", path, zNodeDataStr));
                return false;
            }
        } catch (JSONException payloadIsNotJsonString) {
            LOG.info(String.format("节点%s的data=%s,其内的payload属性是不是json格式，肯定是有非预期的节点混入，这里排除之", path, zNodeDataStr));
            return false;
        }
        return true;
    }
208173
protected String getNodeContent(Element e, String key) {
       NodeList nodes = e.getElementsByTagName(key);
       String result = null;
       if (nodes != null && nodes.getLength() > 0) {
           result = getNodeTextValue(nodes.item(0));
       }
       return (result == null || result.length() == 0)? null: result;
   }
1260781
public JCTree getTree(Element e) {
        Pair<JCTree, ?> treeTop = getTreeAndTopLevel(e);
        return (treeTop != null) ? treeTop.fst : null;
    }
278861
@JsonProperty("e")
    @JsonSerialize(using = Base64UrlJsonSerializer.class)
    @JsonDeserialize(using = Base64UrlJsonDeserializer.class)
    public byte[] e() {
        return ByteExtensions.clone(this.e);
    }
340333
public static Node getNode(Object root, Path path) {
         return path.getNode(convertToJson(root, "actual"));
     }
557452
def full_path(self):
        
        if "local" in self.driver.name.lower():
            return "%s/%s" % self.container.key, self.path
        return self.path
1296500
public ITreeData getNode() {
        if (lastPointer.get(mRTX) != null && lastPointer.get(mRTX) < 0) {
            return atomics.get(mRTX).getItem(lastPointer.get(mRTX));
        } else {
            return mRTX.getNode();
        }
    }
782799
def collect_metadata_file(full_path):
    
    fne = os.path.basename(full_path)
    fn = os.path.splitext(fne)[0]
    obj = {"full_path": full_path, "filename_ext": fne, "filename_no_ext": fn, "dir": os.path.dirname(full_path)}
    return obj
1045774
String getPackagePath(TypeElement te) {
		return te.getQualifiedName().toString().replaceAll("." + te.getSimpleName(), "");
	}
308353
static String getFullPathName(INode inode) throws IOException {
    INode[] inodes = getINodeArray(inode);
    return getFullPathName(inodes, inodes.length-1);
  }
1148694
public <T> T getNodeMetaData(Object key) {
        if (metaDataMap == null) {
            return (T) null;
        }
        return (T) metaDataMap.get(key);
    }
140
final public String getFullName(final String parent) {
    if (isEmptyLocalName()) {
      return parent;
    }
    
    StringBuilder fullName = new StringBuilder(parent);
    if (!parent.endsWith(Path.SEPARATOR)) {
      fullName.append(Path.SEPARATOR);
    }
    fullName.append(getLocalName());
    return fullName.toString();
  }
1372969
public String getFullPath()
  {
    if (_root == this || _root == null)
      return getPath();

    String rootPath = _root.getFullPath();
    String path = getPath();

    if (rootPath.length() <= 1)
      return path;
    else if (path.length() <= 1)
      return rootPath;
    else
      return rootPath + path;
  }
368943
function getNodesMetaData(rootEl) {
    let elMeta = [];

    let toVisit = [rootEl];
    let current = {el: rootEl, path: [], isPre: $.tag(rootEl) === 'PRE'};

    //generate paths for comment and text nodes. There's no way to quickly retrieve them
    //need to deeply traverse the DOM tree
    while (current) {
        let {el, isPre, path} = current;
        let childNodes = $.childNodes(el);

        for (let i = 0; i < childNodes.length; i++) {
            let childNode = childNodes[i];

            if ($.isText(childNode)) {
                let {meta, delta} = getTextMetaData(rootEl, i, childNode, path, !isPre);
                elMeta.push(...meta);
                i += delta;
            } else if ($.isElement(childNode)) {
                let name = $.getAttr(childNode, ATTR);
                if (name && $.tag(childNode) === 'SCRIPT') {
                    let {meta, delta} = getContainerMetaData(rootEl, i, childNode, path, name);
                    elMeta.push(...meta);
                    i += delta;
                } else {
                    toVisit.push({
                        el: childNode,
                        path: path.concat(i),
                        isPre: current.isPre || $.tag(childNode) === 'PRE'
                    });
                }
            }
        }

        toVisit.shift();
        current = toVisit[0];
    }

    let elementMeta = getElementsMetaData(rootEl);
    elMeta.push(...elementMeta);

    //we need to sort the elements in order of their depth, so that they can be updated
    //from bottom up when ultimately passed to a component.
    return elMeta.sort((a, b) => b.depth - a.depth);
}