code: def test_run_batch_sizes(line_graph):
      batch_size = 4
      sampler = UnsupervisedSampler(
          G=line_graph, length=2, number_of_walks=2
      )
      batches = sampler.run(batch_size)
  
      # check batch sizes
      assert len(batches) == np.ceil(
          len(line_graph.nodes()) * 4 / batch_size
      )
      for ids, labels in batches[:-1]:
          assert len(ids) == len(labels) == batch_size
  
      # last batch can be smaller
      ids, labels = batches[-1]
      assert len(ids) == len(labels)
      assert len(ids) <= batch_size
  
file_path: stellargraph/tests/data/test_unsupervised_sampler.py
imports: import pytest
  import numpy
  from collections import defaultdict
  from stellargraph.data.unsupervised_sampler import UnsupervisedSampler
  from stellargraph.data.explorer import UniformRandomWalk
  from ..test_utils.graphs import line_graph
label_desc: Use image node_id 2 for calling a global function with example usage: test_run_batch_sizes(line_graph) without return types