code: def handle_one_hot(preprocess, df, target):
      columns = preprocess["one-hot"]
  
      if isinstance(columns, str):
          columns = [columns]
  
      for column in columns:
          if is_numeric_dtype(column):
              raise Exception(
                  "You can only one hot encode on numeric columns, your column was a boolean."
              )
          if column == target:
              raise Exception(
                  "You cannot one-hot-encode the target column you've specified"
              )
  
          label = LabelEncoder()
          df[column] = label.fit_transform(df[preprocess["one-hot"]])
  
          enc = OneHotEncoder()
          columns = [
              column + str(i) for i in range(len(np.unique(df[column])))
          ]
          enc_df = pd.DataFrame(
              enc.fit_transform(df[[column]]).toarray(), columns=columns
          )
  
          for value in enc_df.columns:
              df[value] = enc_df[value].values
  
          del df[column]
  
      return [df]
  
imports: from pandas.api.types import is_numeric_dtype
  import numpy
  import pandas
  from sklearn.compose import ColumnTransformer
  from sklearn.feature_extraction.text import TfidfVectorizer
  from sklearn.pipeline import Pipeline
  from nltk.stem import WordNetLemmatizer
  from nltk.tokenize import word_tokenize
  from nltk.corpus import stopwords
  from autocorrect import Speller
  from sklearn.preprocessing import MinMaxScaler
  from sklearn.preprocessing import OrdinalEncoder
  from sklearn.impute import SimpleImputer
  from sklearn.ensemble import RandomForestRegressor
  from nylon.preprocessing.preprocessing import process_dates
  from sklearn.preprocessing import OneHotEncoder, StandardScaler, FunctionTransformer, LabelEncoder
label_desc: Use image node_id 7 for calling a global function with example usage: handle_one_hot(preprocess, df, target) and returns: list