code: def create_test_graph(is_directed=False):
      # biased random walker, breadth first walker, directed breadth first walker, uniform random walker
  
      nodes = pd.DataFrame(
          index=[
              "0",
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              "self loner",
              "loner",
          ]
      )
      edges = pd.DataFrame(
          [
              ("0", 1),
              ("0", 2),
              (1, 3),
              (1, 4),
              (3, 6),
              (4, 7),
              (4, 8),
              (2, 5),
              (5, 9),
              (5, 10),
              ("0", "0"),
              (1, 1),
              (3, 3),
              (6, 6),
              (4, 4),
              (7, 7),
              (8, 8),
              (2, 2),
              (5, 5),
              (9, 9),
              (
                  "self loner",
                  "self loner",
              ),  # an isolated node with a self link
          ],
          columns=["source", "target"],
      )
      cls = StellarDiGraph if is_directed else StellarGraph
      return cls(nodes, edges)
  
imports: from stellargraph import StellarGraph, StellarDiGraph, IndexedArray
  import networkx
  import pandas
  import numpy
  import random
  import pytest
label_desc: Use image node_id 8 for calling a global function with example usage: create_test_graph(is_directed) and returns: cls