code: def max_sharpe(self, risk_free_rate=0.02):
          
          if not isinstance(risk_free_rate, (int, float)):
              raise ValueError("risk_free_rate should be numeric")
  
          args = (self.expected_returns, self.cov_matrix, self.gamma, risk_free_rate)
          result = sco.minimize(
              objective_functions.negative_sharpe,
              x0=self.initial_guess,
              args=args,
              method="SLSQP",
              bounds=self.bounds,
              constraints=self.constraints,
          )
          self.weights = result["x"]
          return dict(zip(self.tickers, self.weights))
docs: Maximise the Sharpe Ratio. The result is also referred to as the tangency portfolio,
          as it is the tangent to the efficient frontier curve that intercepts the risk-free
          rate.
  
          :param risk_free_rate: risk-free rate of borrowing/lending, defaults to 0.02
          :type risk_free_rate: float, optional
          :raises ValueError: if ``risk_free_rate`` is non-numeric
          :return: asset weights for the Sharpe-maximising portfolio
          :rtype: dict