Function: resolve

Returns the cell for the specified cell path using the given root as the
root of the path.

Parameters:

root - Root cell of the path to be resolved.
path - String that defines the path.
344158
function(root, path)
	{
		var parent = root;
		
		if (path != null)
		{
			var tokens = path.split(mxCellPath.PATH_SEPARATOR);
			
			for (var i=0; i<tokens.length; i++)
			{
				parent = parent.getChildAt(parseInt(tokens[i]));
			}
		}
		
		return parent;
	}
1246831
private String getRootPath(String path, int rootLevel, ResourceResolver resourceResolver) {
    String rootPath = Path.getAbsoluteParent(path, rootLevel, resourceResolver);

    // strip off everything after first "." - root path may be passed with selectors/extension which is not relevant
    if (StringUtils.contains(rootPath, ".")) {
      rootPath = StringUtils.substringBefore(rootPath, ".");
    }

    return rootPath;
  }
914868
public static TableCellElement getCell( Element root, int column, int row )
	{
		TableSectionElement tbody = getTBodyElement( root );
		
		TableRowElement tr = tbody.getChild( row ).cast();
		TableCellElement td = tr.getChild( column ).cast();
		
		return td;
	}
806666
function getRootPath (p) {
  p = path.normalize(path.resolve(p)).split(path.sep)
  if (p.length > 0) return p[0]
  return null
}
289228
def resolve_file(fname, paths):
  """"""
  fpath = path.abspath(fname)
  for p in paths:
    spath = path.abspath(p)
    if fpath.startswith(spath):
      return fpath[len(spath) + 1:]
  return fname
1325515
function (rootNode) {
        if (!this._parent) {
            return '/';
        }

        var current = this._parent;
        var path = this.name;
        while (current._parent) {
            path = current.name + '/' + path;
            if (current._parent == rootNode) {
                break;
            }
            current = current._parent;
        }
        if (!current._parent && rootNode) {
            return null;
        }
        return path;
    }
890753
function resolvePathFor(options, src) {
  if (Array.isArray(src)) {
    src.forEach(dir => resolvePathFor(options, dir));
  } else {
    const relativePath = get(options, src);
    if (Array.isArray(relativePath)) {
      set(options, src, relativePath.map(n => getAbsPath(n)));
    } else {
      const _absPath = getAbsPath(relativePath);
      relativePath !== _absPath && set(options, src, _absPath);
    }
  }
}
287824
function resolveInRoot(root) {
    var input, result;
    var args = Array.prototype.slice.call(arguments, 1);

    input = args
        .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);
        }, '');

    result = path.resolve(root, input);

    if (!isInRoot(root, result)) {
        throw new error.FileOutOfScopeError({
            filename: result,
            root: root
        });
    }

    return result;
}
780568
function resolvePath(path, options, callback) {
        if (!callback) {
            callback = options;
            options = {};
        }
        
        var alreadyRooted = options.alreadyRooted;
        var checkSymlinks = options.checkSymlinks === undefined 
            ? true : options.checkSymlinks;
        var isHome        = false;
        
        if (checkSymlinks === undefined)
            checkSymlinks = true;
        if (path.substr(0, 2) == "~/") {
            isHome = true;
            path = process.env.HOME + path.substr(1);
        }
        else if (!alreadyRooted) 
            path = join(root, path);

        if (checkSymlinks && fsOptions.checkSymlinks && !alreadyRooted) 
            fs.realpath(path, check);
        else check(null, path);

        function check(err, path) {
            if (err) return callback(err);
            
            if (!options.nocheck) {
                if (!(path === base || path.substr(0, root.length) === root)
                  && !isHome) {
                    err = new Error("EACCESS: '" + path + "' not in '" + root + "'");
                    err.code = "EACCESS";
                    return callback(err);
                }
            }
            callback(null, path);
        }
    }
131821
def resolve_path(filename: Path) -> typing.Union[Path, None]:
    
    current = Path.cwd()
    # Stop search at home directory
    sentinel_dir = Path.home().parent.resolve()
    while current != sentinel_dir:
        target = Path(current) / Path(filename)
        if target.exists():
            return target.resolve()
        else:
            current = current.parent.resolve()

    return None
56899
function resolveAsync(p, base, root) {
  if (!path.isAbsolute(p)) {
    return new Promise(function(r, j) {
      resolve(forceRelative(p), {
        basedir: path.resolve(root, base)
      }, function(err, res) {
        if (err) {
          j(err);
        } else {
          r(res);
        }
      });
    });

  } else {

    return Promise.resolve(p);
  }
}
759646
public static Node getNode(Object root, String path) {
        return getNode(root, Path.create(path));
    }
1173126
def resolve_path(self, address):
        '''
        
        '''
        match = self.find_one(address)
        if not match:
            return [self]

        # Go further up the tree if possible
        if isinstance(match, ContainerNode):
            return match.resolve_path(address) + [self]

        # This is as far as we go
        return [match, self]
386271
def resolve_path_from_base(path_to_resolve, base_path):
    
    return os.path.abspath(
        os.path.join(
            base_path,
            os.path.expanduser(path_to_resolve)))
629451
function resolve() {
            resolvePath(path, function (err, _resolvedPath) {
                if (err) {
                    if (err.code !== "ENOENT") {
                        return error(err);
                    }
                    // If checkSymlinks is on we'll get an ENOENT when creating a new file.
                    // In that case, just resolve the parent path and go from there.
                    resolvePath(dirname(path), function (err, dir) {
                        if (err) return error(err);
                        resolvedPath = join(dir, basename(path));
                        createTempFile();
                    });
                    return;
                }
                
                resolvedPath = _resolvedPath;
                createTempFile();
            });
        }
550521
function resolvePathname(to) {
  var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

  var toParts = to && to.split('/') || [];
  var fromParts = from && from.split('/') || [];

  var isToAbs = to && isAbsolute(to);
  var isFromAbs = from && isAbsolute(from);
  var mustEndAbs = isToAbs || isFromAbs;

  if (to && isAbsolute(to)) {
    // to is absolute
    fromParts = toParts;
  } else if (toParts.length) {
    // to is relative, drop the filename
    fromParts.pop();
    fromParts = fromParts.concat(toParts);
  }

  if (!fromParts.length) { return '/'; }

  var hasTrailingSlash = void 0;
  if (fromParts.length) {
    var last = fromParts[fromParts.length - 1];
    hasTrailingSlash = last === '.' || last === '..' || last === '';
  } else {
    hasTrailingSlash = false;
  }

  var up = 0;
  for (var i = fromParts.length; i >= 0; i--) {
    var part = fromParts[i];

    if (part === '.') {
      spliceOne(fromParts, i);
    } else if (part === '..') {
      spliceOne(fromParts, i);
      up++;
    } else if (up) {
      spliceOne(fromParts, i);
      up--;
    }
  }

  if (!mustEndAbs) { for (; up--; up) {
    fromParts.unshift('..');
  } }if (mustEndAbs && fromParts[0] !== '' && (!fromParts[0] || !isAbsolute(fromParts[0]))) { fromParts.unshift(''); }

  var result = fromParts.join('/');

  if (hasTrailingSlash && result.substr(-1) !== '/') { result += '/'; }

  return result;
}
580861
function() {
      var path = this.decodeFragment(
        this.location.pathname + this.getSearch()
      ).slice(this.root.length - 1);
      return path.charAt(0) === '/' ? path.slice(1) : path;
    }