Return an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
1746
def absolute(self):
        
        # XXX untested yet!
        if self.is_absolute():
            return self
        # FIXME this must defer to the specific flavour (and, under Windows,
        # use nt._getfullpathname())
        obj = self._from_parts([os.getcwd()] + self._parts, init=False)
        obj._init(template=self)
        return obj
43455
function(filename){
    // resolve by symlink if possible
    for (var from in this.symlinks)
      if (filename.indexOf(from) === 0 && (filename === from || filename[from.length] === '/'))
        return this.symlinks[from] + filename.substr(from.length);

    return path.resolve(this.fsBaseURI, filename.replace(/^[\\\/]/, ''));
  }
1232727
public static String canonical(File p) {
		try {
			return p.getCanonicalPath();
		} catch (IOException e) {
			String x = p.getAbsolutePath();
			return x == null ? p.getPath() : x;
		}
	}
548932
static String canonicalizePath(String path) {
    String[] parts = path.split(MODULE_SLASH);
    String[] buffer = new String[parts.length];
    int position = 0;
    int available = 0;

    boolean absolutePath = (parts.length > 1 && parts[0].isEmpty());
    if (absolutePath) {
      // If the path starts with "/" (so the left side, index zero, is empty), then the path will
      // always remain absolute. Make the first segment unavailable to touch.
      --available;
    }

    for (String part : parts) {
      if (part.equals(".")) {
        continue;
      }

      if (part.equals("..")) {
        if (available > 0) {
          // Consume the previous segment.
          --position;
          --available;
          buffer[position] = null;
        } else if (!absolutePath) {
          // If this is a relative path, retain "..", as it can't be consumed on the left.
          buffer[position] = part;
          ++position;
        }
        continue;
      }

      buffer[position] = part;
      ++position;
      ++available;
    }

    if (absolutePath && position == 1) {
      return MODULE_SLASH;  // special-case single absolute segment as joining [""] doesn't work
    }
    return MODULE_JOINER.join(Arrays.copyOf(buffer, position));
  }
557891
def get_absolute_path(*args):
    """"""
    directory = os.path.dirname(os.path.abspath(__file__))
    return os.path.join(directory, *args)
515352
def import_path_to_absolute_path(import_path, file_marker):
        '''
        
        '''
        path_fragment = import_path.replace('.', os.path.sep)
        path_suffix = os.path.join(path_fragment, file_marker)
        for path_base in sys.path:
            path = os.path.join(path_base, path_suffix)
            if os.path.exists(path):
                return os.path.join(path_base, path_fragment)
        msg = 'Cannot find import path: %s, %s'
        raise ConfigurationError(msg % (import_path, file_marker))
237321
function setAbsolutePath(file) {
    file.absolutePath = path.resolve(process.cwd(), file.fullPath);
    return file.absolutePath;
  }
414766
def readlink(path, canonicalize=False):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.isabs(path):
        raise SaltInvocationError('Path to link must be absolute.')

    if not os.path.islink(path):
        raise SaltInvocationError('A valid link was not specified.')

    if canonicalize:
        return os.path.realpath(path)
    else:
        return os.readlink(path)
980641
def absolute_path(string):
    ''''''
    if not os.path.isabs(string):
        msg = '{0!r} is not an absolute path'.format(string)
        raise argparse.ArgumentTypeError(msg)
    if not os.path.exists(os.path.dirname(string)):
        msg = 'path {0!r} does not exist'.format(string)
        raise argparse.ArgumentTypeError(msg)
    return string
904592
function normalize(filepath) {

    // resolve to an absolute ppath
    if (!path.isAbsolute || !path.isAbsolute(filepath))
        filepath = path.resolve(path.dirname(module.parent.filename), filepath);

    // tack .json on the end if need be
    if (!/\.json$/.test(filepath))
        filepath = filepath + '.json';

    return filepath;
}
480674
def file_abspath(self, resource):
        """"""
        warnings.warn(
            "file_abspath is deprecated; use resource_path instead",
            DeprecationWarning, stacklevel=2)
        return self.resource_path(resource)
238660
def path(cls, ref):
        
        return osp.join(ref.repo.git_dir, "logs", to_native_path(ref.path))
4815
def get_path_url(path, relative=False):
    
    if relative:
        return os.path.relpath(path)
    else:
        return 'file://%s' % os.path.abspath(path)
758976
@Override
    public Path toAbsolutePath() {

        // Already absolute?
        if (this.isAbsolute()) {
            return this;
        }

        // Else construct a new absolute path and normalize it
        final Path absolutePath = new ShrinkWrapPath(ArchivePath.SEPARATOR + this.path, this.fileSystem);
        final Path normalized = absolutePath.normalize();
        return normalized;
    }
867104
def source_path(self):
        
        # Need to do this to ensure the function produces the
        # bundle path when called from subclasses
        names = [k for k, _, _ in self._name_parts]

        parts = [self.source]

        if self.bspace:
            parts.append(self.bspace)

        parts.append(
            self._path_join(names=names, excludes=['source', 'version', 'bspace'], sep=self.NAME_PART_SEP))

        return os.path.join(*parts)
987590
def path(self):
        

        # Need to do this to ensure the function produces the
        # bundle path when called from subclasses
        names = [k for k, _, _ in Name._name_parts]

        return os.path.join(self.source,
                            self._path_join(names=names, excludes=['source', 'format'], sep=self.NAME_PART_SEP),
                            *self._local_parts()
                            )
1057031
def _resolve_path(self, path):
        
        filepath = None
        mimetype = None

        for root, dirs, files in self.filter_files(self.path):
            # Does it exist in error path?
            error_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'error_templates', path)
            try:
                with open(error_path):
                    mimetype, encoding = mimetypes.guess_type(error_path)
                    filepath = error_path
            except IOError:
                pass

            # Does it exist in Tarbell blueprint?
            if self.base:
                basepath = os.path.join(root, self.blueprint_name, path)
                try:
                    with open(basepath):
                        mimetype, encoding = mimetypes.guess_type(basepath)
                        filepath = basepath
                except IOError:
                    pass

            # Does it exist under regular path?
            fullpath = os.path.join(root, path)
            try:
                with open(fullpath):
                    mimetype, encoding = mimetypes.guess_type(fullpath)
                    filepath = fullpath
            except IOError:
                pass

        return filepath, mimetype