code: def test_walk_generation_single_root_node_loner(self):
      g = create_test_graph()
      mrw = UniformRandomMetaPathWalk(g)
  
      seed = None
      nodes = ["loner"]  # has no edges, not even to itself
      n = 1
      length = 5
      metapaths = [["s", "n", "s"]]
  
      walks = mrw.run(
          nodes=nodes,
          n=n,
          length=length,
          metapaths=metapaths,
          seed=seed,
      )
      assert len(walks) == n
      assert len(walks[0]) == 1
  
      n = 5
      walks = mrw.run(
          nodes=nodes,
          n=n,
          length=length,
          metapaths=metapaths,
          seed=seed,
      )
      assert len(walks) == n
      for walk in walks:
          assert len(walk) == 1
  
file_path: stellargraph/tests/data/test_metapath_walker.py
imports: import pandas
  import numpy
  import pytest
  from stellargraph.data.explorer import UniformRandomMetaPathWalk
  from stellargraph.core.graph import StellarGraph
  from ..test_utils.graphs import example_graph_random
label_desc: Use image node_id 2 for calling the TestMetaPathWalk obj's underlying member method code with example usage: obj.test_walk_generation_single_root_node_loner() without return types