code: def test_ItemSet_node_pairs_negative_dsts(
      batch_size, shuffle, drop_last
  ):
      # Node pairs and negative destinations.
      num_ids = 103
      num_negs = 2
      node_pairs = torch.arange(0, 2 * num_ids).reshape(-1, 2)
      neg_dsts = torch.arange(
          2 * num_ids, 2 * num_ids + num_ids * num_negs
      ).reshape(-1, num_negs)
      item_set = gb.ItemSet(
          (node_pairs, neg_dsts), names=("node_pairs", "negative_dsts")
      )
      item_sampler = gb.ItemSampler(
          item_set,
          batch_size=batch_size,
          shuffle=shuffle,
          drop_last=drop_last,
      )
      src_ids = []
      dst_ids = []
      negs_ids = []
      for i, minibatch in enumerate(item_sampler):
          assert minibatch.node_pairs is not None
          assert isinstance(minibatch.node_pairs, tuple)
          assert minibatch.negative_dsts is not None
          src, dst = minibatch.node_pairs
          negs = minibatch.negative_dsts
          is_last = (i + 1) * batch_size >= num_ids
          if not is_last or num_ids % batch_size == 0:
              expected_batch_size = batch_size
          else:
              if not drop_last:
                  expected_batch_size = num_ids % batch_size
              else:
                  assert False
          assert len(src) == expected_batch_size
          assert len(dst) == expected_batch_size
          assert negs.dim() == 2
          assert negs.shape[0] == expected_batch_size
          assert negs.shape[1] == num_negs
          # Verify node pairs and negative destinations.
          assert torch.equal(src + 1, dst)
          assert torch.equal(negs[:, 0] + 1, negs[:, 1])
          # Archive batch.
          src_ids.append(src)
          dst_ids.append(dst)
          negs_ids.append(negs)
      src_ids = torch.cat(src_ids)
      dst_ids = torch.cat(dst_ids)
      negs_ids = torch.cat(negs_ids)
      assert torch.all(src_ids[:-1] <= src_ids[1:]) is not shuffle
      assert torch.all(dst_ids[:-1] <= dst_ids[1:]) is not shuffle
      assert (
          torch.all(negs_ids[:-1, 0] <= negs_ids[1:, 0]) is not shuffle
      )
      assert (
          torch.all(negs_ids[:-1, 1] <= negs_ids[1:, 1]) is not shuffle
      )
  
imports: import os
  import re
  from sys import platform
  import dgl
  import pytest
  import torch
  import torch.distributed
  import torch.multiprocessing
  from dgl import graphbolt
  from torch.testing import assert_close
label_desc: Use image node_id 9 for calling a global function with example usage: test_ItemSet_node_pairs_negative_dsts(batch_size, shuffle, drop_last) without return types