Resolves a sub-hierarchy of the index via a given path --------
342613
function(path) {
    var index = this;
    if (path !== null) {
      for (var i = 0; i < path.length; i++) {
        var id = path[i];
        index.scopes[id] = index.scopes[id] || { nodes: {}, scopes: {} };
        index = index.scopes[id];
      }
    }
    return index;
  }
1217926
function resolve (cid, path, callback) {
    let value, remainderPath
    doUntil(
      (cb) => {
        self.block.get(cid, (err, block) => {
          if (err) return cb(err)

          const r = self._ipld.resolvers[cid.codec]

          if (!r) {
            return cb(new Error(`No resolver found for codec "${cid.codec}"`))
          }

          r.resolver.resolve(block.data, path, (err, result) => {
            if (err) return cb(err)
            value = result.value
            remainderPath = result.remainderPath
            cb()
          })
        })
      },
      () => {
        if (value && value['/']) {
          // If we've hit a CID, replace the current CID.
          cid = new CID(value['/'])
          path = remainderPath
        } else if (CID.isCID(value)) {
          // If we've hit a CID, replace the current CID.
          cid = value
          path = remainderPath
        } else {
          // We've hit a value. Return the current CID and the remaining path.
          return true
        }

        // Continue resolving unless the path is empty.
        return !path || path === '/'
      },
      (err) => {
        if (err) return callback(err)
        callback(null, { cid, remainderPath: path })
      }
    )
  }
1103365
function _normalizePath(path, parent, ancestors) {
    if (path === '/') {
        return path;
    }

    path = path.replace(/\/$/, '');

    // If path begins with / then assume it is independent route
    if (path[0] === '/') {
        return path;
    }

    // If no parent, and route doesn't start with /, then prepend /
    if (! parent) {
        return `/${path}`;
    }

    if (ancestors) {
        return _cleanPath(`${ancestors.join('/')}/${path}`);
    }

    return _cleanPath(`${parent.path}/${path}`);
}
224628
function (subpath, f) {
    var args = Util.resolveArgs(arguments, '?subpath', 'f');
    update(this, args.subpath, args.f);
    return this;
  }
581166
function resolveNodeSkel(index, nodeName) {
    var idx = +graph.nameToIndex[nodeName];
    argh = [idx, +index]
    if(Number.isNaN(idx)) {
      throw "Unable to get index for node '" + nodeName + "'. (Is the node name misspelled?)";
    }
    if(index !== undefined && idx > +index) {
      throw "Unable to get index for node '" + nodeName + "'. (Are the nodes out of order?)";
    }
    if(index !== undefined && idx == +index) {
      throw "Unable to get index for node '" + nodeName + "'. (Is the node trying to reference itself?)";
    }
    return (dataContext) => dataContext.values[idx];
  }
571523
def existing_sub_paths(self, sub_paths):
        """"""
        paths_to_subs = [self / _ for _ in sub_paths]
        return [_ for _ in paths_to_subs if _.exists()]
510196
public static String getParentPath(String path) {
        if (path == null) return null;
        path = path.trim();
        if (path.endsWith(PATH_ROOT) && path.length() > 1) {
            path = path.substring(0, path.length() - 1);
        }
        int lastIndex = path.lastIndexOf(PATH_ROOT);
        if (path.length() > 1 && lastIndex > 0) {
            return path.substring(0, lastIndex);
        }
        return PATH_ROOT;
    }
397674
def _get_path(cls, path, depth, newstep):
        
        parentpath = cls._get_basepath(path, depth - 1)
        key = cls._int2str(newstep)
        return '{0}{1}{2}'.format(
            parentpath,
            cls.alphabet[0] * (cls.steplen - len(key)),
            key
        )
