code: def test_APPNP_edge_cases():
      G, features = create_graph_features()
  
      generator = FullBatchNodeGenerator(G, sparse=False, method="gcn")
  
      try:
          appnpModel = APPNP(
              [2, 2],
              generator=generator,
              activations=["relu"],
              dropout=0.5,
          )
      except ValueError as e:
          error = e
      assert (
          str(error)
          == "The number of layers should equal the number of activations"
      )
  
      try:
          appnpModel = APPNP(
              [2], generator=[0, 1], activations=["relu"], dropout=0.5
          )
      except TypeError as e:
          error = e
      assert (
          str(error)
          == f"Generator should be a instance of FullBatchNodeGenerator, "
          f"FullBatchLinkGenerator or ClusterNodeGenerator"
      )
  
      try:
          appnpModel = APPNP(
              [2],
              generator=generator,
              activations=["relu"],
              dropout=0.0,
              approx_iter=-1,
          )
      except ValueError as e:
          error = e
      assert str(error) == "approx_iter should be a positive integer"
  
      try:
          appnpModel = APPNP(
              [2],
              generator=generator,
              activations=["relu"],
              dropout=0.0,
              approx_iter=1.2,
          )
      except ValueError as e:
          error = e
      assert str(error) == "approx_iter should be a positive integer"
  
      try:
          appnpModel = APPNP(
              [2],
              generator=generator,
              activations=["relu"],
              dropout=0.0,
              teleport_probability=1.2,
          )
      except ValueError as e:
          error = e
      assert (
          str(error)
          == "teleport_probability should be between 0 and 1 (inclusive)"
      )
  
      try:
          appnpModel = APPNP(
              [2],
              generator=generator,
              activations=["relu"],
              dropout=0.0,
              teleport_probability=1.2,
          )
      except ValueError as e:
          error = e
      assert (
          str(error)
          == "teleport_probability should be between 0 and 1 (inclusive)"
      )
  
file_path: stellargraph/tests/layer/test_appnp.py
imports: from stellargraph.layer.appnp import *
  from stellargraph.mapper import FullBatchNodeGenerator, FullBatchLinkGenerator
  from stellargraph import StellarGraph
  from stellargraph.core.utils import GCN_Aadj_feats_op
  import networkx
  import pandas
  import numpy
  from tensorflow import keras
  import pytest
  from ..test_utils.graphs import create_graph_features
  from ..None import test_utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_APPNP_edge_cases() without return types