Returns the installation root. If it wasn't detected, use current directory.
161679
public static String getInstallRoot() {
        return AccessController.doPrivileged(new PrivilegedAction<String>() {
            @Override
            public String run() {
                String output = System.getProperty("wlp.install.dir");
                if (output == null) {
                    output = System.getenv("WLP_INSTALL_DIR");
                }
                if (output == null) {
                    // if neither of these is set. use the location where the class is loaded.
                    URL url = CLASS_NAME.getProtectionDomain().getCodeSource().getLocation();
                    try {
                        output = new File(url.toString().substring("file:".length())).getParentFile().getParentFile().getCanonicalPath();
                    } catch (IOException e) {
                        // this condition should not happen, but if that's the case, use current directory.
                        output = ".";
                        if (logger.isLoggable(Level.FINE)) {
                            logger.fine("The install root was not detected. " + e.getMessage());
                        }
                    }
                }
                if (logger.isLoggable(Level.FINE)) {
                    logger.fine("The install root is " + output);
                }
                return output;
            }
        });
    }
662564
def getRoot():
    """"""
    root = settings.MEDIA_ROOT.replace('\\', '/')
    if not root.endswith('/'):
        root += '/'

    return path.Path(root)
406292
def get_directory_relative_to_git_root(directory: str):
    
    return os.path.relpath(os.path.realpath(directory), get_git_root_directory(directory))
915378
def root(self):
        
        node = self
        while node.package is not None:
            node = node.package
        return node
466885
def get_user_root_directory():
    
    uname = platform.system()
    if uname == 'Windows':
        root = os.path.join(os.environ['APPDATA'], APP_NAME)
        root = os.path.abspath(root)
    elif uname == 'Linux':
        if os.path.exists(os.path.expanduser('~/.config')):
            root = os.path.join(os.path.expanduser('~/.config'), APP_NAME)
        else:
            root = os.path.join(os.path.expanduser('~'), '.%s' % APP_NAME)
        root = os.path.abspath(root)
    elif uname in ('Linux', 'Darwin'):
        root = os.path.join(os.path.expanduser('~'), '.%s' % APP_NAME)
        root = os.path.abspath(root)
    else:
        root = os.path.join(os.path.expanduser('~'), APP_NAME)
        root = os.path.abspath(root)
    return root
1110712
def get_root_path():
    """"""
    root_path = __file__
    return os.path.dirname(os.path.realpath(root_path))
960705
def base_dir(self):
        """"""
        if self.root_dir:
            return op.join(self.root_dir, self.id)
        else:
            return None
358390
def root (path, root):
    
    if os.path.isabs (path):
        return path
    else:
        return os.path.join (root, path)
706616
def get_root_resource(config):
    """"""
    app_package_name = get_app_package_name(config)
    return config.registry._root_resources.setdefault(
        app_package_name, Resource(config))
912438
def get_root( self, key ):
        """"""
        if key not in self.roots:
            root,self.rows = load( self.filename, include_interpreter = self.include_interpreter )
            self.roots[key] = root
        return self.roots[key]
14458
def getInstalled():
    
    installed = _find_installed()
    return [os.path.basename(p.pathname)[3:] for p in installed]
510067
def _get_parent(self):
        """"""
        _dir = os.path.dirname(self.path)
        if is_repo(_dir):
            return Local(_dir)
        else:
            return None
713878
def get_base_dir():
    
    return os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]
1180828
public function getRootPath()
    {
        if (null === $this->rootPath) {
            if (method_exists($this, 'setRootPath')) {
                $this->rootPath = realpath($this->setRootPath());
            } else {
                $this->rootPath = realpath(__DIR__.'/../../../../..');
            }
        }
        //$this->rootPath = '../';

        return $this->rootPath;
    }
718544
def search_app_root():
        
        while True:

            current = os.getcwd()

            if pathlib.Path("apps.py").is_file():
                return current
            elif pathlib.Path.cwd() == "/":
                raise FileNotFoundError
            else:
                os.chdir("../")
405332
def get_root(w):
    
    next_level = w
    while next_level.master:
        next_level = next_level.master
    return next_level
442334
def get_root():
    
    root = os.path.realpath(os.path.abspath(os.getcwd()))
    setup_py = os.path.join(root, "setup.py")
    versioneer_py = os.path.join(root, "versioneer.py")
    if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)):
        # allow 'python path/to/setup.py COMMAND'
        root = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))
        setup_py = os.path.join(root, "setup.py")
        versioneer_py = os.path.join(root, "versioneer.py")
    if not (os.path.exists(setup_py) or os.path.exists(versioneer_py)):
        err = ("Versioneer was unable to run the project root directory. "
               "Versioneer requires setup.py to be executed from "
               "its immediate directory (like 'python setup.py COMMAND'), "
               "or in a way that lets it use sys.argv[0] to find the root "
               "(like 'python path/to/setup.py COMMAND').")
        raise VersioneerBadRootError(err)
    try:
        # Certain runtime workflows (setup.py install/develop in a setuptools
        # tree) execute all dependencies in a single python process, so
        # "versioneer" may be imported multiple times, and python's shared
        # module-import table will cache the first one. So we can't use
        # os.path.dirname(__file__), as that will find whichever
        # versioneer.py was first imported, even in later projects.
        me = os.path.realpath(os.path.abspath(__file__))
        if os.path.splitext(me)[0] != os.path.splitext(versioneer_py)[0]:
            print("Warning: build in %s is using versioneer.py from %s"
                  % (os.path.dirname(me), versioneer_py))
    except NameError:
        pass
    return root