Convienence method to get the local path if we are doing
189941
public static function route_get_local_path($dir) {
        $uri = $_SERVER['REQUEST_URI'];     // /tsugi/lti/some/cool/stuff
        $root = $_SERVER['DOCUMENT_ROOT'];  // /Applications/MAMP/htdocs
        $cwd = $dir;                        // /Applications/MAMP/htdocs/tsugi/lti
        if ( strlen($cwd) < strlen($root) + 1 ) return false;
        $lwd = substr($cwd,strlen($root));  // /tsugi/lti
        if ( strlen($uri) < strlen($lwd) + 2 ) return false;
        $local = substr($uri,strlen($lwd)+1); // some/cool/stuff
        return $local;
    }
115268
def get_scope_path(cls, scope_separator="::"):
        
        if cls.get_parent_scope() is None:
            return ""
        elif isinstance(cls.get_parent_scope(), comp.Root):
            return ""
        else:
            parent_path = cls.get_parent_scope().get_scope_path(scope_separator)
            if parent_path:
                return(
                    parent_path
                    + scope_separator
                    + cls.get_parent_scope().type_name
                )
            else:
                return cls.get_parent_scope().type_name
884851
def path(self):
        
        if self.parent is None:
            return "/"
        else:
            return os.path.join(self.parent.path, self.name)
620599
def in_system_path(filename):
    
    fn = sdk_normalize(os.path.realpath(filename))
    if fn.startswith('/usr/local/'):
        return False
    elif fn.startswith('/System/') or fn.startswith('/usr/'):
        return True
    else:
        return False
364256
def _get_path(self, n):
        
        d = self.local_dirs[n % len(self.local_dirs)]
        if not os.path.exists(d):
            os.makedirs(d)
        return os.path.join(d, str(n))
804647
function (pathString, currentContext, debug) {
    try {
      var result = eval('currentContext.' + pathString);
      if (debug) {
        console.log("getPath result = ", result);
      }
      return result;
    } catch (e) {
      return null;
    }
  }
741342
def __get_path(path):
    """"""
    if not os.path.isabs(path):
        path = os.path.join(os.getcwd(), path)

    return os.path.normpath(path)
557456
function getPath(oBindingOrContext) {
			return oBindingOrContext instanceof Context
				? oBindingOrContext.getPath()
				: oBindingOrContext.getModel().resolve(
					oBindingOrContext.getPath(), oBindingOrContext.getContext());
		}
1193383
def path_for(self, *args):
        """"""
        if args and args[0].startswith(os.path.sep):
            return os.path.join(*args)
        return os.path.join(self._root_path or os.getcwd(), *args)
212441
def find_path_package(thepath):
    
    pname = find_path_package_name(thepath)
    if not pname:
        return None
    fromlist = b'' if six.PY2 else ''
    return __import__(pname, globals(), locals(), [fromlist])
457205
def cache_local_file(path):
    '''
    
    '''
    if not os.path.exists(path):
        return ''

    path_cached = is_cached(path)

    # If the file has already been cached, return the path
    if path_cached:
        path_hash = hash_file(path)
        path_cached_hash = hash_file(path_cached)

        if path_hash['hsum'] == path_cached_hash['hsum']:
            return path_cached

    # The file hasn't been cached or has changed; cache it
    return _client().cache_local_file(path)
220617
private static String getRelativePath(File file, FilesystemIterator iterator) throws IOException {
		String path = file.getPath();
		String prefix = iterator.getStartPath();
		if(!path.startsWith(prefix)) throw new IOException("path doesn't start with prefix: path=\""+path+"\", prefix=\""+prefix+"\"");
		return path.substring(prefix.length());
	}
620799
function getPath(parent, unresolved) {
	let parentVisited = false;

	return Object.keys(unresolved).filter((module) => {
		if (module === parent) {
			parentVisited = true;
		}
		return parentVisited && unresolved[module];
	});
}
319157
def full_path(self):
        ''''''
        with self._mutex:
            if self._parent:
                return self._parent.full_path + [self._name]
            else:
                return [self._name]
1214364
def find_by_localpath(self, path):
        
        # note that the paths in self.jsondata were already _homepath2real()'d
        # in the class' __init__()
        resolved = _homepath2real(path)
        for row in self.jsondata:
            if resolved == os.path.realpath(row["localpath"]):
                return self._infofromdict(row)
544836
def get_local(self, name, recurse=True):
        
        self._dlog("getting local '{}'".format(name))
        return self._search("vars", name, recurse)
364664
function() {
      var path = this.decodeFragment(this.location.pathname);
      var rootPath = path.slice(0, this.root.length - 1) + '/';
      return rootPath === this.root;
    }