code: def test_default_imputation(input_data_imputation, categorical):
      """
      Makes sure that imputation works for both numerical and categorical data.
      This also has to be guaranteed for numpy and pandas like objects.
      """
      X, mask = input_data_imputation
      if categorical:
          imputation_value = "missing_value"
          X = X.astype("str").astype("object")
          X[mask] = np.nan
      else:
          imputation_value = min(np.unique(X)) - 1
  
      Y = CategoricalImputation().fit_transform(X.copy())
  
      assert np.array_equal(Y == imputation_value, mask)
      assert np.array_equal(Y != imputation_value, ~mask)
  
file_path: auto-sklearn/test/test_pipeline/components/data_preprocessing/test_categorical_imputation.py
imports: import numpy
  import pandas
  from scipy import sparse
  from autosklearn.pipeline.components.data_preprocessing.imputation.categorical_imputation import CategoricalImputation
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_default_imputation(input_data_imputation, categorical) without return types