code: def test_node2vec_nodemapper_constructor_nx():
      """
      Node2VecNodeGenerator requires a StellarGraph object
      """
      G = nx.Graph()
      G.add_nodes_from(range(4))
  
      with pytest.raises(TypeError):
          Node2VecNodeGenerator(G, batch_size=2)
  
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 32 for calling a global function with example usage: test_node2vec_nodemapper_constructor_nx() without return types