<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find(self, oid):
 """ Return list of extensions with given Oid """

        if not isinstance(oid, Oid):
            raise TypeError("Need crytypescrypto.oid.Oid as argument")
        found = []
        index = -1
        end = len(self)
        while True:
            index = libcrypto.X509_get_ext_by_NID(self.cert.cert, oid.nid,
                                                  index)
            if index >= end or index < 0:
                break
            found.append(self[index])
        return found