Resolve the raw device that contains the path.
175133
def GetRawDevice(path):
  """"""
  device_map = GetMountpoints()

  path = utils.SmartUnicode(path)
  mount_point = path = utils.NormalizePath(path, "/")

  result = rdf_paths.PathSpec(pathtype=rdf_paths.PathSpec.PathType.OS)

  # Assign the most specific mount point to the result
  while mount_point:
    try:
      result.path, fs_type = device_map[mount_point]
      if fs_type in [
          "ext2", "ext3", "ext4", "vfat", "ntfs", "Apple_HFS", "hfs", "msdos"
      ]:
        # These are read filesystems
        result.pathtype = rdf_paths.PathSpec.PathType.OS
      else:
        result.pathtype = rdf_paths.PathSpec.PathType.UNSET

      # Drop the mount point
      path = utils.NormalizePath(path[len(mount_point):])

      return result, path
    except KeyError:
      mount_point = os.path.dirname(mount_point)
1139777
def resolve!(path, **kargs)
      uri, deps = resolve(path, **kargs)

      unless uri
        message = String.new("couldn't find file '#{path}'")

        if relative_path?(path) && kargs[:base_path]
          load_path, _ = paths_split(config[:paths], kargs[:base_path])
          message << " under '#{load_path}'"
        end

        message << " with type '#{kargs[:accept]}'" if kargs[:accept]

        load_paths = kargs[:load_paths] || config[:paths]
        message << "\nChecked in these paths: \n  #{ load_paths.join("\n  ") }"

        raise FileNotFound, message
      end

      return uri, deps
    end
842695
def _is_device(path):
    '''
    
    '''
    out = __salt__['cmd.run_all']('file -i {0}'.format(path))
    _verify_run(out)

    # Always [device, mime, charset]. See (file --help)
    return re.split(r'\s+', out['stdout'])[1][:-1] == 'inode/blockdevice'
118248
def resolve_dep_from_path(self, depname):
        
        if is_system_dep(depname):
            return True

        for d in self._path:
            name = os.path.join(d, depname)
            if os.path.exists(name):
                return True

        return False
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)
431244
def _fix_path(self, path):
        
        if path.endswith('/'):
            path = path.rstrip('/')

        return safe_str(path)
1279798
function (str) {
        if (!str) {
            return str;
        }
        if (str.substr(0,1) === '~') {
            str = process.env.HOME + str.substr(1);
        }
        return path.resolve(str);
    }
27738
def _fixpath(root, base):
    """"""
    return os.path.abspath(os.path.normpath(os.path.join(root, base)))
1299896
def _parse_device_path(self, device_path, char_path_override=None):
        """"""

        # 1. Make sure that we can parse the device path.
        try:
            device_type = device_path.rsplit('-', 1)[1]
        except IndexError:
            warn("The following device path was skipped as it could "
                 "not be parsed: %s" % device_path, RuntimeWarning)
            return

        # 2. Make sure each device is only added once.
        realpath = os.path.realpath(device_path)
        if realpath in self._raw:
            return
        self._raw.append(realpath)

        # 3. All seems good, append the device to the relevant list.
        if device_type == 'kbd':
            self.keyboards.append(Keyboard(self, device_path,
                                           char_path_override))
        elif device_type == 'mouse':
            self.mice.append(Mouse(self, device_path,
                                   char_path_override))
        elif device_type == 'joystick':
            self.gamepads.append(GamePad(self,
                                         device_path,
                                         char_path_override))
        else:
            self.other_devices.append(OtherDevice(self,
                                                  device_path,
                                                  char_path_override))
1312217
@Nullable
  private String parseDriveRoot(String path) {
    Matcher drivePathMatcher = DRIVE_LETTER_ROOT.matcher(path);
    if (drivePathMatcher.find()) {
      return path.substring(drivePathMatcher.start(), drivePathMatcher.end());
    }
    return null;
  }
210139
function resolve (from, to) {

    if (isRemoteFile(from)) {

        if (!/\/$/.test(from)) {
            from += '/';
        }

        return url.resolve(from, to);
    } else if (isRemoteFile(to)) {
        return to;
    } else {
        return path.resolve(from, to);
    }
}
80260
def resolve(path, search_path, absolute=False):
    

    # Resolve external URLs
    if re.match(r'([a-z][a-z0-9+.\-]*:)?//', path, re.I):
        return path

    # Resolve static assets
    if path.startswith('@'):
        return utils.static_url(path[1:], absolute)

    path, sep, anchor = path.partition('#')

    # Resolve entries
    entry = utils.find_entry(path, search_path)
    if entry:
        return entry.permalink(absolute=absolute) + sep + anchor

    # Resolve images and assets
    img_path, img_args, _ = image.parse_image_spec(path)
    img = image.get_image(img_path, search_path)
    if not isinstance(img, image.ImageNotFound):
        path, _ = img.get_rendition(**img_args)
    return path + sep + anchor
437444
def _get_filesystem_path(self, url_path, basedir=settings.MEDIA_ROOT):
        """"""

        if url_path.startswith(settings.MEDIA_URL):
            url_path = url_path[len(settings.MEDIA_URL):]  # strip media root url

        return os.path.normpath(os.path.join(basedir, url2pathname(url_path)))
1170734
def fixpath(path):
    """"""
    norm = osp.normcase if os.name == 'nt' else osp.normpath
    return norm(osp.abspath(osp.realpath(path)))
838666
function resolve() {
    var resolvedPath = '';
    var resolvedAbsolute = false;
    var hasDomain = false;

    for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i -= 1) {
      var p = (i >= 0) ? arguments[i] : !hasDomain ? cwd() : '';

      if (!hasDomain) {
        hasDomain = isDomain(p);
      }

      if (!isString(p)) {
        throw new TypeError('Arguments to path.resolve must be strings');
      } else if (!p) {
        continue;
      }

      resolvedPath = p + '/' + resolvedPath;
      resolvedAbsolute = p[0] === '/';
    }

    resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/');
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  }
570740
function resolve(path, options, callback) {
        resolvePath(path, options, function (err, path) {
            if (err) return callback(err);
            callback(null, { path: path });
        });
    }
674030
def resolve(self):
        ''
        return os.path.expandvars(os.path.expanduser(self.fqpn))