code: def test_parameter_checking(self):
      g = create_test_graph(is_directed=True)
      bfw = DirectedBreadthFirstNeighbours(g)
  
      nodes = g.node_ids_to_ilocs(["0", 1])
      n = 1
      in_size = [1]
      out_size = [1]
  
      with pytest.raises(ValueError):
          # nodes should be a list of node ids even for a single node
          bfw.run(nodes=None, n=n, in_size=in_size, out_size=out_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=0, n=n, in_size=in_size, out_size=out_size)
  
      # n has to be positive integer
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=-1, in_size=in_size, out_size=out_size)
      with pytest.raises(ValueError):
          bfw.run(
              nodes=nodes, n=10.1, in_size=in_size, out_size=out_size
          )
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=0, in_size=in_size, out_size=out_size)
  
      # sizes have to be list of non-negative integers
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=0, out_size=out_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=in_size, out_size=[-5])
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=-1, in_size=[2.4], out_size=out_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=in_size, out_size=(1, 2))
  
      # sizes have to have same length
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=[1, 2], out_size=[3])
  
      # okay to have zero sized samples
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=in_size, out_size=[0, 0])
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=in_size, out_size=[1, 0])
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=in_size, out_size=[0, 5])
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=[0, 0], out_size=out_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=[1, 0], out_size=out_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, in_size=[0, 5], out_size=out_size)
      # Is it okay if a zero appears in the same place for both in and out sizes? For now, yes.
      subgraph = bfw.run(
          nodes=nodes, n=n, in_size=[5, 0], out_size=[1, 0]
      )
      assert len(subgraph) == len(nodes)
  
      # seed must be positive integer or 0
      with pytest.raises(ValueError):
          bfw.run(
              nodes=nodes,
              n=n,
              in_size=in_size,
              out_size=out_size,
              seed=-1235,
          )
      with pytest.raises(ValueError):
          bfw.run(
              nodes=nodes,
              n=n,
              in_size=in_size,
              out_size=out_size,
              seed=10.987665,
          )
      with pytest.raises(ValueError):
          bfw.run(
              nodes=nodes,
              n=n,
              in_size=in_size,
              out_size=out_size,
              seed=-982.4746,
          )
      with pytest.raises(ValueError):
          bfw.run(
              nodes=nodes,
              n=n,
              in_size=in_size,
              out_size=out_size,
              seed="don't be random",
          )
  
      # If no root nodes are given, an empty list is returned, which is not an error.
      nodes = []
      subgraph = bfw.run(
          nodes=nodes, n=n, in_size=in_size, out_size=out_size
      )
      assert len(subgraph) == 0
  
file_path: stellargraph/tests/data/test_directed_breadth_first_sampler.py
imports: import random
  import pytest
  import pandas
  import numpy
  from stellargraph.data.explorer import DirectedBreadthFirstNeighbours
  from stellargraph.core.graph import StellarDiGraph
  from ..test_utils.graphs import create_test_graph, tree_graph, example_graph_random, weighted_tree
label_desc: Use image node_id 1 for calling the TestDirectedBreadthFirstNeighbours obj's underlying member method code with example usage: obj.test_parameter_checking() without return types