code: def test_walker_custom(line_graph):
      walker = CustomWalker()
      sampler = UnsupervisedSampler(line_graph, walker=walker)
      batches = sampler.run(2)
  
      assert len(batches) == line_graph.number_of_nodes()
  
      # all positive examples should be self loops, since we defined our custom walker this way
      for context_pairs, labels in batches:
          for node, neighbour in context_pairs[labels == 1]:
              assert node == neighbour
  
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 5 for calling a global function with example usage: test_walker_custom(line_graph) without return types