735374
function resolve() {
	var parts,
		flg,
		len,
		str,
		i;

	// CASE 1: this module is loaded from a global path...
	len = gpaths.length;
	for ( i = 0; i < len; i++ ) {
		str = dir.substring( 0, gpaths[ i ].length );
		if ( str === gpaths[ i ] ) {
			// We are loaded from a global path. Resort to finding the nearest `package.json` walking up from the current working directory...
			str = pkgdir();
			if ( str ) {
				return str;
			}
			flg = true;
		}
	}
	// CASE 2: this module is a local module dependency; in which case, split on `node_modules`...
	parts = dir.split( path.sep+'node_modules' );
	if ( parts.length > 1 ) {
		// We are a nested module. Assume that the top-level node module directory is the application root...
		return parts[ 0 ];
	}
	// CASE 3: possibly a git submodule, copy and paste, or some other dependency pattern; in which case, find the nearest `package.json` walking up from the current working directory...
	if ( !flg ) {
		str = pkgdir();
		if ( str ) {
			return str;
		}
	}
	// CASE 4: nothing worked. Just use the main module...
	return path.dirname( require.main.filename );
}
116555
function (subpath) {
    var subpathAsArray = asArrayPath(subpath);
    if (!Util.undefinedOrNull(this.get(subpathAsArray))) {
      update(this, subpathAsArray, clear);
    }
    return this;
  }
1084318
public static String relativizePath(String path, boolean withIndex)
   {

      if (path.startsWith("/"))
         path = path.substring(1);
      if (!withIndex && path.endsWith("]"))
      {
         int index = path.lastIndexOf('[');
         return index == -1 ? path : path.substring(0, index);
      }
      return path;
   }
1024943
def resolve(context, path)
      context.resolve(path, content_type: 'text/css')
    rescue ::Sprockets::FileNotFound
      begin
        context.resolve(path + '/index', content_type: 'text/css')
      rescue
        nil
      end
    end
104555
function relative(aRoot, aPath) {
    if (aRoot === "") {
      aRoot = ".";
    }

    aRoot = aRoot.replace(/\/$/, '');

    // It is possible for the path to be above the root. In this case, simply
    // checking whether the root is a prefix of the path won't work. Instead, we
    // need to remove components from the root one by one, until either we find
    // a prefix that fits, or we run out of components to remove.
    var level = 0;
    while (aPath.indexOf(aRoot + '/') !== 0) {
      var index = aRoot.lastIndexOf("/");
      if (index < 0) {
        return aPath;
      }

      // If the only part of the root that is left is the scheme (i.e. http://,
      // file:///, etc.), one or more slashes (/), or simply nothing at all, we
      // have exhausted all components, so the path is not relative to the root.
      aRoot = aRoot.slice(0, index);
      if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
        return aPath;
      }

      ++level;
    }

    // Make sure we add a "../" for each component we removed from the root.
    return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
  }
672096
def parent_child_paths(path, some_path):
        
        return PathFilterUtil.is_child(path, some_path) or PathFilterUtil.is_child(some_path, path)
574795
def path_upper(
        cls, object_id, limit_depth=1000000, db_session=None, *args, **kwargs
    ):
        
        tablename = cls.model.__table__.name
        raw_q = """
            WITH RECURSIVE subtree AS (
                    SELECT res.*, 1 as depth FROM {tablename} res
                    WHERE res.resource_id = :resource_id
                  UNION ALL
                    SELECT res_u.*, depth+1 as depth
                    FROM {tablename} res_u, subtree st
                    WHERE res_u.resource_id = st.parent_id
            )
            SELECT * FROM subtree WHERE depth<=:depth;
        """.format(
            tablename=tablename
        )
        db_session = get_db_session(db_session)
        q = (
            db_session.query(cls.model)
            .from_statement(sa.text(raw_q))
            .params(resource_id=object_id, depth=limit_depth)
        )
        return q
398983
def relpath(path, start):
    
    path_items = path_list(path)
    start_items = path_list(start)

    # Find common parts of path.
    common = []
    for pth, stt in zip(path_items, start_items):
        if pth != stt:
            break
        common.append(pth)

    # Shared parts index in both lists.
    common_ind = len(common)
    parent_num = len(start_items) - common_ind

    # Start with parent traversal and add relative parts.
    rel_items = [PARENT] * parent_num + path_items[common_ind:]
    return path_join(*rel_items)
1325477
function resolveInRoot(root) {
    var input, result, err;

    input = _.chain(arguments)
        .toArray()
        .slice(1)
        .reduce(function(current, p) {
            // Handle path relative to book root ("/README.md")
            if (p[0] == "/" || p[0] == "\\") return p.slice(1);

            return current? path.join(current, p) : path.normalize(p);
        }, "")
        .value();

    result = path.resolve(root, input);

    if (!isInRoot(root, result)) {
        err = new Error("EACCESS: \"" + result + "\" not in \"" + root + "\"");
        err.code = "EACCESS";
        throw err;
    }

    return result;
}