<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def method(request_message=message_types.VoidMessage, response_message=message_types.VoidMessage, name=None, path=None, http_method='POST', scopes=None, audiences=None, allowed_client_ids=None, auth_level=None, api_key_required=None, metric_costs=None, use_request_uri=None):
 """Decorate a ProtoRPC Method for use by the framework above. This decorator can be used to specify a method name, path, http method, scopes, audiences, client ids and auth_level. Sample usage: @api_config.method(RequestMessage, ResponseMessage, name='insert', http_method='PUT') def greeting_insert(request):
 return response Args: request_message: Message type of expected request. response_message: Message type of expected response. name: string, Name of the method, prepended with <apiname>. to make it unique. (Default: python method name) path: string, Path portion of the URL to the method, for RESTful methods. http_method: string, HTTP method supported by the method. (Default: POST) scopes: list of string, OAuth2 token must contain one of these scopes. audiences: list of string, IdToken must contain one of these audiences. allowed_client_ids: list of string, Client IDs allowed to call the method. If None and auth_level is REQUIRED, no calls will be allowed. auth_level: enum from AUTH_LEVEL, Frontend auth level for the method. api_key_required: bool, whether a key is required to call the method metric_costs: dict with keys matching an API limit metric and values representing the cost for each successful call against that metric. use_request_uri: if true, match requests against REQUEST_URI instead of PATH_INFO Returns: 'apiserving_method_wrapper' function. Raises: TypeError: if the request_type or response_type parameters are not proper subclasses of messages.Message. """

  if auth_level is not None:
    _logger.warn(_AUTH_LEVEL_WARNING)

  # Default HTTP method if one is not specified.
  DEFAULT_HTTP_METHOD = 'POST'

  def apiserving_method_decorator(api_method):
    """Decorator for ProtoRPC method that configures Google's API server.

    Args:
      api_method: Original method being wrapped.

    Returns:
      Function responsible for actual invocation.
      Assigns the following attributes to invocation function:
        remote: Instance of RemoteInfo, contains remote method information.
        remote.request_type: Expected request type for remote method.
        remote.response_type: Response type returned from remote method.
        method_info: Instance of _MethodInfo, api method configuration.
      It is also assigned attributes corresponding to the aforementioned kwargs.

    Raises:
      TypeError: if the request_type or response_type parameters are not
        proper subclasses of messages.Message.
      KeyError: if the request_message is a ResourceContainer and the newly
          created remote method has been reference by the container before. This
          should never occur because a remote method is created once.
    """
    request_body_class = None
    request_params_class = None
    if isinstance(request_message, resource_container.ResourceContainer):
      remote_decorator = remote.method(request_message.combined_message_class,
                                       response_message)
      request_body_class = request_message.body_message_class()
      request_params_class = request_message.parameters_message_class()
    else:
      remote_decorator = remote.method(request_message, response_message)
    remote_method = remote_decorator(api_method)

    def invoke_remote(service_instance, request):
      # If the server didn't specify any auth information, build it now.
      # pylint: disable=protected-access
      users_id_token._maybe_set_current_user_vars(
          invoke_remote, api_info=getattr(service_instance, 'api_info', None),
          request=request)
      # pylint: enable=protected-access
      return remote_method(service_instance, request)

    invoke_remote.remote = remote_method.remote
    if isinstance(request_message, resource_container.ResourceContainer):
      resource_container.ResourceContainer.add_to_cache(
          invoke_remote.remote, request_message)

    invoke_remote.method_info = _MethodInfo(
        name=name or api_method.__name__, path=path or api_method.__name__,
        http_method=http_method or DEFAULT_HTTP_METHOD,
        scopes=scopes, audiences=audiences,
        allowed_client_ids=allowed_client_ids, auth_level=auth_level,
        api_key_required=api_key_required, metric_costs=metric_costs,
        use_request_uri=use_request_uri,
        request_body_class=request_body_class,
        request_params_class=request_params_class)
    invoke_remote.__name__ = invoke_remote.method_info.name
    return invoke_remote

  endpoints_util.check_list_type(scopes, (basestring, endpoints_types.OAuth2Scope), 'scopes')
  endpoints_util.check_list_type(allowed_client_ids, basestring,
                                 'allowed_client_ids')
  _CheckEnum(auth_level, AUTH_LEVEL, 'auth_level')

  _CheckAudiences(audiences)

  _CheckType(metric_costs, dict, 'metric_costs')

  return apiserving_method_decorator