code: def glsar_model():
      # Generalized Least Squares with AR covariance structure
      X = range(1, 8)
      X = sm.add_constant(X)
      Y = [1, 3, 4, 5, 8, 10, 9]
      glsar = sm.GLSAR(Y, X, rho=2)
      model = glsar.fit()
  
      return ModelWithResults(
          model=model, alg=glsar, inference_dataframe=X
      )
  
imports: from collections import namedtuple
  import numpy
  import pandas
  import statsmodels.api
  from scipy.linalg import toeplitz
  from statsmodels.tsa.arima.model import ARIMA
  from statsmodels.tsa.arima_process import arma_generate_sample
  from mlflow.models import ModelSignature
  from mlflow.types.schema import Schema, TensorSpec
label_desc: Use image node_id 6 for calling a global function with example usage: glsar_model() and returns: ModelWithResults