code: def test_NegativeSampler_invoke():
      # Instantiate graph and required datapipes.
      num_seeds = 30
      item_set = gb.ItemSet(
          torch.arange(0, 2 * num_seeds).reshape(-1, 2),
          names="node_pairs",
      )
      batch_size = 10
      item_sampler = gb.ItemSampler(item_set, batch_size=batch_size)
      negative_ratio = 2
  
      # Invoke NegativeSampler via class constructor.
      negative_sampler = gb.NegativeSampler(
          item_sampler,
          negative_ratio,
      )
      with pytest.raises(NotImplementedError):
          next(iter(negative_sampler))
  
      # Invoke NegativeSampler via functional form.
      negative_sampler = item_sampler.sample_negative(
          negative_ratio,
      )
      with pytest.raises(NotImplementedError):
          next(iter(negative_sampler))
  
file_path: dgl/tests/python/pytorch/graphbolt/impl/test_negative_sampler.py
imports: import dgl.graphbolt
  import pytest
  import torch
  from ..None import gb_test_utils
label_desc: Use image node_id 1 for calling a global function with example usage: test_NegativeSampler_invoke() without return types