code: def test_ItemSetDict_names():
      # ItemSetDict with single name.
      item_set = gb.ItemSetDict(
          {
              "user": gb.ItemSet(
                  torch.arange(0, 5), names="seed_nodes"
              ),
              "item": gb.ItemSet(
                  torch.arange(5, 10), names="seed_nodes"
              ),
          }
      )
      assert item_set.names == ("seed_nodes",)
  
      # ItemSetDict with multiple names.
      item_set = gb.ItemSetDict(
          {
              "user": gb.ItemSet(
                  (torch.arange(0, 5), torch.arange(5, 10)),
                  names=("seed_nodes", "labels"),
              ),
              "item": gb.ItemSet(
                  (torch.arange(5, 10), torch.arange(10, 15)),
                  names=("seed_nodes", "labels"),
              ),
          }
      )
      assert item_set.names == ("seed_nodes", "labels")
  
      # ItemSetDict with no name.
      item_set = gb.ItemSetDict(
          {
              "user": gb.ItemSet(torch.arange(0, 5)),
              "item": gb.ItemSet(torch.arange(5, 10)),
          }
      )
      assert item_set.names is None
  
      # ItemSetDict with mismatched items and names.
      with pytest.raises(
          AssertionError,
          match=re.escape("All itemsets must have the same names."),
      ):
          _ = gb.ItemSetDict(
              {
                  "user": gb.ItemSet(
                      (torch.arange(0, 5), torch.arange(5, 10)),
                      names=("seed_nodes", "labels"),
                  ),
                  "item": gb.ItemSet(
                      (torch.arange(5, 10),), names=("seed_nodes",)
                  ),
              }
          )
  
imports: import re
  import dgl
  import pytest
  import torch
  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_ItemSetDict_names() without return types