code: def ExpandRelativePath(method_config, params, relative_path=None):
      
      path = relative_path or method_config.relative_path or ''
  
      for param in method_config.path_params:
          param_template = '{%s}' % param
          # For more details about "reserved word expansion", see:
          #   http://tools.ietf.org/html/rfc6570#section-3.2.2
          reserved_chars = ''
          reserved_template = '{+%s}' % param
          if reserved_template in path:
              reserved_chars = _RESERVED_URI_CHARS
              path = path.replace(reserved_template, param_template)
          if param_template not in path:
              raise exceptions.InvalidUserInputError(
                  'Missing path parameter %s' % param)
          try:
              # TODO(craigcitro): Do we want to support some sophisticated
              # mapping here?
              value = params[param]
          except KeyError:
              raise exceptions.InvalidUserInputError(
                  'Request missing required parameter %s' % param)
          if value is None:
              raise exceptions.InvalidUserInputError(
                  'Request missing required parameter %s' % param)
          try:
              if not isinstance(value, six.string_types):
                  value = str(value)
              path = path.replace(param_template,
                                  urllib_parse.quote(value.encode('utf_8'),
                                                     reserved_chars))
          except TypeError as e:
              raise exceptions.InvalidUserInputError(
                  'Error setting required parameter %s to value %s: %s' % (
                      param, value, e))
      return path
docs: Determine the relative path for request.