code: def test_hinnodemapper_with_labels():
      batch_size = 2
      feature_sizes = {"t1": 1, "t2": 2}
      G, nodes_type_1, nodes_type_2 = example_hin_2(feature_sizes)
  
      labels = [n * 2 for n in nodes_type_1]
  
      gen = HinSAGENodeGenerator(
          G,
          batch_size=batch_size,
          num_samples=[2, 3],
          head_node_type="t1",
      ).flow(nodes_type_1, labels, shuffle=False)
      assert len(gen) == 2
  
      for ii in range(2):
          nf, nl = gen[ii]
  
          # Check sizes of neighbours and features (in bipartite graph)
          assert len(nf) == 3
          assert nf[0].shape == (2, 1, 1)
          assert nf[1].shape == (2, 2, 2)
          assert nf[2].shape == (2, 2 * 3, 1)
  
          # Check labels
          assert all(
              int(a) == int(2 * b) for a, b in zip(nl, nf[0][:, 0, 0])
          )
  
      # Check beyond the graph lengh
      with pytest.raises(IndexError):
          nf, nl = gen[len(gen)]
  
imports: from stellargraph.core.graph import *
  from stellargraph.mapper import *
  import networkx
  import numpy
  import random
  import pytest
  import pandas
  import scipy.sparse
  from ..test_utils.graphs import example_graph, example_graph_random, example_hin_1, create_graph_features, repeated_features, weighted_tree
  from ..None import test_utils
label_desc: Use image node_id 21 for calling a global function with example usage: test_hinnodemapper_with_labels() without return types