Helper class for converting parameters from amazon format to a map.

@param parametersWithBasePath parameters with the base path
@return map of the results, converted
480731
private Map<String, Object> convertParametersToMap(ParametersWithBasePath parametersWithBasePath) {

        Map<String, Object> output = new HashMap<>();
        for (Parameter param : parametersWithBasePath.parameters) {
            switch (param.getType()) {
                case "StringList":
                    // command delimited list back into a set/list and exvalues value to be key=value,key=value
                    String[] items = param.getValue().split(",");
                    for (String item : items) {
                        // now split to key value
                        String[] keyValue = item.split("=");
                        if (keyValue.length > 1) {
                            output.put(keyValue[0], keyValue[1]);
                        } else {
                            addKeyFromPath(output, parametersWithBasePath, param, keyValue[0]);
                        }
                    }
                    break;

                case "SecureString":
                    // if decrypt is set to true on request KMS is supposed to decrypt these for us otherwise we get
                    // back an encoded encrypted string of gobbly gook. It uses the default account key unless
                    // one is specified in the config
                    String[] keyValue = param.getValue().split("=");
                    if (keyValue.length > 1) {
                        output.put(keyValue[0], keyValue[1]);
                    } else {
                        addKeyFromPath(output, parametersWithBasePath, param, keyValue[0]);
                    }

                    break;

                default:
                case "String":
                    String[] keyVal = param.getValue().split("=");
                    if (keyVal.length > 1) {
                        output.put(keyVal[0], keyVal[1]);
                    } else {
                        addKeyFromPath(output, parametersWithBasePath, param, keyVal[0]);
                    }
                    break;
            }
        }
        return output;

    }
859393
public SQLRouteResult route(final List<Object> parameters) {
        if (null == sqlStatement) {
            sqlStatement = shardingRouter.parse(logicSQL, true);
        }
        return masterSlaveRouter.route(shardingRouter.route(logicSQL, parameters, sqlStatement));
    }
1167790
@SuppressWarnings({ "unchecked", "rawtypes" })
    public Map<String, List<String>> parameters() {
        return (Map<String, List<String>>) (Map) parameters.asMap();
    }
974464
public function withBasePath($basePath)
    {
        if (!is_string($basePath)) {
            throw new InvalidArgumentException('Uri path must be a string');
        }
        if (!empty($basePath)) {
            $basePath = '/' . trim($basePath, '/');
        }
        $clone = clone $this;

        if ($basePath !== '/') {
            $clone->basePath = Validator::checkPath($basePath);
        }

        return $clone;
    }
776800
public java.util.List<ParameterMetadata> getParameters() {
        if (parameters == null) {
            parameters = new com.amazonaws.internal.SdkInternalList<ParameterMetadata>();
        }
        return parameters;
    }
861555
public static URI appendPath(URI base, String path) throws URISyntaxException {
    return new URI(base.getScheme(), base.getAuthority(),
        PathUtils.concatPath(base.getPath(), path), base.getQuery(), base.getFragment());
  }
315317
func (o *GetIDURL) WithBasePath(bp string) *GetIDURL {
	o.SetBasePath(bp)
	return o
}
154158
public static String addURLPath(String basePath, String path) {
        if (basePath == null)
            basePath = "";
        if ((!basePath.endsWith("/")) && (!path.startsWith("/")))
            path = "/" + path;
        if (basePath.length() > 0)
            path = basePath + path;
        if (path.length() == 0)
            path = "/";
        else if ((path.length() > 1) && (path.endsWith("/")))
            path = path.substring(0, path.length() - 1);
        return path;
    }
885845
@SuppressWarnings("unchecked")
  public String path(T target, Object... params) {
    if (params.length == 0) return path(target, Collections.emptyMap());

    if (params.length == 1 && params[0] instanceof Map<?, ?>) return pathMap(target, (Map<Object, Object>) params[0]);

    if (params.length % 2 == 1) throw new RuntimeException("Missing value for param: " + params[params.length - 1]);

    final Map<Object, Object> map = new HashMap<Object, Object>();
    for (int i = 0; i < params.length; i += 2) {
      final String key   = params[i].toString();
      final String value = params[i + 1].toString();
      map.put(key, value);
    }
    return pathMap(target, map);
  }
432792
func (o *CreateTaskURL) WithBasePath(bp string) *CreateTaskURL {
	o.SetBasePath(bp)
	return o
}
161381
public @Nonnull Optional<ResourceLoader> getLoaderForBasePath(@Nonnull String basePath) {
        ArgumentUtils.requireNonNull("basePath", basePath);
        Optional<ResourceLoader> resourceLoader = getSupportingLoader(basePath);
        return resourceLoader.map(rl -> rl.forBase(basePath));
    }
531399
func (o *GetEndpointIDConfigURL) WithBasePath(bp string) *GetEndpointIDConfigURL {
	o.SetBasePath(bp)
	return o
}
1052849
function (basePath, pathObj) {
		for (var i in pathObj) {
			var p = pathObj[i];
			// p = p[0] == "." ? path.join(basePath, p) : path.normalize(p);
			p = this.realPath(basePath, p);
			pathObj[i] = p;
		}
		return pathObj;
	}
527229
public Routes setBaseViewPath(String baseViewPath) {
		if (StrKit.isBlank(baseViewPath)) {
			throw new IllegalArgumentException("baseViewPath can not be blank");
		}
		
		baseViewPath = baseViewPath.trim();
		if (! baseViewPath.startsWith("/")) {			// add prefix "/"
			baseViewPath = "/" + baseViewPath;
		}
		if (baseViewPath.endsWith("/")) {				// remove "/" in the end of baseViewPath
			baseViewPath = baseViewPath.substring(0, baseViewPath.length() - 1);
		}
		
		this.baseViewPath = baseViewPath;
		return this;
	}
1318946
@NonNull
    private List<Mapping> getMappings(String httpPath) {
        List<Mapping> returned = new ArrayList<>();
        List<Path.Segment> httpSegments = Path.pathToList(httpPath);
        Map<Mapping, RequestHandler> mappings = getMappingMap();
        for (Mapping mapping : mappings.keySet()) {
            List<Path.Rule> paths = mapping.getPath().getRuleList();
            for (Path.Rule path : paths) {
                List<Path.Segment> segments = path.getSegments();
                if (httpSegments.size() != segments.size()) continue;

                String pathStr = Path.listToPath(segments);
                if (pathStr.equals(httpPath)) {
                    returned.add(mapping);
                    break; // Validate next mapping.
                }

                boolean matches = true;
                for (int i = 0; i < segments.size(); i++) {
                    Path.Segment segment = segments.get(i);
                    if (!segment.equals(httpSegments.get(i)) && !segment.isBlurred()) {
                        matches = false;
                        break;
                    }
                }
                if (matches) returned.add(mapping);
            }
        }
        return returned;
    }
13395
static Map<String, String> findQueryParams(String baseParam, Method method) {
        Map<String, String> hrefVars = new HashMap<>();
        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
        for (int i = 0; i < parameterAnnotations.length; i++) {
            Annotation[] paramAnnotations = parameterAnnotations[i];
            for (Annotation paramAnnotation : paramAnnotations) {
                Class<?> parameterClass = method.getParameterTypes()[i];
                hrefVars.putAll(findQueryParamOnParameter(baseParam, parameterClass, paramAnnotation));
            }
        }
        return hrefVars;
    }
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))