code: def from_formula(
      cls,
      formula,
      data,
      window,
      weights=None,
      subset=None,
      *args,
      **kwargs,
  ):
      if subset is not None:
          data = data.loc[subset]
      eval_env = kwargs.pop("eval_env", None)
      if eval_env is None:
          eval_env = 2
      elif eval_env == -1:
          from patsy import EvalEnvironment
  
          eval_env = EvalEnvironment({})
      else:
          eval_env += 1  # we're going down the stack again
      missing = kwargs.get("missing", "skip")
      from patsy import NAAction, dmatrices
  
      na_action = NAAction(on_NA="raise", NA_types=[])
      result = dmatrices(
          formula,
          data,
          eval_env,
          return_type="dataframe",
          NA_action=na_action,
      )
  
      endog, exog = result
      if (endog.ndim > 1 and endog.shape[1] > 1) or endog.ndim > 2:
          raise ValueError(
              "endog has evaluated to an array with multiple "
              "columns that has shape {}. This occurs when "
              "the variable converted to endog is non-numeric"
              " (e.g., bool or str).".format(endog.shape)
          )
  
      kwargs.update({"missing": missing, "window": window})
      if weights is not None:
          kwargs["weights"] = weights
      mod = cls(endog, exog, *args, **kwargs)
      mod.formula = formula
      # since we got a dataframe, attach the original
      mod.data.frame = data
      return mod
  
imports: from statsmodels.compat.numpy import lstsq
  from statsmodels.compat.pandas import Appender, Substitution, cache_readonly, call_cached_func, get_cached_doc
  from collections import namedtuple
  import numpy
  from pandas import DataFrame, MultiIndex, Series
  from scipy import stats
  from statsmodels.base import model
  from statsmodels.base.model import LikelihoodModelResults, Model
  from statsmodels.regression.linear_model import RegressionModel, RegressionResults
  from statsmodels.tools.validation import array_like, int_like, string_like
label_desc: Use image node_id 10 for calling the RollingWLS obj's underlying member method code with example usage: obj.from_formula(cls, formula, data, window, weights, subset) and returns: mod