def lookup_rest_method(self, path, request_uri, http_method):
method_key = http_method.lower()<EOL>with self._config_lock:<EOL><INDENT>for compiled_path_pattern, unused_path, methods in self._rest_methods:<EOL><INDENT>if method_key not in methods:<EOL><INDENT>continue<EOL><DEDENT>candidate_method_info = methods[method_key]<EOL>match_against = request_uri if candidate_method_info[<NUM_LIT:1>].get('<STR_LIT>') else path<EOL>match = compiled_path_pattern.match(match_against)<EOL>if match:<EOL><INDENT>params = self._get_path_params(match)<EOL>method_name, method = candidate_method_info<EOL>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>_logger.warn('<STR_LIT>', path, http_method)<EOL>method_name = None<EOL>method = None<EOL>params = None<EOL><DEDENT><DEDENT>return method_name, method, params<EOL>
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.