code: def to_json(self):
      preprocessing_params = {}
      if self._remove_columns:
          preprocessing_params["remove_columns"] = self._remove_columns
      if self._missing_values is not None and len(self._missing_values):
          mvs = []  # refactor
          for mv in self._missing_values:
              if mv.to_json():
                  mvs += [mv.to_json()]
          if mvs:
              preprocessing_params["missing_values"] = mvs
      if self._categorical is not None and len(self._categorical):
          cats = []  # refactor
          for cat in self._categorical:
              if cat.to_json():
                  cats += [cat.to_json()]
          if cats:
              preprocessing_params["categorical"] = cats
  
      if self._datetime_transforms is not None and len(
          self._datetime_transforms
      ):
          dtts = []
          for dtt in self._datetime_transforms:
              dtts += [dtt.to_json()]
          if dtts:
              preprocessing_params["datetime_transforms"] = dtts
  
      if self._text_transforms is not None and len(
          self._text_transforms
      ):
          tts = []
          for tt in self._text_transforms:
              tts += [tt.to_json()]
          if tts:
              preprocessing_params["text_transforms"] = tts
  
      if self._golden_features is not None:
          preprocessing_params[
              "golden_features"
          ] = self._golden_features.to_json()
  
      if self._kmeans is not None:
          preprocessing_params["kmeans"] = self._kmeans.to_json()
  
      if self._scale is not None and len(self._scale):
          scs = [sc.to_json() for sc in self._scale if sc.to_json()]
          if scs:
              preprocessing_params["scale"] = scs
      if self._categorical_y is not None:
          cat_y = self._categorical_y.to_json()
          if cat_y:
              preprocessing_params["categorical_y"] = cat_y
      if self._scale_y is not None:
          preprocessing_params["scale_y"] = self._scale_y.to_json()
  
      if "ml_task" in self._params:
          preprocessing_params["ml_task"] = self._params["ml_task"]
  
      if self._add_random_feature:
          preprocessing_params["add_random_feature"] = True
  
      if self._drop_features:
          preprocessing_params["drop_features"] = self._drop_features
  
      preprocessing_params["params"] = self._params
  
      return preprocessing_params
  
imports: import copy
  import logging
  import warnings
  import numpy
  import pandas
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
  from supervised.exceptions import AutoMLException
  from supervised.preprocessing.datetime_transformer import DateTimeTransformer
  from supervised.preprocessing.exclude_missing_target import ExcludeRowsMissingTarget
  from supervised.preprocessing.goldenfeatures_transformer import GoldenFeaturesTransformer
  from supervised.preprocessing.kmeans_transformer import KMeansTransformer
  from supervised.preprocessing.label_binarizer import LabelBinarizer
  from supervised.preprocessing.label_encoder import LabelEncoder
  from supervised.preprocessing.preprocessing_categorical import PreprocessingCategorical
  from supervised.preprocessing.preprocessing_missing import PreprocessingMissingValues
  from supervised.preprocessing.preprocessing_utils import PreprocessingUtils
  from supervised.preprocessing.scale import Scale
  from supervised.preprocessing.text_transformer import TextTransformer
  from supervised.utils.config import LOG_LEVEL
label_desc: Use image node_id 9 for calling the Preprocessing obj's underlying member method code with example usage: obj.to_json() and returns: preprocessing_params