Generate parameter list for path: common for several operations
496397
function generatePathParameters(isInstance) {
    var parameters = [];

    // Parameters available for singular and plural routes
    parameters.push(getParamRef('select'),
        getParamRef('populate'));

    if (isInstance) {
        // Parameters available for singular routes
        addPathSingularParameters(parameters);
    } else {
        addPathCollectionParameters(parameters);
    }
    return parameters;
}
684014
def __ConstructRelativePath(self, method_config, request,
                                relative_path=None):
        """"""
        python_param_names = util.MapParamNames(
            method_config.path_params, type(request))
        params = dict([(param, getattr(request, param, None))
                       for param in python_param_names])
        params = util.MapRequestParams(params, type(request))
        return util.ExpandRelativePath(method_config, params,
                                       relative_path=relative_path)
765206
function normalizePath(path, keys, params) {
        for (var name in params) {
            var param = params[name];
            if (typeof param == "string" || param instanceof RegExp)
                params[name] = {type: param};
        }

        path = path
            .concat("/?")
            .replace(/\/:([\w.\-_]+)(\*?)/g, function(match, key, wildcard) {
                keys.push(key);
                if (!params[key]) {
                    params[key] = {};
                }
                // url params default to type string and optional=false
                var param = params[key];
                param.type = param.type || "string";
                param.optional = false;

                if (!param.source) param.source = "url";

                if (param.source !== "url")
                    throw new Error(
                        "Url parameters must have 'url' as source but found '" +
                            param.source +
                            "'"
                    );

                if (wildcard) return "(/*)";
                else return "/([^\\/]+)";
            })
            .replace(/([/.])/g, "\\$1")
            .replace(/\*/g, "(.*)");

        return new RegExp("^" + path + "$");
    }
1361186
def commandlineargs(self):
        """"""
        commandlineargs = []
        for parametergroup, parameters in self.parameters: #pylint: disable=unused-variable
            for parameter in parameters:
                p = parameter.compilearg()
                if p:
                    commandlineargs.append(p)
        return " ".join(commandlineargs)
1085244
def generic_filename(path):
    '''
    
    '''

    for sep in common_path_separators:
        if sep in path:
            _, path = path.rsplit(sep, 1)
    return path
640889
public List<String> params(String name) {
		List<String> values = queryParams.get(name);
		String value = pathParams.get(name);

		if (values == null) {
			return (value == null) ? Collections.<String>emptyList() : Collections.singletonList(value);
		}

		if (value == null) {
			return Collections.unmodifiableList(values);
		} else {
			List<String> aggregated = new ArrayList<String>(values.size() + 1);
			aggregated.addAll(values);
			aggregated.add(value);
			return Collections.unmodifiableList(aggregated);
		}
	}
1351942
public static List<String> pathParams(String param, ContainerRequestContext ctx) {
		return ctx.getUriInfo().getPathParameters().get(param);
	}
1275671
function extractPathParams(pattern, path) {
    const regex = new RegExp(pattern);
    const matches = regex.exec(path);
    if (!matches) {
        return [];
    }
    else {
        const groups = [...matches];
        // remove first result since its not a capture group
        groups.shift();
        return groups;
    }
}
118910
def validate_path_parameters(target_path, api_path, path_parameters, context):
    
    base_path = context.get('basePath', '')
    full_api_path = re.sub(NORMALIZE_SLASH_REGEX, '/', base_path + api_path)
    parameter_values = get_path_parameter_values(
        target_path, full_api_path, path_parameters, context,
    )
    validate_parameters(parameter_values, path_parameters, context=context)
394965
def _get_pathcost_func(
    name: str
) -> Callable[[int, int, int, int, Any], float]:
    """"""
    return ffi.cast(  # type: ignore
        "TCOD_path_func_t", ffi.addressof(lib, name)
    )
693896
def extract_pathvars(callback):
    '''
    '''
    mandatory = []
    optional = []
    # We loop on the signature because the order of the parameters is
    # important, and signature is an OrderedDict, while annotations is a
    # regular dictionary
    for pname in callback.signature.parameters.keys():
        try:
            anno = callback.__annotations__[pname]
        except KeyError:  # unannotated params, like "cls" or "request"
            continue
        if anno[0] != Ptypes.path:
            continue
        # At this point we are only considering path variables, but
        # we have to generate different (present/absent) if these
        # parameters have a default.
        if callback.signature.parameters[pname].default == inspect._empty:
            mandatory.append(pname)
        else:
            optional.append(pname)
    return {'mandatory': mandatory, 'optional': optional}
778808
private static ImmutableList<String> computePathPrefixes(String path) {
    List<String> pieces = Q_NAME_SPLITTER.splitToList(path);
    ImmutableList.Builder<String> pathPrefixes = ImmutableList.builder();

    String partial = pieces.get(0); // There will always be at least 1.
    pathPrefixes.add(partial);
    for (int i = 1; i < pieces.size(); i++) {
      partial = Q_NAME_JOINER.join(partial, pieces.get(i));
      pathPrefixes.add(partial);
    }

    return pathPrefixes.build();
  }
348147
def os_path_relpath(path, start=os.path.curdir):
    """"""

    if not path:
        raise ValueError("no path specified")

    start_list = [x for x in os.path.abspath(start).split(os.path.sep) if x]
    path_list = [x for x in os.path.abspath(path).split(os.path.sep) if x]

    # Work out how much of the filepath is shared by start and path.
    i = len(os.path.commonprefix([start_list, path_list]))

    rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:]
    if not rel_list:
        return os.path.curdir
    return os.path.join(*rel_list)
733165
def list(path='.'):
    """"""
    import os
    for f in os.listdir(path):
        if isfile(join(path, f)):
            yield join(path, f) if path != '.' else f
615707
def parameterize_path(path, parameters):
    
    if parameters is None:
        parameters = {}

    try:
        return path.format(**parameters)
    except KeyError as key_error:
        raise PapermillMissingParameterException("Missing parameter {}".format(key_error))
10662
def get_args(path, *args, work_tree=True, bare=False):
    
    base = [ 'git' ]
    if path:
        base.append('-C')
        base.append(path)
        if bare:
            base.append('--bare')
            base.append("--git-dir="+path)
        else:
            base.append("--git-dir="+os.path.join(path, ".git"))
        if work_tree:
            base.append("--work-tree="+path)
    for arg in args:
        base.append(arg)
    return base
970586
def get_parameters_by_path(self, path, with_decryption, recursive, filters=None):
        """"""
        result = []
        # path could be with or without a trailing /. we handle this
        # difference here.
        path = path.rstrip('/') + '/'
        for param in self._parameters:
            if path != '/' and not param.startswith(path):
                continue
            if '/' in param[len(path) + 1:] and not recursive:
                continue
            if not self._match_filters(self._parameters[param], filters):
                continue
            result.append(self._parameters[param])

        return result