code: def test_from_dgl_hetero_graph():
      import dgl
  
      g = dgl.heterograph(
          {
              ("v1", "to", "v2"): (
                  [0, 1, 1, 2, 3, 3, 4],
                  [0, 0, 1, 1, 1, 2, 2],
              )
          }
      )
      g.nodes["v1"].data["x"] = torch.randn(5, 3)
      g.nodes["v2"].data["x"] = torch.randn(3, 3)
  
      data = from_dgl(g)
  
      assert data["v1", "v2"].num_edges == g.num_edges(
          ("v1", "to", "v2")
      )
      assert data["v1"].num_nodes == g.num_nodes("v1")
      assert data["v2"].num_nodes == g.num_nodes("v2")
      assert torch.equal(data["v1"].x, g.nodes["v1"].data["x"])
      assert torch.equal(data["v2"].x, g.nodes["v2"].data["x"])
  
imports: import pytest
  import scipy.sparse
  import torch
  from torch_geometric.data import Data, HeteroData
  from torch_geometric.testing import get_random_edge_index, withPackage
  from torch_geometric.utils import from_cugraph, from_dgl, from_networkit, from_networkx, from_scipy_sparse_matrix, from_trimesh, sort_edge_index, subgraph, to_cugraph, to_dgl, to_networkit, to_networkx, to_scipy_sparse_matrix, to_trimesh
label_desc: Use image node_id 30 for calling a global function with example usage: test_from_dgl_hetero_graph() without return types