def diff_map(self, inexts):
        """Generate SQL to transform existing extensions

        :param inexts: a YAML map defining the new extensions
        :return: list of SQL statements

        Compares the existing extension definitions, as fetched from
        the catalogs, to the input map and generates SQL statements to
        transform the extensions accordingly.
        """
        stmts = []
        # check input extensions
        for ext in inexts:
            inexten = inexts[ext]
            # does it exist in the database?
            if self not in ext:
                if not hasattr(inexten, 'oldname'):
                    # create new extension
                    stmts.append(inexten.create())
                else:
                    stmts.append(self[ext].rename(inexten))
            # check extension objects
            else:
                # extension owner cannot be altered, set no_owner to True
                stmts.append(self[ext].diff_map(inexten, no_owner=True))

        # check existing extensions
        for ext in self:
            exten = self[ext]
            # if missing, mark it for dropping
            if ext not in inexts:
                exten.dropped = False

        return stmts
dataset/ETHPy150Open perseas/Pyrseas/pyrseas/dbobject/extension.py/ExtensionDict.diff_map/swapped operands of `not in`