code: def _model_data(model_type, sparse):
      emb_dim = 16
  
      sparse_support = (GCN, APPNP, GAT, RGCN)
      if sparse and model_type not in sparse_support:
          pytest.skip(
              f"{model_type.__name__} doesn't support/use sparse=True"
          )
  
      if model_type in (GCN, APPNP, GAT, PPNP):
          G = example_graph_random()
          generator = FullBatchNodeGenerator(G, sparse=sparse)
          model = model_type(
              generator=generator,
              activations=["relu"],
              layer_sizes=[emb_dim],
          )
          nodes = G.nodes()
      elif model_type is GraphSAGE:
          G = example_graph_random()
          generator = GraphSAGENodeGenerator(
              G, batch_size=5, num_samples=[2, 3]
          )
          model = GraphSAGE(
              generator=generator, layer_sizes=[4, emb_dim]
          )
          nodes = G.nodes()
      elif model_type is DirectedGraphSAGE:
          G = example_graph_random(is_directed=True)
          generator = DirectedGraphSAGENodeGenerator(
              G, batch_size=5, in_samples=[2, 3], out_samples=[4, 1]
          )
          model = DirectedGraphSAGE(
              generator=generator, layer_sizes=[4, emb_dim]
          )
          nodes = G.nodes()
      elif model_type is HinSAGE:
          head_node_type = "n-1"
          node_types = 2
          G = example_graph_random(
              {nt: nt + 3 for nt in range(node_types)},
              node_types=node_types,
              edge_types=2,
          )
          generator = HinSAGENodeGenerator(
              G,
              batch_size=5,
              num_samples=[2, 2],
              head_node_type=head_node_type,
          )
          model = HinSAGE(generator=generator, layer_sizes=[4, emb_dim])
          nodes = G.nodes(node_type=head_node_type)
      elif model_type is RGCN:
          G = example_graph_random(10, edge_types=3)
          generator = RelationalFullBatchNodeGenerator(G, sparse=sparse)
          model = RGCN([4, emb_dim], generator)
          nodes = G.nodes()
  
      return generator, model, nodes
  
file_path: stellargraph/tests/layer/test_deep_graph_infomax.py
imports: from stellargraph.layer import *
  from stellargraph.mapper import *
  from ..test_utils.graphs import example_graph_random
  from ..None import require_gpu, test_utils
  import tensorflow
  import pytest
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _model_data(model_type, sparse) and returns: generator,  model,  nodes