The final path component, minus its last suffix.
434673
def stem(self):
        """"""
        name = self.name
        i = name.rfind('.')
        if 0 < i < len(name) - 1:
            return name[:i]
        else:
            return name
252938
public static String stripSuffixIfPresent(final String key, final String suffix) {
    if (key.endsWith(suffix)) {
      return key.substring(0, key.length() - suffix.length());
    }
    return key;
  }
573417
def get_incomplete_path(filename):
  """"""
  random_suffix = "".join(
      random.choice(string.ascii_uppercase + string.digits) for _ in range(6))
  return filename + ".incomplete" + random_suffix
92781
function (path, basePath) {
        if (!basePath || path.match(/^\//)) {
            return path;
        }
        var pathParts = path.split('/');
        var basePathParts = basePath.split('/');

        var item = pathParts[0];
        while(item === '.' || item === '..') {
            if (item === '..') {
                basePathParts.pop();
            }
            pathParts.shift();
            item = pathParts[0];
        }
        return basePathParts.join('/') + '/' + pathParts.join('/');
    }
1279996
private static String removeMatrixFromPath(String path, RouteDefinition definition) {

		// simple removal ... we don't care what matrix attributes were given
		if (definition.hasMatrixParams()) {
			int index = path.indexOf(";");
			if (index > 0) {
				return path.substring(0, index);
			}
		}

		return path;
	}
100301
def end_namespace(self, prefix):
        
        del self._ns[prefix]
        self._g.endPrefixMapping(prefix)
969561
public void closePath() {
		if (this.numTypesProperty.get()<=0 ||
				(this.types[this.numTypesProperty.get()-1]!=PathElementType.CLOSE
				&&this.types[this.numTypesProperty.get()-1]!=PathElementType.MOVE_TO)) {
			ensureSlots(true, 0);
			this.types[this.numTypesProperty.get()] = PathElementType.CLOSE;
			this.numTypesProperty.set(this.numTypesProperty.get()+1);
		}
	}
1260611
def path(self, *path):
        """"""
        path = list(filter(None, path))
        path = self.unprefix(path)
        items = [self.prefix_] + path
        return self.join(*items)
1201744
def convert_vectored_io_slice_to_final_path_name(local_path, ase):
        # type: (pathlib.Path,
        #        blobxfer.models.azure.StorageEntity) -> pathlib.Path
        
        name = blobxfer.models.metadata.\
            remove_vectored_io_slice_suffix_from_name(
                local_path.name, ase.vectored_io.slice_id)
        _tmp = list(local_path.parts[:-1])
        _tmp.append(name)
        return pathlib.Path(*_tmp)
1259177
def complete_path(curr_dir, last_dir):
    
    if not last_dir or curr_dir.startswith(last_dir):
        return curr_dir
    elif last_dir == '~':
        return os.path.join(last_dir, curr_dir)
547623
def _path_formatter(self, suffix):
        
        if suffix.lower() == "mirror":
            path_items = [self.bucket, self.s3path]
        else:
            path_items = [self.bucket, self.s3path, suffix]

        path = '/'.join(path_items)
        s3_format = "s3://{}"
        formatted_path = path.replace('//', '/')  # removes configuration errors
        full_path = s3_format.format(formatted_path)
        return full_path
154691
function endsWithString(endingValue, valueToTest) {
  const position = valueToTest.length - endingValue.length;
  const lastIndexOfValue = valueToTest.lastIndexOf(endingValue);

  return !!~lastIndexOfValue && lastIndexOfValue === position;
}
1245233
public static String removeVariantPrefixFromPath(String path) {

		String resultPath = path;

		// Remove first slash
		if (path.charAt(0) == '/') {
			resultPath = path.substring(1);
		}

		// eval the existence of a suffix
		String prefix = resultPath.substring(0, resultPath.indexOf("/"));

		// The prefix also contains variant information after a '.'
		if (prefix.indexOf('.') != -1) {
			String variantPrefix = prefix.substring(prefix.indexOf('.') + 1);
			String suffix = '@' + variantPrefix + resultPath.substring(resultPath.lastIndexOf('.'));
			resultPath = resultPath.substring(resultPath.indexOf("/"), resultPath.lastIndexOf('.')) + suffix;
		} else
			resultPath = resultPath.substring(resultPath.indexOf("/"));

		return resultPath;
	}
841439
private String fixRequestPath(String path) {
		return path.endsWith("/") ? path.substring(0, path.length() - 1) : path;
	}
134072
def add_suffix(path, suffix=""):
    """"""
    return join(dirname(path), basename(path, ext=False) + suffix + extname(path))
988406
@Override
    public Pair<ByteSlice, ByteSlice> splitOnLastLineEnd() {
        Pair<ByteSlice, ByteSlice> sliced = suffix.splitOnLastLineEnd();
        return Pair.of(ByteSlice.join(this.prefix, sliced.first), sliced.second);
    }
1335813
public static String removeRelativeParts(final String path) {

		String partialPath = "";

		for (String part : PathHelper.getParts(path)) {

			// ignore ".." and "." in paths
			if ("..".equals(part) || ".".equals(part)) {
				continue;
			}

			partialPath += PathHelper.PATH_SEP + part;
		}

		return partialPath;
	}