code: def test_imputer_in_export():
      """Assert that TPOT exports a pipeline with an imputation step if imputation was used in fit()."""
      tpot_obj = TPOTClassifier(
          random_state=42,
          population_size=1,
          offspring_size=2,
          generations=1,
          verbosity=0,
          config_dict="TPOT light",
      )
      features_with_nan = np.copy(training_features)
      features_with_nan[0][0] = float("nan")
  
      tpot_obj.fit(features_with_nan, training_target)
      # use fixed pipeline since the random.seed() performs differently in python 2.* and 3.*
      pipeline_string = (
          "KNeighborsClassifier("
          "input_matrix, "
          "KNeighborsClassifier__n_neighbors=10, "
          "KNeighborsClassifier__p=1, "
          "KNeighborsClassifier__weights=uniform"
          ")"
      )
      tpot_obj._optimized_pipeline = creator.Individual.from_string(
          pipeline_string, tpot_obj._pset
      )
  
      export_code = export_pipeline(
          tpot_obj._optimized_pipeline,
          tpot_obj.operators,
          tpot_obj._pset,
          tpot_obj._imputed,
      )
  
      expected_code = """import numpy as np
  import pandas as pd
  from sklearn.model_selection import train_test_split
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.impute import SimpleImputer
  
  # NOTE: Make sure that the outcome column is labeled 'target' in the data file
  tpot_data = pd.read_csv('PATH/TO/DATA/FILE', sep='COLUMN_SEPARATOR', dtype=np.float64)
  features = tpot_data.drop('target', axis=1)
  training_features, testing_features, training_target, testing_target = \\
              train_test_split(features, tpot_data['target'], random_state=None)
  
  imputer = SimpleImputer(strategy="median")
  imputer.fit(training_features)
  training_features = imputer.transform(training_features)
  testing_features = imputer.transform(testing_features)
  
  exported_pipeline = KNeighborsClassifier(n_neighbors=10, p=1, weights="uniform")
  
  exported_pipeline.fit(training_features, training_target)
  results = exported_pipeline.predict(testing_features)
  """
  
      assert_equal(export_code, expected_code)
  
imports: from tqdm import tqdm
  import numpy
  from os import remove, path
  from tpot import TPOTClassifier, TPOTRegressor
  from tpot.export_utils import export_pipeline, generate_import_code, _indent, generate_pipeline_code, get_by_name, set_param_recursive
  from tpot.operator_utils import TPOTOperatorClassFactory
  from tpot.config.classifier import classifier_config_dict
  from sklearn.datasets import load_digits
  from sklearn.model_selection import train_test_split
  from deap import creator
  from nose.tools import assert_raises, assert_equal, nottest
label_desc: Use image node_id 23 for calling a global function with example usage: test_imputer_in_export() without return types