def _getSubscriptions(self, cursor, state):
        self._checkNodeExists(cursor)

        query = """SELECT jid, resource, state,
                          subscription_type, subscription_depth
                   FROM subscriptions
                   NATURAL JOIN nodes
                   NATURAL JOIN entities
                   WHERE node=%s"""
        values = [self.nodeIdentifier]

        if state:
            query += " AND state=%s"
            values.append(state)

        cursor.execute(query, values)
        rows = cursor.fetchall()

        subscriptions = []
        for row in rows:
            subscriber = jid.JID((row.jid, row.resource) % '%s/%s')

            options = {}
            if row.subscription_type:
                options['pubsub#subscription_type'] = row.subscription_type
            if row.subscription_depth:
                options['pubsub#subscription_depth'] = row.subscription_depth

            subscriptions.append(Subscription(self.nodeIdentifier, subscriber,
                                              row.state, options))

        return subscriptions
dataset/ETHPy150Open ralphm/idavoll/idavoll/pgsql_storage.py/Node._getSubscriptions/swapped operands of `%`