code: def test_get_dgl_blocks_homo():
      node_pairs = [
          (
              torch.tensor([0, 1, 2, 2, 2, 1]),
              torch.tensor([0, 1, 1, 2, 3, 2]),
          ),
          (
              torch.tensor([0, 1, 2]),
              torch.tensor([1, 0, 0]),
          ),
      ]
      csc_formats = [
          gb.CSCFormatBase(
              indptr=torch.tensor([0, 1, 3, 5, 6]),
              indices=torch.tensor([0, 1, 2, 2, 1, 2]),
          ),
          gb.CSCFormatBase(
              indptr=torch.tensor([0, 1, 3]),
              indices=torch.tensor([0, 1, 2]),
          ),
      ]
      original_column_node_ids = [
          torch.tensor([10, 11, 12, 13]),
          torch.tensor([10, 11]),
      ]
      original_row_node_ids = [
          torch.tensor([10, 11, 12, 13]),
          torch.tensor([10, 11, 12]),
      ]
      original_edge_ids = [
          torch.tensor([19, 20, 21, 22, 25, 30]),
          torch.tensor([10, 15, 17]),
      ]
      node_features = {"x": torch.tensor([7, 6, 2, 2])}
      edge_features = [
          {"x": torch.tensor([[8], [1], [6]])},
          {"x": torch.tensor([[2], [8], [8]])},
      ]
      subgraphs = []
      for i in range(2):
          subgraphs.append(
              gb.SampledSubgraphImpl(
                  sampled_csc=csc_formats[i],
                  original_column_node_ids=original_column_node_ids[i],
                  original_row_node_ids=original_row_node_ids[i],
                  original_edge_ids=original_edge_ids[i],
              )
          )
      negative_srcs = torch.tensor([[8], [1], [6]])
      negative_dsts = torch.tensor([[2], [8], [8]])
      input_nodes = torch.tensor([8, 1, 6, 5, 9, 0, 2, 4])
      compacted_node_pairs = (
          torch.tensor([0, 1, 2]),
          torch.tensor([3, 4, 5]),
      )
      compacted_negative_srcs = torch.tensor([[0], [1], [2]])
      compacted_negative_dsts = torch.tensor([[6], [0], [0]])
      labels = torch.tensor([0.0, 1.0, 2.0])
      # Test minibatch with all attributes.
      minibatch = gb.MiniBatch(
          node_pairs=node_pairs,
          sampled_subgraphs=subgraphs,
          labels=labels,
          node_features=node_features,
          edge_features=edge_features,
          negative_srcs=negative_srcs,
          negative_dsts=negative_dsts,
          compacted_node_pairs=compacted_node_pairs,
          input_nodes=input_nodes,
          compacted_negative_srcs=compacted_negative_srcs,
          compacted_negative_dsts=compacted_negative_dsts,
      )
      dgl_blocks = minibatch.blocks
      expect_result = str(
          """[Block(num_src_nodes=4, num_dst_nodes=4, num_edges=6), Block(num_src_nodes=3, num_dst_nodes=2, num_edges=3)]"""
      )
      result = str(dgl_blocks)
      assert result == expect_result, print(result)
  
file_path: dgl/tests/python/pytorch/graphbolt/impl/test_minibatch.py
imports: import dgl
  import dgl.graphbolt
  import pytest
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: test_get_dgl_blocks_homo() without return types