code: def plot_model(model):
      df = load_chicken(as_frame=True)
  
      _ = model.fit(df[["diet", "time"]], df["weight"])
      metric_df = df[["diet", "time", "weight"]].assign(
          pred=lambda d: model.predict(d[["diet", "time"]])
      )
  
      metric = mean_absolute_error(
          metric_df["weight"], metric_df["pred"]
      )
  
      plt.figure(figsize=(12, 4))
      plt.scatter(df["time"], df["weight"])
      for i in [1, 2, 3, 4]:
          pltr = (
              metric_df[["time", "diet", "pred"]]
              .drop_duplicates()
              .loc[lambda d: d["diet"] == i]
          )
          plt.plot(pltr["time"], pltr["pred"], color=".rbgy"[i])
      plt.title(f"linear model per group, MAE: {np.round(metric, 2)}")
  
imports: from pathlib import Path
  import matplotlib.pylab
  import seaborn
  import pandas
  import numpy
  from sklearn.pipeline import Pipeline
  from sklearn.datasets import make_blobs
  from sklearn.model_selection import GridSearchCV
  from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import precision_score, recall_score, accuracy_score, make_scorer
  from sklego.meta import Thresholder
  import numpy
  import pandas
  import matplotlib.pylab
  from sklearn.linear_model import LinearRegression
  from sklearn.pipeline import Pipeline, FeatureUnion
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
  from sklearn.metrics import mean_absolute_error, mean_squared_error
  from sklego.datasets import load_chicken
  from sklego.preprocessing import ColumnSelector
  from sklego.meta import GroupedPredictor
  from sklearn.dummy import DummyRegressor
  from sklego.datasets import load_penguins
  from sklearn.preprocessing import StandardScaler
  from sklego.meta import GroupedTransformer
  import matplotlib.pylab
  import seaborn
  from sklego.datasets import make_simpleseries
  from sklearn.dummy import DummyRegressor
  from sklego.meta import GroupedPredictor, DecayEstimator
  from sklego.meta._decay_utils import exponential_decay, linear_decay, sigmoid_decay, stepwise_decay
  import numpy
  import matplotlib.pylab
  import seaborn
  from sklearn.metrics import confusion_matrix
  from sklearn.linear_model import LogisticRegression
  from sklearn.linear_model import LogisticRegression
  from sklearn.model_selection import GridSearchCV
  from sklego.meta import ConfusionBalancer
  from sklearn.utils import estimator_html_repr
  import numpy
  from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
  from sklearn.model_selection import cross_val_score
  from sklego.meta import ZeroInflatedRegressor
  import numpy
  from sklego.meta.outlier_classifier import OutlierClassifier
  from sklearn.ensemble import IsolationForest
  from sklearn.utils import estimator_html_repr
  from sklearn.ensemble import StackingClassifier, RandomForestClassifier
  from sklearn.utils import estimator_html_repr
label_desc: Use image node_id 1 for calling a global function with example usage: plot_model(model) without return types