code: def next(self):
      _results = self.results
      Y = _results.Y
      if np.isnan(self.weights).all():
          print("nanweights1")
  
      _results.mu = self.family.link.inverse(
          _results.predict(self.exog)
      )
      # eta = _results.predict(self.exog)
      # _results.mu = self.family.fitted(eta)
      weights = self.family.weights(_results.mu)
      if np.isnan(weights).all():
          self.weights = weights
          print("nanweights2")
      self.weights = weights
      if DEBUG:
          print(
              "deriv isnan",
              np.isnan(self.family.link.deriv(_results.mu)).any(),
          )
  
      # Z = _results.predict(self.exog) + \
      Z = _results.predict(self.exog) + self.family.link.deriv(
          _results.mu
      ) * (
          Y - _results.mu
      )  # - _results.alpha #?added alpha
  
      m = AdditiveModel(
          self.exog,
          smoothers=self.smoothers,
          weights=self.weights,
          family=self.family,
      )
  
      # TODO: I do not know what the next two lines do, Z, Y ? which is endog?
      # Y is original endog, Z is endog for the next step in the iterative solver
  
      _results = m.fit(Z)
      self.history.append([Z, _results.predict(self.exog)])
      _results.Y = Y
      _results.mu = self.family.link.inverse(
          _results.predict(self.exog)
      )
      self.iter += 1
      self.results = _results
  
      return _results
  
imports: import numpy
  from statsmodels.genmod import families
  from statsmodels.sandbox.nonparametric.smoothers import PolySmoother
  from statsmodels.genmod.generalized_linear_model import GLM
  from statsmodels.tools.sm_exceptions import IterationLimitWarning, iteration_limit_doc
  import warnings
label_desc: Use image node_id 2 for calling the Model obj's underlying member method code with example usage: obj.next() and returns: _results