code: def test_transform():
      """Test OneHotEncoder with both dense and sparse matrixes."""
      input = np.array(
          ((0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5))
      ).transpose()
      ohe = OneHotEncoder()
      ohe.fit(input)
      test_data = np.array(((0, 1, 2, 6), (0, 1, 6, 7))).transpose()
      output = ohe.transform(test_data).todense()
      assert np.sum(output) == 5
  
      input = np.array(
          ((0, 1, 2, 3, 4, 5), (0, 1, 2, 3, 4, 5))
      ).transpose()
      ips = scipy.sparse.csr_matrix(input)
      ohe = OneHotEncoder()
      ohe.fit(ips)
      test_data = np.array(((0, 1, 2, 6), (0, 1, 6, 7))).transpose()
      tds = scipy.sparse.csr_matrix(test_data)
      output = ohe.transform(tds).todense()
      assert np.sum(output) == 3
  
imports: import numpy
  import scipy.sparse
  from numpy.testing import assert_array_almost_equal
  from sklearn.datasets import load_iris, load_boston
  from sklearn.linear_model import LinearRegression
  from sklearn.pipeline import make_pipeline
  from sklearn.model_selection import cross_val_score, KFold
  from nose.tools import assert_equal
  from tpot.builtins import OneHotEncoder, auto_select_categorical_features, _transform_selected
label_desc: Use image node_id 17 for calling a global function with example usage: test_transform() without return types