code: def test_node2vec_nodemapper_1():
      n_batch = 2
  
      # test graph
      G1 = example_graph()
  
      mapper1 = Node2VecNodeGenerator(G1, batch_size=n_batch).flow(
          G1.nodes()
      )
      assert len(mapper1) == 2
  
      G2 = example_graph_2()
  
      mapper2 = Node2VecNodeGenerator(G2, batch_size=n_batch).flow(
          G2.nodes()
      )
      assert len(mapper2) == 3
  
      for mapper in [mapper1, mapper2]:
          for ii in range(2):
              nf, nl = mapper[ii]
              assert nf.shape == (n_batch,)
              assert nl is None
  
      # Check beyond the graph lengh
      with pytest.raises(IndexError):
          nf, nl = mapper1[len(mapper1)]
  
      # Check the last batch
      nf, nl = mapper2[len(mapper2) - 1]
      assert nf.shape == (1,)
  
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 34 for calling a global function with example usage: test_node2vec_nodemapper_1() without return types