Escapes a path as for AWS requirement
AWS uriEscapePath function pulled from aws-sdk-js licensed under Apache 2.0 - http://github.com/aws/aws-sdk-js
546264
function(path) {
            var parts = [];
            qq.each(path.split("/"), function(idx, item) {
                parts.push(qq.s3.util.uriEscape(item));
            });
            return parts.join("/");
        }
965572
def escape_regex_special_chars(api_path):
    
    def substitute(string, replacements):
        pattern, repl = replacements
        return re.sub(pattern, repl, string)

    return functools.reduce(substitute, REGEX_REPLACEMENTS, api_path)
609820
def escape_uri(str)
      str = str.dup
      binary_encode(str)
      str.gsub(UNESCAPED) { "%%%02X" % $1[0].ord }
    end
1279707
def is_escaped(url):
    '''
    
    '''
    scheme = urlparse(url).scheme
    if not scheme:
        return url.startswith('|')
    elif scheme == 'salt':
        path, saltenv = parse(url)
        if salt.utils.platform.is_windows() and '|' in url:
            return path.startswith('_')
        else:
            return path.startswith('|')
    else:
        return False
755390
function normalize(path) {
  var last = path.length - 1
  var lastC = path.charCodeAt(last)

  // If the uri ends with `#`, just return it without '#'
  if (lastC === 35 /* "#" */) {
    return path.substring(0, last)
  }

  return (path.substring(last - 2) === ".js" ||
      path.indexOf("?") > 0 ||
      lastC === 47 /* "/" */) ? path : path + ".js"
}
149671
function _prettyPath(path) {
  var afterLastSlash = path.substr(path.lastIndexOf('/') + 1);
  var re = /(\s)|(\.)|(-)|\//g; // replace all spaces, periods, and dashes
  // if( !!afterLastSlash.match(/^index\.html$/) ) {
  //   return 'root_index_page';
  // } else {
  //   return path.replace(/\.html/, '').replace(re, '_').toLowerCase();
  // }
  if (typeof _serverRoot !== 'undefined') {
    path = path.replace(_serverRoot, '');
  }
  return path.replace(/\.html/, '').replace(re, '_').toLowerCase();
}
1278192
function makeUrl(s) {
  var search = window.location.search;

  // Remove previous grep query parameter if present
  if (search) {
    search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
  }

  return (
    window.location.pathname +
    (search ? search + '&' : '?') +
    'grep=' +
    encodeURIComponent(escapeRe(s))
  );
}
891834
function cachepath(location) {
    var uri = url.parse(location);
    if (!uri.protocol) {
        throw new Error('Invalid URL: ' + location);
    } else {
        var hash = crypto.createHash('md5')
            .update(location)
            .digest('hex')
            .substr(0,8) +
            '-' + path.basename(uri.pathname, path.extname(uri.pathname));
        var extname = path.extname(uri.pathname);
        return _(['.shp', '.zip', '']).include(extname.toLowerCase()) ?
            path.join(hash, hash + extname)
            : path.join(hash + extname);
    }
}
223083
function jsEscape(s) {
  var result = '"';
  for (var i = 0; i < s.length; i++) {
    let cp = s.charCodeAt(i);
    let special = specialEscape[cp];
    if (special !== undefined) {
      result += special;
    } else if (cp >= 0x20 && cp <= 0x7e) {
      result += String.fromCodePoint(cp);
    } else {
      result += '\\u' + zeroPaddedHex(cp, 4);
    }
  }
  result += '"';
  return result;
}
909623
function(s) {
      s = s.replace(/,/g, '\\,');
      s = escape(s);
      s = s.replace(/\+/g, '%2b');
      s = s.replace(/ /g, '+');
      return s;
    }
830032
function convertToNativePath(path) {
        path = unescape(path);
        if (path.indexOf(":") !== -1 && path[0] === "/") {
            return path.substr(1);
        }

        return path;
    }
484837
def fs_encode(path):
    

    path = _get_path(path)
    if path is None:
        raise TypeError("expected a valid path to encode")
    if isinstance(path, six.text_type):
        path = path.encode(_fs_encoding, _fs_encode_errors)
    return path
484692
function RouteRule_escape(str, escape) {
        if (!Type.isString(str)) {
            throw new error.HttpError(500, {str: str}, 'RouteRule.escape: str must be a string type');
        } else if(!Type.isArray(escape)) {
            throw new error.HttpError(500, {escape: escape}, 'RouteRule.escape: escape must be a array type');
        }
        escape.forEach(function (item) {
            str = str.replace(item.key, item.value);
        });
        return str;
    }
852815
public static String encodePath(String v)
  {
    String encoded = urlPathEscape.escape(v);
    return encoded;
  }
821492
function encodePath(path) {
    const replaced = path.replace(/\//g, SEP_PATH_POSIX).replace(/\\\\/g, SEP_PATH_WINDOWS);
    const formatted = encodeURIComponent(replaced);
    return formatted
        .split(SEP_PATH_WINDOWS)
        .join("\\\\")
        .split(SEP_PATH_POSIX)
        .join("/");
}
580710
def valid_path(value):
    ""
    # Generate UnicodeDecodeError if path can't store as ASCII.
    value.encode("ascii")
    # Cookies without leading slash will likely be ignored, raise ASAP.
    if not (value and value[0] == "/"):
        return False
    if not Definitions.PATH_RE.match(value):
        return False
    return True
659155
function rPath (htmlyFile, sourceFilepath) {
  htmlyFile = pathResolve(__dirname, htmlyFile)
  htmlyFile = pathRelative(dirname(sourceFilepath), htmlyFile)
  htmlyFile = slash(htmlyFile)
  if (!/^(\.|\/)/.test(htmlyFile)) {
    return './' + htmlyFile
  } else {
    return htmlyFile
  }
}