code: def test_hinnodemapper_level_2():
      batch_size = 2
      feature_sizes = {"t1": 1, "t2": 2}
      G, nodes_type_1, nodes_type_2 = example_hin_2(feature_sizes)
  
      mapper = HinSAGENodeGenerator(
          G,
          batch_size=batch_size,
          num_samples=[2, 3],
          head_node_type="t2",
      ).flow(nodes_type_2)
  
      schema = G.create_graph_schema()
      sampling_adj = schema.type_adjacency_list(["t2"], 2)
  
      assert len(mapper) == 1
  
      # Get a batch!
      batch_feats, batch_targets = mapper[0]
  
      # Check types match adjacency list
      assert len(batch_feats) == len(sampling_adj)
      for bf, adj in zip(batch_feats, sampling_adj):
          nt = adj[0]
          assert bf.shape[0] == batch_size
          assert bf.shape[2] == feature_sizes[nt]
  
          batch_node_types = {G.node_type(n) for n in np.ravel(bf)}
  
          assert len(batch_node_types) == 1
          assert nt in batch_node_types
  
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 19 for calling a global function with example usage: test_hinnodemapper_level_2() without return types