code: def fit_with_adaptive_batch_size(model, batch_size, **fit_kwargs):
      history = run_with_adaptive_batch_size(
          batch_size, lambda **kwargs: model.fit(**kwargs), **fit_kwargs
      )
      return model, history
  
file_path: autokeras/autokeras/utils/utils.py
imports: import re
  import warnings
  import keras_tuner
  import tensorflow
  from packaging.version import parse
  from tensorflow import nest
label_desc: Use image node_id 8 for calling a global function with example usage: fit_with_adaptive_batch_size(model, batch_size) and returns: model,  history