<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compute(self, text, # text for which to find the most similar event lang = "eng"):
 # language in which the text is written """ compute the list of most similar events for the given text """

        params = { "lang": lang, "text": text, "topClustersCount": self._nrOfEventsToReturn }
        res = self._er.jsonRequest("/json/getEventForText/enqueueRequest", params)

        requestId = res["requestId"]
        for i in range(10):
            time.sleep(1)   # sleep for 1 second to wait for the clustering to perform computation
            res = self._er.jsonRequest("/json/getEventForText/testRequest", { "requestId": requestId })
            if isinstance(res, list) and len(res) > 0:
                return res
        return None