<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def opensearch(self, query, results=10, redirect=True):
 """ Execute a MediaWiki opensearch request, similar to search box suggestions and conforming to the OpenSearch specification Args: query (str):
 Title to search for results (int):
 Number of pages within the radius to return redirect (bool):
 If **False** return the redirect itself, \ otherwise resolve redirects Returns: List: List of results that are stored in a tuple \ (Title, Summary, URL) """


        self._check_query(query, "Query must be specified")

        query_params = {
            "action": "opensearch",
            "search": query,
            "limit": (100 if results > 100 else results),
            "redirects": ("resolve" if redirect else "return"),
            "warningsaserror": True,
            "namespace": "",
        }

        results = self.wiki_request(query_params)

        self._check_error_response(results, query)

        res = list()
        for i, item in enumerate(results[1]):
            res.append((item, results[2][i], results[3][i]))

        return res