code: def still_optimizing(self):
          
  
          # Check if we need to give up on optimizing.
          if (self.iterations > self.max_iter) or (self.time_elapsed() > self.max_time):
              return False
  
          # Always optimize for at least 'min_iter' iterations.
          elif not hasattr(self, 'improvement') or (self.iterations < self.min_iter):
              return True
  
          # Check convergence.
          else:
              self.converged = self.improvement < self.tol
              return False if self.converged else True
docs: True unless converged or maximum iterations/time exceeded.