Return the full path for the notebook, given the base path
770168
def full_path(base, fmt):
    """"""
    ext = fmt['extension']
    suffix = fmt.get('suffix')
    prefix = fmt.get('prefix')

    full = base

    if prefix:
        prefix_dir, prefix_file_name = os.path.split(prefix)
        notebook_dir, notebook_file_name = os.path.split(base)

        # Local path separator (\\ on windows)
        sep = base[len(notebook_dir):-len(notebook_file_name)] or '/'
        prefix_dir = prefix_dir.replace('/', sep)

        if prefix_file_name:
            notebook_file_name = prefix_file_name + notebook_file_name

        if prefix_dir:
            # Do not add a path separator when notebook_dir is '/'
            if notebook_dir and not notebook_dir.endswith(sep):
                notebook_dir = notebook_dir + sep
            notebook_dir = notebook_dir + prefix_dir

        if notebook_dir and not notebook_dir.endswith(sep):
            notebook_dir = notebook_dir + sep

        full = notebook_dir + notebook_file_name

    if suffix:
        full = full + suffix

    return full + ext
673205
private String getBasePath(String path1, String path2) {

        StringBuffer base = new StringBuffer();
        path1 = path1.replace('\\', '/');
        path2 = path2.replace('\\', '/');

        String[] parts1 = path1.split("/");
        String[] parts2 = path2.split("/");

        for (int i = 0; i < parts1.length; i++) {
            if (i >= parts2.length) {
                break;
            }
            if (parts1[i].equals(parts2[i])) {
                base.append(parts1[i] + "/");
            }
        }

        return base.toString();
    }
37598
def fully_expanded_path(self):
        
        return os.path.abspath(
            os.path.normpath(
                os.path.normcase(
                    os.path.expandvars(
                        os.path.expanduser(self.path)))))
623475
def fullPath(self):
        
        for ((dirTree, dirID, dirSeq), (dirPath, name)) in self.links.items():
            try:
                path = self.fileSystem.volumes[dirTree].fullPath
                if path is not None:
                    return path + ("/" if path[-1] != "/" else "") + dirPath + name
            except Exception:
                logging.debug("Haven't imported %d yet", dirTree)

        if self.id == BTRFS_FS_TREE_OBJECTID:
            return "/"
        else:
            return None
408995
def get_base_dir(currfile, dir_level_num=3):
    
    root_path = os.path.abspath(currfile)
    for i in range(0, dir_level_num):
        root_path = os.path.dirname(root_path)

    return root_path
1018045
def path(self, path):
        
        if os.path.isabs(path):
            return path
        return os.path.join(self.location, path)
590511
def BasenamePath(self, path):
    
    if path.endswith(self.PATH_SEPARATOR):
      path = path[:-1]
    _, _, basename = path.rpartition(self.PATH_SEPARATOR)
    return basename
890337
function getorigPath(filePath, base) {
    var extName = path.extname(filePath);
    var pt = path.resolve(base, filePath);
    if (!extName) pt += '.js';
    return pt;
}
1330465
def _relativePath(self, fullPath):
        
        if fullPath is None:
            return None

        assert fullPath.startswith("/"), fullPath

        path = os.path.relpath(fullPath, self.userPath)

        if not path.startswith("../"):
            return path
        elif self.ignoreExtraVolumes:
            return None
        else:
            return fullPath
911782
def grandparent_path(self):
        
        return os.path.basename(os.path.join(self.path, '../..'))
237298
def full_path_str(self):
        ''''''
        with self._mutex:
            if self._parent:
                if self._parent._name == '/':
                    return self._parent.full_path_str + self._name
                else:
                    return self._parent.full_path_str + '/' + self._name
            else:
                return self._name
1163589
def full_path(self):
        """"""

        if self.parent:
            return os.path.join(self.parent.full_path, self.name)
        return self.name
1346551
def fullpath(self):
        
        return str(os.path.join(self.path, self.directory))
1103188
def path(self):
    """"""
    if self._root_dir is None:
      # This env variable is for testing purpose.
      override_buildroot = os.environ.get('PANTS_BUILDROOT_OVERRIDE', None)
      if override_buildroot:
        self._root_dir = override_buildroot
      else:
        self._root_dir = os.path.realpath(self.find_buildroot())
      if PY2:
        self._root_dir = self._root_dir.decode('utf-8')
    return self._root_dir
319157
def full_path(self):
        ''''''
        with self._mutex:
            if self._parent:
                return self._parent.full_path + [self._name]
            else:
                return [self._name]
1135134
def path(self):
        """"""
        if (self.source_file.startswith('a/') and
                self.target_file.startswith('b/')):
            filepath = self.source_file[2:]
        elif (self.source_file.startswith('a/') and
              self.target_file == '/dev/null'):
            filepath = self.source_file[2:]
        elif (self.target_file.startswith('b/') and
              self.source_file == '/dev/null'):
            filepath = self.target_file[2:]
        else:
            filepath = self.source_file
        return filepath
587072
def _get_relative_path(self, full_path):
        """"""
        try:
            rel_path = Path(full_path).relative_to(Path().absolute())
        except ValueError:
            LOG.error("%s: Couldn't find relative path of '%s' from '%s'.",
                      self.name, full_path, Path().absolute())
            return full_path
        return str(rel_path)