code: def test_deprecated_methods():
      tf.keras.backend.clear_session()
  
      train_data = np.array([1, 2])
      train_targets = np.array([[1, 0], [0, 1]])
  
      graph = example_graph_1(feature_size=2)
  
      _, keras_model, gen, train_gen = create_GAT_model(graph)
  
      ensemble = Ensemble(keras_model, n_estimators=1, n_predictions=1)
      bagging = BaggingEnsemble(
          keras_model, n_estimators=1, n_predictions=1
      )
      models = [ensemble, bagging]
      for model in models:
          model.compile(optimizer=Adam(), loss=binary_crossentropy)
  
      # check that each of the generator methods gives a warning, and also seems to behave like the
      # non-deprecated method
      with pytest.warns(
          DeprecationWarning, match="'fit_generator' .* 'fit'"
      ):
          ens_history = ensemble.fit_generator(
              train_gen, epochs=2, verbose=0
          )
      assert len(ens_history) == 1
      assert len(ens_history[0].history["loss"]) == 2
  
      with pytest.warns(
          DeprecationWarning, match="'fit_generator' .* 'fit'"
      ):
          bag_history = bagging.fit_generator(
              gen, train_data, train_targets, epochs=2, verbose=0
          )
      assert len(bag_history) == 1
      assert len(bag_history[0].history["loss"]) == 2
  
      for model in models:
          with pytest.warns(
              DeprecationWarning,
              match="'evaluate_generator' .* 'evaluate'",
          ):
              eval_result = model.evaluate_generator(
                  train_gen, verbose=0
              )
          np.testing.assert_array_equal(
              eval_result, model.evaluate(train_gen, verbose=0)
          )
  
          with pytest.warns(
              DeprecationWarning,
              match="'predict_generator' .* 'predict'",
          ):
              pred_result = model.predict_generator(
                  train_gen, verbose=0
              )
          np.testing.assert_array_equal(
              pred_result, model.predict(train_gen, verbose=0)
          )
  
imports: import pandas
  import pytest
  import numpy
  import tensorflow
  from stellargraph import StellarGraph
  from stellargraph.layer import GraphSAGE, GCN, GAT, HinSAGE, link_classification, link_regression
  from stellargraph.mapper import GraphSAGENodeGenerator, FullBatchNodeGenerator, HinSAGENodeGenerator, GraphSAGELinkGenerator, HinSAGELinkGenerator
  from stellargraph.ensemble import Ensemble, BaggingEnsemble
  from tensorflow.keras import layers, Model
  from tensorflow.keras.optimizers import Adam
  from tensorflow.keras.losses import categorical_crossentropy, binary_crossentropy
label_desc: Use image node_id 14 for calling a global function with example usage: test_deprecated_methods() without return types