code: def test_ItemSetDict_node_pairs_negative_dsts(
      batch_size, shuffle, drop_last
  ):
      # Head, tail and negative tails.
      num_ids = 103
      total_ids = 2 * num_ids
      num_negs = 2
      node_paris_like = torch.arange(0, num_ids * 2).reshape(-1, 2)
      node_pairs_follow = torch.arange(
          num_ids * 2, num_ids * 4
      ).reshape(-1, 2)
      neg_dsts_like = torch.arange(
          num_ids * 4, num_ids * 4 + num_ids * num_negs
      ).reshape(-1, num_negs)
      neg_dsts_follow = torch.arange(
          num_ids * 4 + num_ids * num_negs,
          num_ids * 4 + num_ids * num_negs * 2,
      ).reshape(-1, num_negs)
      data_dict = {
          "user:like:item": gb.ItemSet(
              (node_paris_like, neg_dsts_like),
              names=("node_pairs", "negative_dsts"),
          ),
          "user:follow:user": gb.ItemSet(
              (node_pairs_follow, neg_dsts_follow),
              names=("node_pairs", "negative_dsts"),
          ),
      }
      item_set = gb.ItemSetDict(data_dict)
      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 isinstance(minibatch, gb.MiniBatch)
          assert minibatch.node_pairs is not None
          assert minibatch.negative_dsts is not None
          is_last = (i + 1) * batch_size >= total_ids
          if not is_last or total_ids % batch_size == 0:
              expected_batch_size = batch_size
          else:
              if not drop_last:
                  expected_batch_size = total_ids % batch_size
              else:
                  assert False
          src = []
          dst = []
          negs = []
          for _, node_pairs in minibatch.node_pairs.items():
              assert isinstance(node_pairs, tuple)
              src.append(node_pairs[0])
              dst.append(node_pairs[1])
          for _, v_negs in minibatch.negative_dsts.items():
              negs.append(v_negs)
          src = torch.cat(src)
          dst = torch.cat(dst)
          negs = torch.cat(negs)
          assert len(src) == expected_batch_size
          assert len(dst) == expected_batch_size
          assert len(negs) == expected_batch_size
          src_ids.append(src)
          dst_ids.append(dst)
          negs_ids.append(negs)
          assert negs.dim() == 2
          assert negs.shape[0] == expected_batch_size
          assert negs.shape[1] == num_negs
          assert torch.equal(src + 1, dst)
          assert torch.equal(negs[:, 0] + 1, negs[:, 1])
      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] <= negs_ids[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 16 for calling a global function with example usage: test_ItemSetDict_node_pairs_negative_dsts(batch_size, shuffle, drop_last) without return types