def check_stability(self):
        if self.K < 100:
            eigs = np.linalg.eigvals(self.weight_model.W_effective)
            maxeig = np.amax(np.real(eigs))
        else:
            from scipy.sparse.linalg import eigs
            maxeig = eigs(self.weight_model.W_effective, k=1)[0]

        print "Max eigenvalue: ", maxeig
        if maxeig < 1.0:
            return True
        else:
            return False
Execute a function with a database connection and return the result.
dataset/ETHPy150Open slinderman/pyhawkes/pyhawkes/models.py/ContinuousTimeNetworkHawkesModel.check_stability--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/enterprise/adbapi.py/ConnectionPool.runWithConnection