code: def called_with_early_stopping(func):
      callbacks = func.call_args_list[0][1]["callbacks"]
      return any(
          [
              isinstance(callback, keras.callbacks.EarlyStopping)
              for callback in callbacks
          ]
      )
  
imports: from unittest import mock
  import numpy
  import tensorflow
  from tensorflow import keras
  from tensorflow.keras.layers.experimental import preprocessing
  import autokeras
  from autokeras import keras_layers
  from autokeras import test_utils
  from autokeras.engine import tuner
  from autokeras.tuners import greedy
label_desc: Use image node_id 1 for calling a global function with example usage: called_with_early_stopping(func) and returns: any