#NEWLINE# def match_endpoint( self , method , request ) : #NEWLINE# #INDENT# '\n        Return a ``set`` of endpoint expressions which match the provided\n            ``method`` and ``request``. The items in this set can be provided\n            to ``PluginConfiguration.endpoint`` to get the adapter\n            configuration.\n\n        :param method: An HTTP method string, e.g. "GET" or "POST".\n\n        :param request: An HTTP request path string, e.g. "/v1/containers/create".\n\n        :return: The set of endpoint expressions to be provided to\n            ``PluginConfiguration.endpoint``.\n\n        :raises: If the request containers a query part, an ``InvalidRequest`` is raised.\n        ' #NEWLINE# if ( '?' in matched_endpoints ) : #NEWLINE# #INDENT# raise InvalidRequest ( ) #NEWLINE# #UNINDENT# all_endpoints = self . config . endpoints ( ) #NEWLINE# match_str = ( '%s %s' % ( method , request ) ) #NEWLINE# matched_endpoints = set ( ) #NEWLINE# for endpoint in all_endpoints : #NEWLINE# #INDENT# if fnmatch . fnmatch ( match_str , endpoint ) : #NEWLINE# #INDENT# matched_endpoints . add ( endpoint ) #NEWLINE# #UNINDENT# #UNINDENT# return matched_endpoints