code: def update_beta(self, beta):
          r
  
          if self._safeguard:
              beta *= self.xi_restart
              beta = max(beta, self.min_beta)
  
          return beta
docs: r"""Update beta
  
          This method updates beta only in the case of safeguarding (should only
          be done in the greedy restarting strategy).
  
          Parameters
          ----------
          beta: float
              The beta parameter
  
          Returns
          -------
          float: the new value for the beta parameter