code: def test_node2vec_constructor():
      node2vec = Node2Vec(emb_size=4, node_num=4, multiplicity=2)
      assert node2vec.emb_size == 4
      assert node2vec.input_node_num == 4
      assert node2vec.multiplicity == 2
  
      # Check requirement for generator or node_num & multiplicity
      with pytest.raises(ValueError):
          Node2Vec(emb_size=4)
      with pytest.raises(ValueError):
          Node2Vec(emb_size=4, node_num=4)
      with pytest.raises(ValueError):
          Node2Vec(emb_size=4, multiplicity=2)
  
      # Construction from generator
      G = example_graph()
      gen = Node2VecNodeGenerator(G, batch_size=2)
      node2vec = Node2Vec(emb_size=4, generator=gen)
  
      assert node2vec.emb_size == 4
      assert node2vec.input_node_num == 4
      assert node2vec.multiplicity == 1
  
file_path: stellargraph/tests/layer/test_node2vec.py
imports: from stellargraph.core.graph import StellarGraph
  from stellargraph.mapper import Node2VecNodeGenerator
  from stellargraph.layer.node2vec import *
  from tensorflow import keras
  import numpy
  import pytest
  from ..test_utils.graphs import example_graph
  from ..None import test_utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_node2vec_constructor() without return types