def search(self, q, field=FROM, cached=False):
        id = "mail-%s-%s-%s-%s" % (self.parent._id, self.name, q, field)
        if cached and id in cache:
            status, response = "OK", [cache[id]]
        else:
            status, response = self.parent.imap4.select(self._name, readonly=1)
            status, response = self.parent.imap4.search(None, field.upper(), q)
            if cached:
                cache[id] = response[0]
        return sorted([int(i)-1 for i in response[0].split()], reverse=True)
Returns a list of indices for the given query, latest-first.
dataset/ETHPy150Open clips/pattern/pattern/web/imap/__init__.py/MailFolder.search