code: def test_dgi(model_type, sparse):
      if sparse and model_type is PPNP:
          pytest.skip("PPNP doesn't support sparse=True")
  
      G = example_graph_random()
      generator = FullBatchNodeGenerator(G, sparse=sparse)
      corrupted_generator = CorruptedGenerator(generator)
      gen = corrupted_generator.flow(G.nodes())
  
      assert_reproducible(lambda: dgi(generator, gen, model_type))
  
file_path: stellargraph/tests/reproducibility/test_deep_graph_infomax.py
imports: from .fixtures import assert_reproducible
  from stellargraph.layer import DeepGraphInfomax, GCN, APPNP, GAT, PPNP
  from stellargraph.mapper import FullBatchNodeGenerator, CorruptedGenerator
  from ..test_utils.graphs import example_graph_random
  from ..None import require_gpu
  import tensorflow
  import pytest
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_dgi(model_type, sparse) without return types