Path helper, gives you a path relative to this file
509204
def relpath(path):
    """"""
    return os.path.normpath(
        os.path.join(os.path.abspath(os.path.dirname(__file__)), path)
    )
1155953
function getAbsPath(...relativePathPartsToRoot) {
    const { resolve, join } = path;

    return fs.existsSync(relativePathPartsToRoot[0])
      ? resolve(join(...relativePathPartsToRoot))
      : resolve(join(getRepoRootAbsPath(), ...relativePathPartsToRoot));
  }
1190358
def joinpath(self, *args):
        
        return self.__class__(os.path.join(self, *args))
493964
def resolve_path(path):
    """"""
    if path[0] == '~':
        # ~ or ~user
        path = os.path.expanduser(path)
    if path[0] != '/':
        # Relative path
        if cur_dir[-1] == '/':
            path = cur_dir + path
        else:
            path = cur_dir + '/' + path
    comps = path.split('/')
    new_comps = []
    for comp in comps:
        # We strip out xxx/./xxx and xxx//xxx, except that we want to keep the
        # leading / for absolute paths. This also removes the trailing slash
        # that autocompletion adds to a directory.
        if comp == '.' or (comp == '' and len(new_comps) > 0):
            continue
        if comp == '..':
            if len(new_comps) > 1:
                new_comps.pop()
        else:
            new_comps.append(comp)
    if len(new_comps) == 1 and new_comps[0] == '':
        return '/'
    return '/'.join(new_comps)
1172626
def _GetRelPath(self, filename):
		""""""
		assert filename.startswith(self.subdir), (filename, self.subdir)
		return filename[len(self.subdir):].lstrip(r"\/")
807248
def object_path(self, key):
    ''''''
    return os.path.join(self.root_path, self.relative_object_path(key))
1261954
def relative_to_local_path(path)
      if path && path.length > 0
        case_insensitive_join(local_path, path)
      else
        case_insensitive_resolve(local_path)
      end
    end
398044
function getSourceDestinationPath (srcPath) {
        let dests = _.keys(options.files);
        return _.find(dests, function (destPath) {
            let paths = options.files[destPath];
            return _.find(paths, function (p) {
                return p === srcPath || srcPath.indexOf(p) !== -1;
            });
        });
    }
65321
def get_path(*args, module=a99):
    

    p = os.path.abspath(os.path.join(os.path.split(module.__file__)[0], *args))
    return p
277310
def relative_path(self, absolute_path, output_filename):
        """"""
        absolute_path = posixpath.join(settings.PIPELINE_ROOT, absolute_path)
        output_path = posixpath.join(settings.PIPELINE_ROOT, posixpath.dirname(output_filename))
        return relpath(absolute_path, output_path)
329193
function flattenPath(file, opts) {
  var fileName = path.basename(file.path);
  var dirs;

  if (!opts.includeParents && !opts.subPath) {
    return fileName;
  }

  dirs = path.dirname(file.relative).split(path.sep);
  if (opts.includeParents) {
    dirs = includeParents(dirs, opts.includeParents);
  }
  if (opts.subPath) {
    dirs = subPath(dirs, opts.subPath);
  }

  dirs.push(fileName);
  return path.join.apply(path, dirs);
}
395367
def relative_ref(self, baseURI):
        
        # workaround for posixpath bug in 2.6, doesn't generate correct
        # relative path when *start* (second) parameter is root ('/')
        if baseURI == '/':
            relpath = self[1:]
        else:
            relpath = posixpath.relpath(self, baseURI)
        return relpath
549430
def make_path_relative(path):
    
    if os.path.isabs(path):
        drive_s,path = os.path.splitdrive(path)

        import re
        if not drive_s:
            path=re.compile("/*(.*)").findall(path)[0]
        else:
            path=path[1:]

    assert( not os.path.isabs( path ) ), path
    return path
1034540
def _relative(self, uri):
        

        if uri.startswith("http:") or \
           uri.startswith("https:") or \
           uri.startswith("file:") or \
           uri.startswith("/"):
            return uri

        elif exists(uri):
            return relpath(uri, self.basedir)

        else:
            return uri
801379
def join_path(self, *path):
		
		path = self.directory_sep().join(path)
		return self.normalize_path(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);
    }
  }
}
884851
def path(self):
        
        if self.parent is None:
            return "/"
        else:
            return os.path.join(self.parent.path, self.name)