<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lookup_rest_method(self, path, request_uri, http_method):
 """Look up the rest method at call time. The method is looked up in self._rest_methods, the list it is saved in for SaveRestMethod. Args: path: A string containing the path from the URL of the request. http_method: A string containing HTTP method of the request. Returns: Tuple of (<method name>, <method>, <params>) Where: <method name> is the string name of the method that was matched. <method> is the descriptor as specified in the API configuration. -and- <params> is a dict of path parameters matched in the rest request. """

    method_key = http_method.lower()
    with self._config_lock:
      for compiled_path_pattern, unused_path, methods in self._rest_methods:
        if method_key not in methods:
          continue
        candidate_method_info = methods[method_key]
        match_against = request_uri if candidate_method_info[1].get('useRequestUri') else path
        match = compiled_path_pattern.match(match_against)
        if match:
          params = self._get_path_params(match)
          method_name, method = candidate_method_info
          break
      else:
        _logger.warn('No endpoint found for path: %r, method: %r', path, http_method)
        method_name = None
        method = None
        params = None
    return method_name, method, params