code: def test_walk_generation_self_loner_root_node(self):
      g = create_test_graph()
      urw = UniformRandomWalk(g)
  
      nodes = [
          "self loner"
      ]  # this node has link to self but no other edges
      n = 1
      length = 1
      seed = None
  
      subgraphs = urw.run(nodes=nodes, n=n, length=length, seed=seed)
      assert len(subgraphs) == 1
      assert len(subgraphs[0]) == 1
  
      n = 10
      length = 1
      subgraphs = urw.run(nodes=nodes, n=n, length=length, seed=seed)
      assert len(subgraphs) == n
      for subgraph in subgraphs:
          assert len(subgraph) == length
          for node in subgraph:
              assert (
                  node == "self loner"
              )  # all nodes should be the same node
  
      n = 1
      length = 99
      subgraphs = urw.run(nodes=nodes, n=n, length=length, seed=seed)
      assert len(subgraphs) == n
      for subgraph in subgraphs:
          assert len(subgraph) == length
          for node in subgraph:
              assert (
                  node == "self loner"
              )  # all nodes should be the same node
  
      n = 10
      length = 10
      subgraphs = urw.run(nodes=nodes, n=n, length=length, seed=seed)
      assert len(subgraphs) == n
      for subgraph in subgraphs:
          assert len(subgraph) == length
          for node in subgraph:
              assert node == "self loner"
  
file_path: stellargraph/tests/data/test_uniform_random_walker.py
imports: import pytest
  import numpy
  from stellargraph.data.explorer import UniformRandomWalk
  from ..test_utils.graphs import create_test_graph, example_graph_random
label_desc: Use image node_id 5 for calling the TestUniformRandomWalk obj's underlying member method code with example usage: obj.test_walk_generation_self_loner_root_node() without return types