code: def test_walk_generation_number_of_walks_per_root_nodes(self):
      g = create_test_graph()
      bfw = SampledBreadthFirstWalk(g)
  
      nodes = [1]
      n = 2
      n_size = [0]
  
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == len(nodes) * n
      for i, subgraph in enumerate(subgraphs):
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
          assert subgraph[0] == nodes[0]  # should equal the root node
  
      n_size = [1]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == len(nodes) * n
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      n_size = [2]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == len(nodes) * n
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      n_size = [3]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == len(nodes) * n
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      #############################################################
      nodes = [1, 5]
      n_size = [1]
      n = 2
  
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == n * len(nodes)
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      n_size = [2]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == n * len(nodes)
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      n_size = [3]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == n * len(nodes)
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      #############################################################
      nodes = [1, 5]
      n_size = [2, 2]
      n = 3
  
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == n * len(nodes)
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      n_size = [3, 3]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == n * len(nodes)
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
      n_size = [4, 4]
      subgraphs = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraphs) == n * len(nodes)
      for subgraph in subgraphs:
          assert len(subgraph) == expected_bfw_size(n_size=n_size)
  
file_path: stellargraph/tests/data/test_breadth_first_walker.py
imports: import pandas
  import pytest
  import numpy
  from stellargraph.data.explorer import SampledBreadthFirstWalk
  from stellargraph.core.graph import StellarGraph, StellarDiGraph
  from ..test_utils.graphs import create_test_graph, tree_graph, example_graph_random, weighted_tree
label_desc: Use image node_id 7 for calling the TestBreadthFirstWalk obj's underlying member method code with example usage: obj.test_walk_generation_number_of_walks_per_root_nodes() without return types