code: def base_minimizer(
      model,
      data,
      functions,
      algo,
      max_evals,
      trials,
      rseed=1337,
      full_model_string=None,
      notebook_name=None,
      verbose=True,
      stack=3,
      keep_temp=False,
      data_args=None,
  ):
      if full_model_string is not None:
          model_str = full_model_string
      else:
          model_str = get_hyperopt_model_string(
              model,
              data,
              functions,
              notebook_name,
              verbose,
              stack,
              data_args=data_args,
          )
      temp_file = "./temp_model.py"
      write_temp_files(model_str, temp_file)
  
      if "temp_model" in sys.modules:
          del sys.modules["temp_model"]
  
      try:
          from temp_model import keras_fmin_fnct, get_space
      except:
          print("Unexpected error: {}".format(sys.exc_info()[0]))
          raise
      try:
          if not keep_temp:
              os.remove(temp_file)
              os.remove(temp_file + "c")
      except OSError:
          pass
  
      try:
          # for backward compatibility.
          return (
              fmin(
                  keras_fmin_fnct,
                  space=get_space(),
                  algo=algo,
                  max_evals=max_evals,
                  trials=trials,
                  rseed=rseed,
                  return_argmin=True,
              ),
              get_space(),
          )
      except TypeError:
          pass
  
      return (
          fmin(
              keras_fmin_fnct,
              space=get_space(),
              algo=algo,
              max_evals=max_evals,
              trials=trials,
              # rstate=np.random.RandomState(rseed),
              rstate=np.random.default_rng(rseed),
              return_argmin=True,
          ),
          get_space(),
      )
  
imports: import inspect
  import os
  import re
  import sys
  import nbformat
  import numpy
  from hyperopt import fmin
  from nbconvert import PythonExporter
  from .ensemble import VotingModel
  from .utils import remove_imports, remove_all_comments, extract_imports, temp_string, write_temp_files, determine_indent, with_line_numbers, unpack_hyperopt_vals, eval_hyperopt_space, find_signature_end
label_desc: Use image node_id 2 for calling a global function with example usage: base_minimizer(model, data, functions, algo, max_evals, trials, rseed, full_model_string, notebook_name, verbose, stack, keep_temp, data_args) and returns: fmin,  get_space, fmin,  get_space