code: def test_subset_categories_in_test(df):
      df_train = df[:5]
      X_train, y_train = (
          df_train[["a", "b", "c", "d"]],
          df_train[["e"]].values.ravel(),
      )
  
      df_test = df[5:]
      X_test = df_test[["a", "b", "c", "d"]]
  
      trf = PatsyTransformer("a + np.log(a) + b + c + d - 1")
  
      trf.fit(X_train, y_train)
  
      assert (
          trf.transform(X_test).shape[1]
          == trf.transform(X_train).shape[1]
      )
  
file_path: scikit-lego/tests/test_preprocessing/test_patsy_transformer.py
imports: import numpy
  import pandas
  import pytest
  from sklearn.linear_model import LogisticRegression
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import StandardScaler
  from sklego.preprocessing import PatsyTransformer
label_desc: Use image node_id 12 for calling a global function with example usage: test_subset_categories_in_test(df) without return types