code: def test_FeatureFetcher_with_edges_homo():
      graph = gb_test_utils.rand_csc_graph(
          20, 0.15, bidirection_edge=True
      )
      a = torch.tensor(
          [
              [random.randint(0, 10)]
              for _ in range(graph.total_num_nodes)
          ]
      )
      b = torch.tensor(
          [
              [random.randint(0, 10)]
              for _ in range(graph.total_num_edges)
          ]
      )
  
      def add_node_and_edge_ids(seeds):
          subgraphs = []
          for _ in range(3):
              sampled_csc = gb.CSCFormatBase(
                  indptr=torch.arange(11),
                  indices=torch.arange(10),
              )
              subgraphs.append(
                  gb.SampledSubgraphImpl(
                      sampled_csc=sampled_csc,
                      original_column_node_ids=torch.arange(10),
                      original_row_node_ids=torch.arange(10),
                      original_edge_ids=torch.randint(
                          0, graph.total_num_edges, (10,)
                      ),
                  )
              )
          data = gb.MiniBatch(
              input_nodes=seeds, sampled_subgraphs=subgraphs
          )
          return data
  
      features = {}
      keys = [("node", None, "a"), ("edge", None, "b")]
      features[keys[0]] = gb.TorchBasedFeature(a)
      features[keys[1]] = gb.TorchBasedFeature(b)
      feature_store = gb.BasicFeatureStore(features)
  
      itemset = gb.ItemSet(torch.arange(10))
      item_sampler_dp = gb.ItemSampler(itemset, batch_size=2)
      converter_dp = Mapper(item_sampler_dp, add_node_and_edge_ids)
      fetcher_dp = gb.FeatureFetcher(
          converter_dp, feature_store, ["a"], ["b"]
      )
  
      assert len(list(fetcher_dp)) == 5
      for data in fetcher_dp:
          assert data.node_features["a"].size(0) == 2
          assert len(data.edge_features) == 3
          for edge_feature in data.edge_features:
              assert edge_feature["b"].size(0) == 10
  
file_path: dgl/tests/python/pytorch/graphbolt/test_feature_fetcher.py
imports: import random
  from enum import Enum
  import dgl.graphbolt
  import pytest
  import torch
  from torchdata.datapipes.iter import Mapper
  from .None import gb_test_utils
label_desc: Use image node_id 3 for calling a global function with example usage: test_FeatureFetcher_with_edges_homo() and returns: data