<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def transform_parameter_value(parameter_name, value, parameter_config):
 """Validates and transforms parameters to the type expected by the API. If the value is a list this will recursively call _transform_parameter_value on the values in the list. Otherwise, it checks all parameter rules for the the current value and converts its type from a string to whatever format the API expects. In the list case, '[index-of-value]' is appended to the parameter name for error reporting purposes. Args: parameter_name: A string containing the name of the parameter, which is either just a variable name or the name with the index appended, in the recursive case. For example 'var' or 'var[2]'. value: A string or list of strings containing the value(s) passed in for the parameter. These are the values from the request, to be validated, transformed, and passed along to the backend. parameter_config: The dictionary containing information specific to the parameter in question. This is retrieved from request.parameters in the method config. Returns: The converted parameter value(s). Not all types are converted, so this may be the same string that's passed in. """

  if isinstance(value, list):
    # We're only expecting to handle path and query string parameters here.
    # The way path and query string parameters are passed in, they'll likely
    # only be single values or singly-nested lists (no lists nested within
    # lists).  But even if there are nested lists, we'd want to preserve that
    # structure.  These recursive calls should preserve it and convert all
    # parameter values.  See the docstring for information about the parameter
    # renaming done here.
    return [transform_parameter_value('%s[%d]' % (parameter_name, index),
                                      element, parameter_config)
            for index, element in enumerate(value)]

  # Validate and convert the parameter value.
  entry = _get_parameter_conversion_entry(parameter_config)
  if entry:
    validation_func, conversion_func, type_name = entry
    if validation_func:
      validation_func(parameter_name, value, parameter_config)
    if conversion_func:
      try:
        return conversion_func(value)
      except ValueError:
        raise errors.BasicTypeParameterError(parameter_name, value, type_name)

  return value