Normalize a path.

    Expands ~'s, resolves relative paths, normalizes and returns
    an absolute path.
18405
def normpath(path):
    
    return os.path.abspath(os.path.normpath(os.path.expanduser(path)))
346915
function expandPath(p) {
  if(p[0] === '~') {
    p = getUserHome() + p.slice(1);
  }
  return path.normalize(p);
}
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;
}
1032592
def normalize_path(path):
    # type: (AnyStr) -> AnyStr
    

    return os.path.normpath(
        os.path.normcase(
            os.path.abspath(os.path.expandvars(os.path.expanduser(str(path))))
        )
    )
1051393
function normalizePath(dir) {
  if(dir && dir[dir.length - 1] != path.sep) {
    dir += path.sep;
  }
  return dir;
}
67629
def expand_path(*paths):
    """"""
    return os.path.join(
        os.path.dirname(os.path.realpath(sys.argv[0])), *paths)
1291682
function normalizePaths(opts) {
  for (var srcKey in opts.src) {
    if (!path.isAbsolute(opts.src[srcKey].glob)) {
      opts.src[srcKey].glob = path.resolve(opts.src[srcKey].glob);
    }
    if (!path.isAbsolute(opts.src[srcKey].basedir)) {
      opts.src[srcKey].basedir = path.resolve(opts.src[srcKey].basedir);
    }
  }
}
386271
def resolve_path_from_base(path_to_resolve, base_path):
    
    return os.path.abspath(
        os.path.join(
            base_path,
            os.path.expanduser(path_to_resolve)))
786296
private static String normalizePath(String absPath)
   {
      if (absPath.endsWith("/"))
      {
         return absPath.substring(0, absPath.length() - 1);
      }

      return absPath;
   }
435346
def _NormalizePath(path):
  """"""
  # TODO(emrekultursay): Calling os.path.normpath "may change the meaning of a
  # path that contains symbolic links" (e.g., "A/foo/../B" != "A/B" if foo is a
  # symlink). This might cause trouble when matching against loaded module
  # paths. We should try to avoid using it.
  # Example:
  #  > import symlink.a
  #  > symlink.a.__file__
  #  symlink/a.py
  #  > import target.a
  #  > starget.a.__file__
  #  target/a.py
  # Python interpreter treats these as two separate modules. So, we also need to
  # handle them the same way.
  return os.path.normpath(path.strip().lstrip(os.sep))
971603
static protected String normalizePath(String oldPath,
                                        String newPath,
                                        int offset,
                                        char separatorChar)
  {
    CharBuffer cb = new CharBuffer();
    normalizePath(cb, oldPath, newPath, offset, separatorChar);
    return cb.toString();
  }
1026063
public static final Set<String> normalizePaths(Set<String> paths) {
		Set<String> ret = new HashSet<>();
		for (Iterator<String> it = paths.iterator(); it.hasNext();) {
			String path = normalizePath((String) it.next());
			ret.add(path);
		}
		return ret;
	}
1124279
def normalize_path(test, path)
      Pathname.new(path).relative_path_from(test.project.path.realpath).to_s
    end
403525
function normalizeRoute(path, parent) {
  if (path[0] === '/' || path[0] === '') {
    return path;  // absolute route
  }
  if (!parent) {
    return path;  // no need for a join
  }
  return `${parent.route}/${path}`; // join
}
201427
def _normalize_file_path(file_path):
        
        if not file_path:
            return None
        elif file_path.startswith('s3://') or \
                file_path.startswith('http://') or \
                file_path.startswith('https://'):
            return file_path
        return path.abspath(file_path)
153397
def normalize(path, **kwargs):
    """"""
    import os.path
    return os.path.normpath(path, **kwargs)
695099
public static String normalizePath(String path)
  {
    if(File.separatorChar == '/') {
      return path.replace('\\', '/');
    }
    return path.replace('/', '\\');
  }