code: def single_frame(i, sigma, with_pred=False):
      mod = LowessRegression(sigma=sigma).fit(xs.reshape(-1, 1), ys)
      preds = mod.predict(xs.reshape(-1, 1))
      plt.figure(figsize=(10, 3))
      wts = mod._calc_wts(xs[i])
      plt.scatter(xs, ys, color="gray")
      plt.plot(xs, wts, color="red", alpha=0.5)
      for j in range(len(xs)):
          plt.scatter([xs[j]], [ys[j]], alpha=wts[j], color="orange")
      if with_pred:
          plt.plot(xs[:i], preds[:i], color="red")
      plt.title(f"$\sigma$={sigma}")
  
imports: from pathlib import Path
  import gif
  import matplotlib.pylab
  import seaborn
  import numpy
  from sklego.linear_model import LowessRegression
  from sklearn.datasets import make_regression
  import pandas
  from sklearn.pipeline import Pipeline, FeatureUnion
  from sklearn.linear_model import LinearRegression
  from sklearn.decomposition import PCA
  from sklearn.model_selection import GridSearchCV
  from sklego.meta import EstimatorTransformer
  from sklego.linear_model import ProbWeightRegression
  from sklego.preprocessing import ColumnSelector
  from sklearn import set_config
  from sklearn.utils import estimator_html_repr
  import numpy
  import numpy
  from sklearn.linear_model import LinearRegression
  import numpy
  from sklearn.linear_model import LinearRegression
  from sklego.linear_model import LADRegression
  import numpy
  from sklego.linear_model import QuantileRegression
label_desc: Use image node_id 3 for calling a global function with example usage: single_frame(i, sigma, with_pred) without return types