code: def create_test_graph(self_loop=False, multi=False):
      """
      Creates a graph for testing the SampledHeterogeneousBreadthFirstWalk class. The node ids are string or integers.
  
      :return: A multi graph with 8 nodes and 8 to 10 edges (one isolated node, a self-loop if
      ``self_loop``, and a repeated edge if ``multi``) in StellarGraph format.
      """
  
      nodes = {
          "user": pd.DataFrame(index=[0, 1, "5", 4, 7]),
          "movie": pd.DataFrame(index=[2, 3, 6]),
      }
      friends = [("5", 4), (1, 4), (1, "5")]
      friend_idx = [5, 6, 7]
      if self_loop:
          friends.append((7, 7))
          friend_idx.append(8)
  
      edges = {
          "rating": pd.DataFrame(
              [(1, 2), (1, 3), ("5", 6), ("5", 3), (4, 2)],
              columns=["source", "target"],
          ),
          # 7 is an isolated node with a link back to itself
          "friend": pd.DataFrame(
              friends, columns=["source", "target"], index=friend_idx
          ),
      }
  
      if multi:
          edges["colleague"] = pd.DataFrame(
              [(1, 4)], columns=["source", "target"], index=[123]
          )
  
      return StellarGraph(nodes, edges)
  
file_path: stellargraph/tests/data/test_heterogeneous_breadth_first_walker.py
imports: import pandas
  import numpy
  import pytest
  from stellargraph.data.explorer import SampledHeterogeneousBreadthFirstWalk
  from stellargraph.core.graph import StellarGraph
  from ..test_utils.graphs import example_graph_random
label_desc: Use image node_id 2 for calling a global function with example usage: create_test_graph(_loop, multi) and returns: StellarGraph