def getSubConnection(self, provider_nsa, connection_id):

        def gotResult(connections):
            # we should get 0 or 1 here since provider_nsa + connection id is unique
            if len(connections) == 0:
                return defer.fail( error.ConnectionNonExistentError('No sub connection with connection id %s at provider %s' % (connection_id, provider_nsa) ) )
            self.db_sub_connections[connection_id] = connections[0]
            return connections[0]

        if self.db_sub_connections in connection_id:
            return defer.succeed(self.db_sub_connections[connection_id])

        d = database.SubConnection.findBy(provider_nsa=provider_nsa, connection_id=connection_id)
        d.addCallback(gotResult)
        return d
dataset/ETHPy150Open NORDUnet/opennsa/opennsa/aggregator.py/Aggregator.getSubConnection/swapped operands of `in`