'Retrieves additional user-supplied params for the job and validates them.
Args:
validator_parameter: name of the request parameter which supplies
validator for this parameter set.
name_prefix: common prefix for all parameter names in the request.
Raises:
Any exception raised by the \'params_validator\' request parameter if
the params fail to validate.'

def _get_params(self, validator_parameter, name_prefix):

    params_validator = self.request.get(validator_parameter)
    user_params = {}
    for key in self.request.arguments():
        if key.startswith(name_prefix):
            values = self.request.get_all(key)
            adjusted_key = key[len(name_prefix):]
            if (len(values) == 1):
                user_params[adjusted_key] = values[0]
            else:
                user_params[adjusted_key] = values
    if params_validator:
        resolved_validator = util.for_name(params_validator)
        resolved_validator(user_params)
    return user_params
