code: def test_compile():
      tf.keras.backend.clear_session()
  
      graph = example_graph_1(feature_size=10)
  
      # base_model, keras_model, generator, train_gen
      gnn_models = [
          create_graphSAGE_model(graph),
          create_HinSAGE_model(graph),
          create_graphSAGE_model(graph, link_prediction=True),
          create_HinSAGE_model(graph, link_prediction=True),
          create_GCN_model(graph),
          create_GAT_model(graph),
      ]
  
      for gnn_model in gnn_models:
          keras_model = gnn_model[1]
          ens = Ensemble(keras_model, n_estimators=2, n_predictions=5)
  
          with pytest.raises(
              ValueError
          ):  # must specify the optimizer to use
              ens.compile(
                  optimizer=None,
                  loss=categorical_crossentropy,
                  weighted_metrics=["acc"],
              )
  
          # Repeat for BaggingEnsemble
          ens = BaggingEnsemble(
              keras_model, n_estimators=2, n_predictions=5
          )
  
          with pytest.raises(
              ValueError
          ):  # must specify the optimizer to use
              ens.compile(
                  optimizer=None,
                  loss=categorical_crossentropy,
                  weighted_metrics=["acc"],
              )
  
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 7 for calling a global function with example usage: test_compile() without return types