class_docstr: Breadth First Walk that generates a sampled number of paths from a starting node.
  It can be used to extract a random sub-graph starting from a set of initial nodes from Neo4j database.
docstr: Send queries to Neo4j graph databases and collect sampled breadth-first walks starting from
  the root nodes.
  
  Args:
      nodes (list of hashable): A list of root node ids such that from each node n BFWs will
          be generated up to the given depth d.
      n_size (list of int): The number of neighbouring nodes to expand at each depth of the
          walk. Sampling of neighbours with replacement is always used regardless of the node
          degree and number of neighbours requested.
      n (int): Number of walks per node id.
      seed (int, optional): Random number generator seed; default is None
  
  Returns:
      A list of lists, each list is a sequence of sampled node ids at a certain hop.
docstr_tok: ["Send","queries","to","Neo4j","graph","databases","and","collect","sampled","breadth-first","walks","starting","from","the","root","nodes",".","Args",":","nodes","(","list","of","hashable",")",":","A","list","of","root","node","ids","such","that","from","each","node","n","BFWs","will","be","generated","up","to","the","given","depth","d.","n_size","(","list","of","int",")",":","The","number","of","neighbouring","nodes","to","expand","at","each","depth","of","the","walk",".","Sampling","of","neighbours","with","replacement","is","always","used","regardless","of","the","node","degree","and","number","of","neighbours","requested",".","n","(","int",")",":","Number","of","walks","per","node","id",".","seed","(","int",",","optional",")",":","Random","number","generator","seed",";","default","is","None","Returns",":","A","list","of","lists",",","each","list","is","a","sequence","of","sampled","node","ids","at","a","certain","hop","."]
code: def run(self, nodes=None, n=1, n_size=None):
      """
      Send queries to Neo4j graph databases and collect sampled breadth-first walks starting from
      the root nodes.
  
      Args:
          nodes (list of hashable): A list of root node ids such that from each node n BFWs will
              be generated up to the given depth d.
          n_size (list of int): The number of neighbouring nodes to expand at each depth of the
              walk. Sampling of neighbours with replacement is always used regardless of the node
              degree and number of neighbours requested.
          n (int): Number of walks per node id.
          seed (int, optional): Random number generator seed; default is None
  
      Returns:
          A list of lists, each list is a sequence of sampled node ids at a certain hop.
      """
  
      samples = [[head_node for head_node in nodes for _ in range(n)]]
      neighbor_query = _bfs_neighbor_query(
          sampling_direction="BOTH",
          id_property=self.graph.cypher_id_property,
          node_label=self.graph.cypher_node_label,
      )
  
      # this sends O(number of hops) queries to the database, because the code is cleanest like that
      for num_sample in n_size:
          cur_nodes = samples[-1]
          result = self.graph.graph_db.run(
              neighbor_query,
              parameters={
                  "node_id_list": cur_nodes,
                  "num_samples": num_sample,
              },
          )
          samples.append(result.data()[0]["next_samples"])
  
      return samples
  
file_path: stellargraph/stellargraph/connector/neo4j/sampler.py
imports: from ...core.experimental import experimental
  from .graph import Neo4jStellarGraph, Neo4jStellarDiGraph
label_desc: Use image node_id 2 for calling the Neo4jSampledBreadthFirstWalk obj's underlying member method code with example usage: obj.run(nodes, n, n_size) and returns: samples